Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GenericState ¶
type GenericState struct {
// LastUsed holds information about the last used kubeswitcher command
LastUsed *LastUsed `json:"lastUsed,omitempty"`
}
type LastUsed ¶
type LastUsed struct {
// Command is the last used command
Command string `json:"command,omitempty"`
// Plugin is the name of the plugin that handled the last command
Plugin string `json:"plugin,omitempty"`
}
LastUsed holds information about the last used kubeswitcher command
type State ¶
type State struct {
GenericState `json:"genericState"`
// RawPluginState holds the plugin-specific state.
// As this needs to be parsed by the plugin itself, the file is just read and dumped into this field.
RawPluginState []byte `json:"pluginState"`
// contains filtered or unexported fields
}
State holds information about the current state. This is stored in files between command calls and contains information like the last used command.
type TypedState ¶
func LoadTypedState ¶
func LoadTypedState[T any](genericStatePath, pluginStatePath, expectedPluginName string) (*TypedState[T], error)
LoadTypedState loads the state and then attempts to unmarshal the plugin state into the given type. If expectedPluginName is non-empty, the function will throw an StateFromAnotherPluginError if the last used plugin differs from the expected one.
Click to show internal directories.
Click to hide internal directories.