config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFileName is the name of config file
	ConfigFileName = "config.json"
	// ConfigFileDir is the default folder where the config file is stored
	ConfigFileDir = ".docker"
	// ConfigFlagName is the name of the config flag
	ConfigFlagName = "config"
)

Variables

This section is empty.

Functions

func Dir

func Dir(ctx context.Context) string

Dir returns the config directory path

func WithDir

func WithDir(ctx context.Context, path string) context.Context

WithDir sets the config directory path in the context

func WriteCurrentContext

func WriteCurrentContext(dir string, name string) error

WriteCurrentContext writes the selected current context to the Docker configuration file. Note, the validity of the context is not checked.

Types

type File

type File struct {
	CurrentContext string `json:"currentContext,omitempty"`
}

File contains the current context from the docker configuration file

func LoadFile

func LoadFile(dir string) (*File, error)

LoadFile loads the docker configuration

Jump to

Keyboard shortcuts

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