Documentation ¶
Overview ¶
Package fact exposes contextual information about the environment and the requests being made to a server. It works with the context package to store and retrieve information.
This package follows the general pattern in use for golang.org/x/net/context. For each fact named X, there are two methods provided: (1) a getter with the signature X(context) (X, bool), and (2) a setter with the signature SetX(context, X) context.
Index ¶
- Variables
- func Convey(ctx context.Context) (device.Convey, bool)
- func DeviceId(ctx context.Context) (device.ID, bool)
- func Logger(ctx context.Context) (logging.Logger, bool)
- func MustConvey(ctx context.Context) device.Convey
- func MustDeviceId(ctx context.Context) device.ID
- func MustLogger(ctx context.Context) logging.Logger
- func MustToken(ctx context.Context) *secure.Token
- func SetConvey(ctx context.Context, value device.Convey) context.Context
- func SetDeviceId(ctx context.Context, value device.ID) context.Context
- func SetLogger(ctx context.Context, value logging.Logger) context.Context
- func SetToken(ctx context.Context, value *secure.Token) context.Context
- func Token(ctx context.Context) (*secure.Token, bool)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MustConvey ¶
MustConvey retrieves the convey payload from the context, panicking if no such payload is found.
func MustDeviceId ¶
MustDeviceId retrieves the device.ID from the context, panicking if no such device id is found.
func MustLogger ¶
MustLogger retrieves the logging.Logger from the context, panicking if no such logger is found.
func MustToken ¶
MustToken retrieves the secure token from the context, panicking if no such token is found.
func SetDeviceId ¶
SetDeviceId sets the device.ID of the device in the enclosing context
Types ¶
This section is empty.