Documentation ¶
Index ¶
- func ApplyContext(ctx context.Context, fns ...SetContextFn) context.Context
- func CleanOutput(s string) string
- func CommandPath(s string, p ...string) string
- func CompareError(err error, expected bool, t *testing.T)
- func NewContext(fns ...SetContextFn) (ctx context.Context)
- func RandomPorts(p []int) (err error)
- func TempDir(t *testing.T) (tmpDir string, remove func())
- type SetContextFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyContext ¶
func ApplyContext(ctx context.Context, fns ...SetContextFn) context.Context
ApplyContext applies given contextFns to context.
func CleanOutput ¶
CleanOutput takes a string and strips extra characters that are not consistent across platforms.
func CommandPath ¶
CommandPath takes a path to a command and returns a corrected path for the operating system this is running on.
func CompareError ¶
CompareError ensures that the provided err is expected
func NewContext ¶
func NewContext(fns ...SetContextFn) (ctx context.Context)
NewContext instantiates new todo context and applies given contextFns to it.
func RandomPorts ¶
RandomPorts generates len(p) random ports and assigns them to elements of p.
Types ¶
type SetContextFn ¶
SetContextFn take context and return new context
func ContextWithNamespace ¶
func ContextWithNamespace(namespace string) SetContextFn
ContextWithNamespace returns new contextFn with namespace added.
func ContextWithStore ¶
func ContextWithStore(store store.Store) SetContextFn
ContextWithStore returns new contextFn with given store value applied to context.