Documentation ¶
Overview ¶
Package context defines a type that carries context specific data such as the logger. Inspired by Google's http://godoc.org/golang.org/x/net/context
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock stands for a mocked context.
func NewMockDefault ¶
func NewMockDefault() *Mock
NewMockDefault returns an instance of Mock with default expectations set.
func NewMockDefaultWithContext ¶
NewMockDefaultWithContext returns an instance of Mock with specified context.
func (*Mock) AppConfig ¶
func (m *Mock) AppConfig() appconfig.SsmagentConfig
AppConfig mocks the Config function.
func (*Mock) CurrentContext ¶
With mocks the With function.
type T ¶
type T interface { Log() log.T AppConfig() appconfig.SsmagentConfig With(context string) T CurrentContext() []string }
T transfers context specific data across different execution boundaries. Instead of adding the context to specific structs, we pass Context as the first parameter to the methods themselves.
Click to show internal directories.
Click to hide internal directories.