Documentation ¶
Index ¶
- func ComponentFromContext(ctx context.Context) (string, bool)
- func FromComponent(ctx context.Context, component string) context.Context
- func FromJobID(ctx context.Context, jobID uint64) context.Context
- func FromProcessor(ctx context.Context, processor string) context.Context
- func FromRepository(ctx context.Context, repository string) context.Context
- func FromUUID(ctx context.Context, uuid string) context.Context
- func JobIDFromContext(ctx context.Context) (uint64, bool)
- func LoggerFromContext(ctx context.Context) *logrus.Entry
- func ProcessorFromContext(ctx context.Context) (string, bool)
- func RepositoryFromContext(ctx context.Context) (string, bool)
- func UUIDFromContext(ctx context.Context) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentFromContext ¶
ComponentFromContext returns the component name stored in the context with FromComponent. If no component name was stored in the context, the second argument is false. Otherwise it is true.
func FromComponent ¶
FromComponent generates a new context with the given context as its parent and stores the given component name with the context. The component name can be retrieved again using ComponentFromContext.
func FromJobID ¶
FromJobID generates a new context with the given context as its parent and stores the given job ID with the context. The job ID can be retrieved again using JobIDFromContext.
func FromProcessor ¶
FromProcessor generates a new context with the given context as its parent and stores the given processor ID with the context. The processor ID can be retrieved again using ProcessorFromContext.
func FromRepository ¶
FromRepository generates a new context with the given context as its parent and stores the given repository name with the context. The repository name can be retrieved again using RepositoryFromContext.
func FromUUID ¶
FromUUID generates a new context with the given context as its parent and stores the given UUID with the context. The UUID can be retrieved again using UUIDFromContext.
func JobIDFromContext ¶
JobIDFromContext returns the job ID stored in the context with FromJobID. If no job ID was stored in the context, the second argument is false. Otherwise it is true.
func LoggerFromContext ¶
LoggerFromContext returns a logrus.Entry with the PID of the current process set as a field, and also includes every field set using the From* functions this package.
func ProcessorFromContext ¶
ProcessorFromContext returns the processor name stored in the context with FromProcessor. If no processor name was stored in the context, the second argument is false. Otherwise it is true.
func RepositoryFromContext ¶
RepositoryFromContext returns the repository name stored in the context with FromRepository. If no repository name was stored in the context, the second argument is false. Otherwise it is true.
Types ¶
This section is empty.