feat: implement resolvers

This commit is contained in:
Lakhan Samani
2022-07-10 21:49:33 +05:30
parent 09c3eafe6b
commit e91a819067
87 changed files with 1807 additions and 428 deletions

View File

@@ -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
View File

@@ -0,0 +1 @@
package utils