Documentation ¶
Index ¶
- Variables
- func GetArgs(ctx context.Context) (value map[string]string)
- func GetBody(ctx context.Context) interface{}
- func GetParams(ctx context.Context) (params map[string]string)
- func GetPath(ctx context.Context) (path string)
- func GetRequestID(ctx context.Context) (requestID string)
- func GetUser(ctx context.Context) (user interface{})
- func New() context.Context
- func SetArgs(ctx context.Context, value map[string]string) context.Context
- func SetBody(ctx context.Context, body interface{}) context.Context
- func SetParams(ctx context.Context, value map[string]string) context.Context
- func SetPath(ctx context.Context, value string) context.Context
- func SetRequestID(ctx context.Context, requestID string) context.Context
- func SetUser(ctx context.Context, value interface{}) context.Context
- type ContextArgumentsKey
- type ContextBodyKey
- type ContextParamsKey
- type ContextPathKey
- type ContextRequestIDKey
- type ContextUserKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // UserKey static key for UserObject in context UserKey ContextUserKey // ParamsKey static key for Query parameters in request ParamsKey ContextParamsKey // PathKey path string key for context PathKey ContextPathKey // ArgsKey key for arguments in URL ArgsKey ContextArgumentsKey // BodyKey key for body in a request BodyKey ContextBodyKey // RequestIDKey key for request ID RequestIDKey ContextRequestIDKey )
Functions ¶
func GetArgs ¶
GetArgs get the arguments and return as a map[string]string used mainly for url defined parameters like name or id for RESTful APIs
func GetParams ¶
GetParams gets a param as map[string]string if exists used mainly for url arguments like key=value
func GetRequestID ¶
GetRequestID get request ID from context
func SetArgs ¶
SetArgs set a map to a a args key used mainly for url defined parameters like name or id for RESTful APIs
func SetParams ¶
SetParams sets a map[string]string to the context used mainly for url arguments like key=value
func SetRequestID ¶
SetRequestID sets a request ID into context
Types ¶
Click to show internal directories.
Click to hide internal directories.