envflags

package
v0.0.0-...-4235cde Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package envflags provides api command helpers and validators to write compatibility tests for env apis

Index

Constants

View Source
const (
	CompatibilityTestsEnvZero string = "compatibility-tests-env0"
	CompatibilityTestsEnvOne  string = "compatibility-tests-env1"
	CompatibilityTestsEnvVal  string = "compatibility-tests-env-val"
)

Variables

This section is empty.

Functions

func DefaultDeleteEnvCommand

func DefaultDeleteEnvCommand(version core.RuntimeVersion, opts ...CfgEnvOptionArgs) *core.Command

DefaultDeleteEnvCommand creates a DeleteEnv Command with default input and output options

func DefaultGetEnvCommand

func DefaultGetEnvCommand(version core.RuntimeVersion, opts ...CfgEnvOptionArgs) *core.Command

DefaultGetEnvCommand creates a GetEnv Command with default input and output options

func DefaultGetEnvConfigurationsCommand

func DefaultGetEnvConfigurationsCommand(version core.RuntimeVersion, opts ...CfgEnvOptionArgs) *core.Command

DefaultGetEnvConfigurationsCommand creates a GetEnvConfigurations Command with default input and output options

func DefaultSetEnvCommand

func DefaultSetEnvCommand(version core.RuntimeVersion, opts ...CfgEnvOptionArgs) *core.Command

DefaultSetEnvCommand creates a SetEnv Command with default input and output options

func NewDeleteEnvCommand

func NewDeleteEnvCommand(inputOpts *DeleteEnvInputOptions, outputOpts *DeleteEnvOutputOptions) (*core.Command, error)

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

func NewGetEnvCommand

func NewGetEnvCommand(inputOpts *GetEnvInputOptions, outputOpts *GetEnvOutputOptions) (*core.Command, error)

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

func NewGetEnvConfigurationsCommand

func NewGetEnvConfigurationsCommand(inputOpts *GetEnvConfigurationsInputOptions, outputOpts *GetEnvConfigurationsOutputOptions) (*core.Command, error)

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

func NewSetEnvCommand

func NewSetEnvCommand(inputOpts *SetEnvInputOptions, outputOpts *SetEnvOutputOptions) (*core.Command, error)

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

Types

type CfgEnvArgs

type CfgEnvArgs struct {
	*core.RuntimeAPIVersion
	Key                string
	Value              string
	Envs               map[string]string
	ValidationStrategy core.ValidationStrategy
	Error              string
}

CfgEnvArgs arguments struct that are used to create Env API commands

type CfgEnvOptionArgs

type CfgEnvOptionArgs func(*CfgEnvArgs)

func WithEnvs

func WithEnvs(v map[string]string) CfgEnvOptionArgs

func WithError

func WithError(e string) CfgEnvOptionArgs

func WithKey

func WithKey(k string) CfgEnvOptionArgs

func WithRuntimeAPIVersion

func WithRuntimeAPIVersion(v *core.RuntimeAPIVersion) CfgEnvOptionArgs

func WithStrictValidationStrategy

func WithStrictValidationStrategy() CfgEnvOptionArgs

func WithValidationStrategy

func WithValidationStrategy(vs core.ValidationStrategy) CfgEnvOptionArgs

func WithValue

func WithValue(v string) CfgEnvOptionArgs

type DeleteEnvInputOptions

type DeleteEnvInputOptions struct {
	*core.RuntimeAPIVersion        // required
	Key                     string // required

}

DeleteEnvInputOptions used to generate DeleteEnv command

func (*DeleteEnvInputOptions) Validate

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

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

type DeleteEnvOutputOptions

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

DeleteEnvOutputOptions used to generate DeleteEnv command

type GetEnvConfigurationsInputOptions

type GetEnvConfigurationsInputOptions struct {
	*core.RuntimeAPIVersion // required
}

GetEnvConfigurationsInputOptions used to generate GetEnvConfigurations command

type GetEnvConfigurationsOutputOptions

type GetEnvConfigurationsOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	Envs                    map[string]string       // For specific version options look into EnvOpts 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
}

GetEnvConfigurationsOutputOptions used to generate GetEnvConfigurations command

func (*GetEnvConfigurationsOutputOptions) Validate

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

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

type GetEnvInputOptions

type GetEnvInputOptions struct {
	*core.RuntimeAPIVersion        // required
	Key                     string // required
}

GetEnvInputOptions used to generate GetEnv command

func (*GetEnvInputOptions) Validate

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

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

type GetEnvOutputOptions

type GetEnvOutputOptions struct {
	*core.RuntimeAPIVersion                         // required
	Value                   string                  // For specific version options look into EnvOpts 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
}

GetEnvOutputOptions used to generate GetEnv command

type SetEnvInputOptions

type SetEnvInputOptions struct {
	*core.RuntimeAPIVersion        // required
	Key                     string // required
	Value                   string // required
}

SetEnvInputOptions used to generate SetEnv command

func (*SetEnvInputOptions) Validate

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

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

type SetEnvOutputOptions

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

SetEnvOutputOptions used to generate SetEnv command

Jump to

Keyboard shortcuts

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