context

package
v0.0.0-...-efeb279 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package context provides all types, validator, helpers methods to create Runtime Context API commands

Package context contains all the cross version api compatibility tests for context apis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteContextCommand

func DeleteContextCommand(opts ...CfgContextArgsOption) *core.Command

func GetActiveContextCommand

func GetActiveContextCommand(opts ...CfgContextArgsOption) *core.Command

func GetContextCommand

func GetContextCommand(opts ...CfgContextArgsOption) *core.Command

func GetCurrentContextCommand

func GetCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command

func NewDeleteContextCommand

func NewDeleteContextCommand(inputOpts *DeleteContextInputOptions, outputOpts *DeleteContextOutputOptions) (*core.Command, error)

NewDeleteContextCommand constructs a command to make a call to specific runtime version DeleteContext API Input Parameter inputOpts has all input parameters which are required for Runtime DeleteContext API Input Parameter: outputOpts has details about expected output from Runtime DeleteContext API call Return: command to execute or error if any validations fails for DeleteContextInputOptions or DeleteContextOutputOptions This method does validate the input parameters DeleteContextInputOptions or DeleteContextOutputOptions based on Runtime API Version For more details about supported parameters refer to DeleteContextInputOptions or DeleteContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewGetActiveContextCommand

func NewGetActiveContextCommand(inputOpts *GetActiveContextInputOptions, outputOpts *GetActiveContextOutputOptions) (*core.Command, error)

NewGetActiveContextCommand constructs a command to make a call to specific runtime version GetActiveContext API Input Parameter inputOpts has all input parameters which are required for Runtime GetActiveContext API Input Parameter: outputOpts has details about expected output from Runtime GetActiveContext API call Return: command to execute or error if any validations fails for GetActiveContextInputOptions or GetActiveContextOutputOptions This method does validate the input parameters GetActiveContextInputOptions or GetActiveContextOutputOptions based on Runtime API Version For more details about supported parameters refer to GetActiveContextInputOptions or GetActiveContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewGetContextCommand

func NewGetContextCommand(inputOpts *GetContextInputOptions, outputOpts *GetContextOutputOptions) (*core.Command, error)

NewGetContextCommand constructs a command to make a call to specific runtime version GetContext API Input Parameter inputOpts has all input parameters which are required for Runtime GetContext API Input Parameter: outputOpts has details about expected output from Runtime GetContext API call Return: command to execute or error if any validations fails for GetContextInputOptions or GetContextOutputOptions This method does validate the input parameters GetContextInputOptions or GetContextOutputOptions based on Runtime API Version For more details about supported parameters refer to GetContextInputOptions or GetContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewGetCurrentContextCommand

func NewGetCurrentContextCommand(inputOpts *GetCurrentContextInputOptions, outputOpts *GetCurrentContextOutputOptions) (*core.Command, error)

NewGetCurrentContextCommand constructs a command to make a call to specific runtime version GetCurrentContext API Input Parameter inputOpts has all input parameters which are required for Runtime GetCurrentContext API Input Parameter: outputOpts has details about expected output from Runtime GetCurrentContext API call Return: command to execute or error if any validations fails for GetCurrentContextInputOptions or GetCurrentContextOutputOptions This method does validate the input parameters GetCurrentContextInputOptions or GetCurrentContextOutputOptions based on Runtime API Version For more details about supported parameters refer to GetCurrentContextInputOptions or GetCurrentContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewRemoveCurrentContextCommand

func NewRemoveCurrentContextCommand(removeCurrentContextInputOptions *RemoveCurrentContextInputOptions, removeCurrentContextOutputOptions *RemoveCurrentContextOutputOptions) (*core.Command, error)

NewRemoveCurrentContextCommand constructs a command to make a call to specific runtime version RemoveCurrentContext API Input Parameter inputOpts has all input parameters which are required for Runtime RemoveCurrentContext API Input Parameter: outputOpts has details about expected output from Runtime RemoveCurrentContext API call Return: command to execute or error if any validations fails for RemoveCurrentContextInputOptions or RemoveCurrentContextOutputOptions This method does validate the input parameters RemoveCurrentContextInputOptions/ RemoveCurrentContextOutputOptions based on Runtime API Version For more details about supported parameters refer to RemoveCurrentContextInputOptions/ RemoveCurrentContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewSetContextCommand

func NewSetContextCommand(inputOpts *SetContextInputOptions, outputOpts *SetContextOutputOptions) (*core.Command, error)

NewSetContextCommand constructs a command to make a call to specific runtime version SetContext API Input Parameter inputOpts has all input parameters which are required for Runtime SetContext API Input Parameter: outputOpts has details about expected output from Runtime SetContext API call Return: command to execute or error if any validations fails for SetContextInputOptions or SetContextOutputOptions This method does validate the input parameters SetContextInputOptions or SetContextOutputOptions based on Runtime API Version For more details about supported parameters refer to SetContextInputOptions or SetContextOutputOptions definition(and ContextOpts struct, which is embedded)

func NewSetCurrentContextCommand

func NewSetCurrentContextCommand(inputOpts *SetCurrentContextInputOptions, outputOpts *SetCurrentContextOutputOptions) (*core.Command, error)

NewSetCurrentContextCommand constructs a command to make a call to specific runtime version SetCurrentContext API Input Parameter inputOpts has all input parameters which are required for Runtime SetCurrentContext API Input Parameter: outputOpts has details about expected output from Runtime SetCurrentContext API call Return: command to execute or error if any validations fails for SetCurrentContextInputOptions or SetCurrentContextOutputOptions This method does validate the input parameters SetCurrentContextInputOptions or SetCurrentContextOutputOptions based on Runtime API Version For more details about supported parameters refer to SetCurrentContextInputOptions or SetCurrentContextOutputOptions definition(and ContextOpts struct, which is embedded)

func RemoveCurrentContextCommand

func RemoveCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command

func SetContextCommand

func SetContextCommand(opts ...CfgContextArgsOption) *core.Command

func SetCurrentContextCommand

func SetCurrentContextCommand(opts ...CfgContextArgsOption) *core.Command

Types

type CfgContextArgs

type CfgContextArgs struct {
	RuntimeAPIVersion  *core.RuntimeAPIVersion
	ContextName        string
	Target             types.Target
	Type               types.ContextType
	ContextType        types.ContextType
	SetCurrentContext  bool
	GlobalOpts         *types.GlobalServerOpts
	ClusterOpts        *types.ClusterServerOpts
	DiscoverySources   []types.PluginDiscoveryOpts
	ValidationStrategy core.ValidationStrategy
	Error              bool
}

CfgContextArgs used to construct input and output options

type CfgContextArgsOption

type CfgContextArgsOption func(*CfgContextArgs)

func WithContextName

func WithContextName(name string) CfgContextArgsOption

func WithContextType

func WithContextType(contextType types.ContextType) CfgContextArgsOption

func WithError

func WithError() CfgContextArgsOption

func WithLegacyContextType

func WithLegacyContextType(contextType types.ContextType) CfgContextArgsOption

func WithRuntimeVersion

func WithRuntimeVersion(version core.RuntimeVersion) CfgContextArgsOption

func WithSetCurrentContext

func WithSetCurrentContext() CfgContextArgsOption

func WithTarget

func WithTarget(target types.Target) CfgContextArgsOption

type DeleteContextInputOptions

type DeleteContextInputOptions struct {
	*core.RuntimeAPIVersion        // required
	ContextName             string // required
}

DeleteContextInputOptions used to generate DeleteContext command

func (*DeleteContextInputOptions) Validate

func (opts *DeleteContextInputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type DeleteContextOutputOptions

type DeleteContextOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	ValidationStrategy      core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error                   string                  // expected error message could be the sub string of actual error message
}

DeleteContextOutputOptions used to generate DeleteContext command

type GetActiveContextInputOptions

type GetActiveContextInputOptions struct {
	*core.RuntimeAPIVersion                   // required
	ContextType             types.ContextType // required for v1.1.0
}

GetActiveContextInputOptions used to generate GetActiveContext command

func (*GetActiveContextInputOptions) ShouldIncludeContextType

func (opts *GetActiveContextInputOptions) ShouldIncludeContextType() bool

func (*GetActiveContextInputOptions) Validate

func (opts *GetActiveContextInputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type GetActiveContextOutputOptions

type GetActiveContextOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	*types.ContextOpts                              // For specific version options look into ContextOpts definition
	ValidationStrategy      core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error                   string                  // expected error message could be the sub string of actual error message
}

GetActiveContextOutputOptions used to generate GetActiveContext command

type GetContextInputOptions

type GetContextInputOptions struct {
	*core.RuntimeAPIVersion        // required
	ContextName             string // required
}

GetContextInputOptions used to generate GetContext command

func (*GetContextInputOptions) Validate

func (opts *GetContextInputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type GetContextOutputOptions

type GetContextOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	*types.ContextOpts                              // For specific version options look into ContextOpts definition
	ValidationStrategy      core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error                   string                  // expected error message could be the sub string of actual error message
}

GetContextOutputOptions used to generate GetContext command

func (*GetContextOutputOptions) Validate

func (opts *GetContextOutputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type GetCurrentContextInputOptions

type GetCurrentContextInputOptions struct {
	*core.RuntimeAPIVersion                   // required
	Target                  types.Target      // required for v1.0.0 - v0.28.0
	ContextType             types.ContextType // required for v0.25.4
}

GetCurrentContextInputOptions used to generate GetCurrentContext command

func (*GetCurrentContextInputOptions) ShouldNotIncludeContextType

func (opts *GetCurrentContextInputOptions) ShouldNotIncludeContextType() bool

func (*GetCurrentContextInputOptions) ShouldNotIncludeTarget

func (opts *GetCurrentContextInputOptions) ShouldNotIncludeTarget() bool

func (*GetCurrentContextInputOptions) Validate

func (opts *GetCurrentContextInputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type GetCurrentContextOutputOptions

type GetCurrentContextOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	*types.ContextOpts                              // For specific version options look into ContextOpts definition
	ValidationStrategy      core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error                   string                  // expected error message could be the sub string of actual error message
}

GetCurrentContextOutputOptions used to generate GetCurrentContext command

func (*GetCurrentContextOutputOptions) Validate

func (opts *GetCurrentContextOutputOptions) Validate() (bool, error)

Validate the getContextOutputOptions as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type RemoveCurrentContextInputOptions

type RemoveCurrentContextInputOptions struct {
	*core.RuntimeAPIVersion              // required
	Target                  types.Target // required for v1.0.0 - v0.28.0
}

RemoveCurrentContextInputOptions used to generate RemoveCurrentContext command

func (*RemoveCurrentContextInputOptions) ShouldNotIncludeTarget

func (opts *RemoveCurrentContextInputOptions) ShouldNotIncludeTarget() bool

type RemoveCurrentContextOutputOptions

type RemoveCurrentContextOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	ValidationStrategy      core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error                   string                  // expected error message could be the sub string of actual error message
}

RemoveCurrentContextOutputOptions used to generate RemoveCurrentContext command

type SetContextInputOptions

type SetContextInputOptions struct {
	*core.RuntimeAPIVersion      // required
	*types.ContextOpts           // required
	SetCurrentContext       bool // required
}

SetContextInputOptions used to generate SetContext command

func (*SetContextInputOptions) Validate

func (opts *SetContextInputOptions) Validate() (bool, error)

Validate the setContextInputOptions as per runtime version i.e. check whether mandatory fields are set and throw error if missing

type SetContextOutputOptions

type SetContextOutputOptions struct {
	ValidationStrategy core.ValidationStrategy // Type of validation to be performed i.e. exact or partial. default is partial
	Error              string                  // expected error message could be the sub string of actual error message
}

SetContextOutputOptions used to generate SetContext command

type SetCurrentContextInputOptions

type SetCurrentContextInputOptions struct {
	*core.RuntimeAPIVersion        // required
	ContextName             string // required
}

SetCurrentContextInputOptions used to generate SetCurrentContext command

func (*SetCurrentContextInputOptions) Validate

func (opts *SetCurrentContextInputOptions) Validate() (bool, error)

Validate the opts as per runtime version i.e. check whether the expected fields are supported for the runtime version specified

type SetCurrentContextOutputOptions

type SetCurrentContextOutputOptions struct {
	*core.RuntimeAPIVersion        // required
	Error                   string // expected error message could be the sub string of actual error message
}

SetCurrentContextOutputOptions used to generate SetCurrentContext command

Jump to

Keyboard shortcuts

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