fcontext

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceID

func DeviceID(ctx context.Context) model.DeviceID

DeviceID from context.

func Logger

func Logger(ctx context.Context) logger.Logger

Logger from context. It may be null so use carefully.

func RequestID

func RequestID(ctx context.Context) string

RequestID gets request id from context or generates a new one

func WithDeviceID

func WithDeviceID(ctx context.Context, deviceID model.DeviceID) context.Context

WithDeviceID attaches `device_id` to context.

func WithLogger

func WithLogger(ctx context.Context, logger logger.Logger) context.Context

WithLogger attaches logger to context.

func WithRequestID

func WithRequestID(ctx context.Context, rid string) context.Context

WithRequestID adds request id to ctx

Types

type DeviceIDKey

type DeviceIDKey struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL