state

package
v0.2.96 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package state implements setters and getters for command contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDirectory

func ConfigDirectory(ctx context.Context) string

ConfigDirectory returns the config directory ctx carries. It panics in case ctx carries no config directory.

func ConfigFile

func ConfigFile(ctx context.Context) string

ConfigFile returns the config file ctx carries. It panics in case ctx carries no config directory.

func Hostname

func Hostname(ctx context.Context) string

Hostname returns the hostname ctx carries. It panics in case ctx carries no hostname.

func WithConfigDirectory

func WithConfigDirectory(ctx context.Context, cd string) context.Context

WithConfigDir derives a Context that carries the given config directory from ctx.

func WithHostname

func WithHostname(ctx context.Context, hostname string) context.Context

WithHostname returns a copy of ctx that carries hostname.

func WithWorkingDirectory

func WithWorkingDirectory(ctx context.Context, wd string) context.Context

WithWorkingDirectory derives a Context that carries the given working directory from ctx.

func WorkingDirectory

func WorkingDirectory(ctx context.Context) string

WorkingDirectory returns the working directory ctx carries. It panics in case ctx carries no working directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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