Documentation ¶
Index ¶
- func GetValueFromContext(ctx context.Context, key ContextKey) interface{}
- func HTTPMemstatsHandler(w http.ResponseWriter, r *http.Request)
- func HTTPRoot(serviceName, buildNumber string) http.HandlerFunc
- func ParseWorkerKeyFromContext(ctx context.Context) []byte
- func SetToContext(ctx context.Context, key ContextKey, value interface{}) context.Context
- type ContextKey
- type ErrorRetrier
- type Filter
- type GraphQLErrorResolver
- type Meta
- type PublisherArgument
- 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
func HTTPMemstatsHandler ¶ added in v1.5.24
func HTTPMemstatsHandler(w http.ResponseWriter, r *http.Request)
HTTPMemstatsHandler calculate runtime statistic
func HTTPRoot ¶ added in v1.5.24
func HTTPRoot(serviceName, buildNumber string) http.HandlerFunc
HTTPRoot http handler
func ParseWorkerKeyFromContext ¶ added in v1.5.4
ParseWorkerKeyFromContext parse token claim from given context
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" // ContextKeyWorkerKey context key ContextKeyWorkerKey ContextKey = "workerKey" )
type ErrorRetrier ¶ added in v1.5.26
ErrorRetrier task queue worker for retry error with retry count and delay between retry
func (*ErrorRetrier) Error ¶ added in v1.5.26
func (e *ErrorRetrier) Error() string
Error implement error
type Filter ¶
type Filter struct { Limit int `json:"limit" default:"10"` Page int `json:"page" default:"1"` Offset int `json:"-"` Search string `json:"search,omitempty"` OrderBy string `json:"orderBy,omitempty"` Sort string `json:"sort,omitempty" default:"desc" lower:"true"` ShowAll bool `json:"showAll"` }
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 PublisherArgument ¶ added in v1.5.19
type PublisherArgument struct { // Topic or queue name Topic string Key string Header map[string]interface{} ContentType string Data interface{} }
PublisherArgument declare publisher argument
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 ¶
Peek returns the element at the head of the queue. This call panics if the queue is empty.
func (*Queue) Pop ¶
Pop Pops and returns the element from the front of the queue. If the queue is empty, the call will panic.
type SliceResult ¶
SliceResult include meta
type TokenClaim ¶
type TokenClaim struct { jwt.StandardClaims Role string Additional interface{} }
TokenClaim for token claim data
func ParseTokenClaimFromContext ¶
func ParseTokenClaimFromContext(ctx context.Context) *TokenClaim
ParseTokenClaimFromContext parse token claim from given context