config

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 1 more Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace represents the default namespace
	DefaultNamespace = "default"

	// DefaultFormat is the default format output for printers.
	DefaultFormat = FormatTabular

	// FormatTabular indicates tabular format for printers.
	FormatTabular = "tabular"

	// FormatJSON indicates JSON format for printers.
	FormatJSON = "json"

	// FormatWrappedJSON indicates wrapped JSON format for printers.
	FormatWrappedJSON = "wrapped-json"

	// FormatYAML indicates YAML format for printers. It has the same layout
	// as wrapped JSON.
	FormatYAML = "yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Read
	Write
}

Config is an abstract configuration

type MockConfig

type MockConfig struct {
	mock.Mock
}

MockConfig is a configuration used for CLI testing. When using the MockConfig in unit tests, stub out the behavior you wish to test against by assigning the appropriate function to the appropriate Func field. If you have forgotten to stub a particular function, the program will panic.

func (*MockConfig) APIUrl

func (m *MockConfig) APIUrl() string

APIUrl mocks the API URL config

func (*MockConfig) Format

func (m *MockConfig) Format() string

Format mocks the format config

func (*MockConfig) Namespace

func (m *MockConfig) Namespace() string

Namespace mocks the namespace config

func (*MockConfig) SaveAPIUrl

func (m *MockConfig) SaveAPIUrl(url string) error

SaveAPIUrl mocks saving the API URL

func (*MockConfig) SaveFormat

func (m *MockConfig) SaveFormat(format string) error

SaveFormat mocks saving the format

func (*MockConfig) SaveNamespace

func (m *MockConfig) SaveNamespace(namespace string) error

SaveNamespace mocks saving the namespace

func (*MockConfig) SaveTokens

func (m *MockConfig) SaveTokens(tokens *corev2.Tokens) error

SaveTokens mocks saving the tokens

func (*MockConfig) Tokens

func (m *MockConfig) Tokens() *corev2.Tokens

Tokens mocks the tokens config

type Read

type Read interface {
	APIUrl() string
	Format() string
	Namespace() string
	Tokens() *types.Tokens
}

Read contains all methods related to reading configuration

type Write

type Write interface {
	SaveAPIUrl(string) error
	SaveFormat(string) error
	SaveNamespace(string) error
	SaveTokens(*types.Tokens) error
}

Write contains all methods related to setting and writting configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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