Documentation ¶
Index ¶
- func GetValueFromContext(ctx context.Context, key ContextKey) interface{}
- func SetToContext(ctx context.Context, key ContextKey, value interface{}) context.Context
- func WorkerErrorHandler(ctx context.Context, workerType types.Worker, workerName string, ...)
- type ContextKey
- type Filter
- type GraphQLErrorResolver
- type Meta
- type MetaResolver
- type Queue
- type Result
- type SliceResult
- type TokenClaim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValueFromContext ¶
func GetValueFromContext(ctx context.Context, key ContextKey) interface{}
GetValueFromContext will get context with specific key
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey represent Key of all context
const ( // ContextKeyHTTPHeader context key ContextKeyHTTPHeader ContextKey = "httpHeader" // ContextKeyTaskQueueRetry context key ContextKeyTaskQueueRetry ContextKey = "taskQueueRetry" // ContextKeyTokenClaim context key ContextKeyTokenClaim ContextKey = "tokenClaim" )
type Filter ¶
type Filter struct { Limit int32 `json:"limit" default:"10"` Page int32 `json:"page" default:"1"` Offset int32 `json:"-"` Search string `json:"search,omitempty"` OrderBy string `json:"orderBy,omitempty"` Sort string `json:"sort,omitempty" default:"desc" lower:"true"` }
Filter data
type GraphQLErrorResolver ¶
GraphQLErrorResolver graphql error with extensions
func NewGraphQLErrorResolver ¶
func NewGraphQLErrorResolver(errMesage string, extensions map[string]interface{}) GraphQLErrorResolver
NewGraphQLErrorResolver constructor
type Meta ¶
type Meta struct { Page int `json:"page"` Limit int `json:"limit"` TotalRecords int `json:"totalRecords"` TotalPages int `json:"totalPages"` }
Meta model
func NewMeta ¶
NewMeta create new meta for slice data
type MetaResolver ¶
type MetaResolver struct { Page int32 `json:"page"` Limit int32 `json:"limit"` TotalRecords int32 `json:"totalRecords"` TotalPages int32 `json:"totalPages"` }
MetaResolver model for graphql resolver, graphql doesn't support int64 data type (https://github.com/graphql/graphql-spec/issues/73)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue represents a single instance of the queue data structure.
func (*Queue) Len ¶
Len returns the number of elements currently stored in the queue.
func (*Queue) Peek ¶
func (q *Queue) Peek() interface{}
Peek returns the element at the head of the queue. This call panics if the queue is empty.
Click to show internal directories.
Click to hide internal directories.