Documentation ¶
Overview ¶
Package servicecontext performs context values read/write, generally through server or client wrappers
Index ¶
- Constants
- func GetConfig(ctx context.Context) config.Map
- func GetDAO(ctx context.Context) dao.DAO
- func GetRequestID(ctx context.Context) string
- func GetServiceColor(ctx context.Context) uint64
- func GetServiceName(ctx context.Context) string
- func GetSessionID(ctx context.Context) string
- func HttpMetaExtractorWrapper(h http.Handler) http.Handler
- func HttpRequestInfoToMetadata(ctx context.Context, req *http.Request) context.Context
- func HttpSpanHandlerWrapper(h http.Handler) http.Handler
- func ScanConfig(ctx context.Context, target interface{}) error
- func SpanClientWrapper(c client.Client) client.Client
- func SpanHandlerWrapper(fn server.HandlerFunc) server.HandlerFunc
- func WithConfig(ctx context.Context, config config.Map) context.Context
- func WithConn(ctx context.Context, conn dao.Conn) context.Context
- func WithDAO(ctx context.Context, dao dao.DAO) context.Context
- func WithRequestID(ctx context.Context, requestID string) context.Context
- func WithServiceColor(ctx context.Context, color ...uint64) context.Context
- func WithServiceName(ctx context.Context, serviceName string) context.Context
- func WithSessionID(ctx context.Context, sessionID string) context.Context
- func WithSpan(ctx context.Context, s *Span) context.Context
- type Span
Constants ¶
const ( HttpMetaExtracted = "HttpMetaExtracted" HttpMetaRemoteAddress = "RemoteAddress" HttpMetaRequestMethod = "RequestMethod" HttpMetaRequestURI = "RequestURI" HttpMetaProtocol = "HttpProtocol" HttpMetaUserAgent = "UserAgent" HttpMetaContentType = "ContentType" HttpMetaCoookiesString = "CookiesString" ClientTime = "ClientTime" ServerTime = "ServerTime" )
const ( SpanMetadataId = "x-pydio-span-id" SpanMetadataRootParentId = "x-pydio-span-root-id" )
Variables ¶
This section is empty.
Functions ¶
func GetRequestID ¶
GetRequestID returns the session id associated to this context
func GetServiceColor ¶
GetServiceColor returns the service name associated to this context
func GetServiceName ¶
GetServiceName returns the service name associated to this context
func GetSessionID ¶
GetSessionID returns the session id associated to this context
func HttpMetaExtractorWrapper ¶
Extract data from request and put it in context Metadata field
func HttpRequestInfoToMetadata ¶
Try to extract as much HTTP metadata as possible and store it in context metadata
func HttpSpanHandlerWrapper ¶
Extract data from request and put it in context Metadata field
func ScanConfig ¶
GetConfig already unmarshalled in a specific format
func SpanHandlerWrapper ¶
func SpanHandlerWrapper(fn server.HandlerFunc) server.HandlerFunc
func WithConfig ¶
WithConfig links a config to the context
func WithRequestID ¶
WithRequestID returns a context which knows its request ID
func WithServiceColor ¶
WithServiceColor returns a context which knows its service assigned color
func WithServiceName ¶
WithServiceName returns a context which knows its service name
func WithSessionID ¶
WithSessionID returns a context which knows its session ID