Documentation ¶
Overview ¶
Package state implements setters and getters for command contexts.
Index ¶
- func ConfigDirectory(ctx context.Context) string
- func ConfigFile(ctx context.Context) string
- func Hostname(ctx context.Context) string
- func WithConfigDirectory(ctx context.Context, cd string) context.Context
- func WithHostname(ctx context.Context, hostname string) context.Context
- func WithWorkingDirectory(ctx context.Context, wd string) context.Context
- func WorkingDirectory(ctx context.Context) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDirectory ¶
ConfigDirectory returns the config directory ctx carries. It panics in case ctx carries no config directory.
func ConfigFile ¶
ConfigFile returns the config file ctx carries. It panics in case ctx carries no config directory.
func Hostname ¶
Hostname returns the hostname ctx carries. It panics in case ctx carries no hostname.
func WithConfigDirectory ¶
WithConfigDir derives a Context that carries the given config directory from ctx.
func WithHostname ¶
WithHostname returns a copy of ctx that carries hostname.
func WithWorkingDirectory ¶
WithWorkingDirectory derives a Context that carries the given working directory from ctx.
func WorkingDirectory ¶
WorkingDirectory returns the working directory ctx carries. It panics in case ctx carries no working directory.
Types ¶
This section is empty.