feat: implement resolvers
This commit is contained in:
@@ -4,3 +4,27 @@ package utils
|
||||
func NewStringRef(v string) *string {
|
||||
return &v
|
||||
}
|
||||
|
||||
// StringValue returns the value of the given string ref
|
||||
func StringValue(r *string, defaultValue ...string) string {
|
||||
if r != nil {
|
||||
return *r
|
||||
}
|
||||
if len(defaultValue) > 0 {
|
||||
return defaultValue[0]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// NewBoolRef returns a reference to a bool with given value
|
||||
func NewBoolRef(v bool) *bool {
|
||||
return &v
|
||||
}
|
||||
|
||||
// BoolValue returns the value of the given bool ref
|
||||
func BoolValue(r *bool) bool {
|
||||
if r != nil {
|
||||
return false
|
||||
}
|
||||
return *r
|
||||
}
|
||||
|
1
server/utils/webhook.go
Normal file
1
server/utils/webhook.go
Normal file
@@ -0,0 +1 @@
|
||||
package utils
|
Reference in New Issue
Block a user