Documentation ¶
Index ¶
- Constants
- type Config
- type MockConfig
- func (m *MockConfig) APIUrl() string
- func (m *MockConfig) Format() string
- func (m *MockConfig) Namespace() string
- func (m *MockConfig) SaveAPIUrl(url string) error
- func (m *MockConfig) SaveFormat(format string) error
- func (m *MockConfig) SaveNamespace(namespace string) error
- func (m *MockConfig) SaveTokens(tokens *corev2.Tokens) error
- func (m *MockConfig) Tokens() *corev2.Tokens
- type Read
- type Write
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 MockConfig ¶
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) 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
Click to show internal directories.
Click to hide internal directories.