Documentation ¶
Index ¶
- func AuthenticateAdmin(fn manipulateAnythingFromAdmin) func(params graphql.ResolveParams) (interface{}, error)
- func AuthenticateUser(fn manipulateAnythingFromUser) func(params graphql.ResolveParams) (interface{}, error)
- func GenerateRandomString(n int) string
- func GetContextInjected(ctx context.Context) (string, error)
- func GetPrincipalID() interface{}
- func GetResolvers(sample []map[string]*graphql.Field) map[string]*graphql.Field
- func InitializePayment(context context.Context, req paystack.TransactionRequest) (*paystack.TransactionAuthorization, error)
- func MustGet(k string) string
- func MustGetBool(k string) bool
- func Sentry()
- func VerifyPayment(reference string) (*paystack.Response, error)
- type AdminFromToken
- type DateRangeType
- type FilterQuery
- type Search
- type UserFromToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateAdmin ¶
func AuthenticateAdmin(fn manipulateAnythingFromAdmin) func(params graphql.ResolveParams) (interface{}, error)
AuthenticateAdmin checks if the user trying to access that resource is truly an Admin
func AuthenticateUser ¶
func AuthenticateUser(fn manipulateAnythingFromUser) func(params graphql.ResolveParams) (interface{}, error)
AuthenticateUser checks if the user trying to access that resource is truly a user (customer, lawyer)
func GenerateRandomString ¶
GenerateRandomString generates a random string
func GetContextInjected ¶
GetContextInjected helps get the context data with the specific key given to that context value
func GetPrincipalID ¶
func GetPrincipalID() interface{}
GetPrincipalID returns a unique context value name for each hit
func GetResolvers ¶
GetReolvers helps you get reolvers from individual models
func InitializePayment ¶
func InitializePayment(context context.Context, req paystack.TransactionRequest) (*paystack.TransactionAuthorization, error)
func MustGetBool ¶
MustGetBool will return the env as boolean or panic if it is not present
Types ¶
type AdminFromToken ¶
AdminFromToken unmarshals cliams from jwt to get admin id
type DateRangeType ¶
type DateRangeType struct { StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` }
DateRangeType typings
type FilterQuery ¶
type FilterQuery struct { Limit int `json:"limit"` Skip int `json:"skip"` Order string `json:"order"` OrderBy string `json:"orderBy"` Search *Search `json:"search"` DateRange *DateRangeType `json:"dateRange"` }
FilterQuery type to help generate filter for queries
func GenerateQuery ¶
func GenerateQuery(argument map[string]interface{}) (*FilterQuery, error)
GenerateQuery takes a loook at what is coming from client and then generates a sieve
type Search ¶
type Search struct { Criteria string `json:"criteria"` SearchFields []interface{} `json:"searchFields"` }
Search typings
type UserFromToken ¶
UserFromToken unmarshals cliams from jwt to get admin id