Documentation ¶
Overview ¶
Package featureflags provides api command helpers and validators to write compatibility tests for feature apis
Index ¶
- Constants
- func DefaultDeleteFeatureCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
- func DefaultIsFeatureEnabledCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
- func DefaultSetFeatureCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
- func NewDeleteFeatureCommand(inputOpts *DeleteFeatureInputOptions, outputOpts *DeleteFeatureOutputOptions) (*core.Command, error)
- func NewIsFeatureEnabledCommand(inputOpts *IsFeatureEnabledInputOptions, ...) (*core.Command, error)
- func NewSetFeatureCommand(inputOpts *SetFeatureInputOptions, outputOpts *SetFeatureOutputOptions) (*core.Command, error)
- type CfgFeatureArgs
- type CfgFeatureOptionArgs
- func WithError(e string) CfgFeatureOptionArgs
- func WithFeatureEnabled(e bool) CfgFeatureOptionArgs
- func WithKey(k string) CfgFeatureOptionArgs
- func WithPlugin(p string) CfgFeatureOptionArgs
- func WithRuntimeAPIVersion(v *core.RuntimeAPIVersion) CfgFeatureOptionArgs
- func WithStrictValidationStrategy() CfgFeatureOptionArgs
- func WithValidationStrategy(vs core.ValidationStrategy) CfgFeatureOptionArgs
- func WithValue(v string) CfgFeatureOptionArgs
- type DeleteFeatureInputOptions
- type DeleteFeatureOutputOptions
- type IsFeatureEnabledInputOptions
- type IsFeatureEnabledOutputOptions
- type SetFeatureInputOptions
- type SetFeatureOutputOptions
Constants ¶
const ( CompatibilityTestsPlugin string = "compatibility-tests-plugin" CompatibilityTestsPluginKey string = "compatibility-tests-plugin-key" CompatibilityTestsPluginKey0 string = "compatibility-tests-plugin-key0" CompatibilityTestsPluginKey1 string = "compatibility-tests-plugin-key1" )
Variables ¶
This section is empty.
Functions ¶
func DefaultDeleteFeatureCommand ¶
func DefaultDeleteFeatureCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
DefaultDeleteFeatureCommand creates a DeleteFeature Command with default input and output options
func DefaultIsFeatureEnabledCommand ¶
func DefaultIsFeatureEnabledCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
DefaultIsFeatureEnabledCommand creates a IsFeatureEnabled Command with default input and output options
func DefaultSetFeatureCommand ¶
func DefaultSetFeatureCommand(version core.RuntimeVersion, opts ...CfgFeatureOptionArgs) *core.Command
DefaultSetFeatureCommand creates a SetFeature Command with default input and output options
func NewDeleteFeatureCommand ¶
func NewDeleteFeatureCommand(inputOpts *DeleteFeatureInputOptions, outputOpts *DeleteFeatureOutputOptions) (*core.Command, error)
NewDeleteFeatureCommand constructs a command to make a call to specific runtime version DeleteFeature API Input Parameter inputOpts has all input parameters which are required for Runtime DeleteFeature API Input Parameter: outputOpts has details about expected output from Runtime DeleteFeature API call Return: command to execute or error if any validations fails for DeleteFeatureInputOptions or DeleteFeatureOutputOptions This method does validate the input parameters DeleteFeatureInputOptions or DeleteFeatureOutputOptions based on Runtime API Version For more details about supported parameters refer to DeleteFeatureInputOptions or DeleteFeatureOutputOptions definition(and FeatureOpts struct, which is embedded)
func NewIsFeatureEnabledCommand ¶
func NewIsFeatureEnabledCommand(inputOpts *IsFeatureEnabledInputOptions, outputOpts *IsFeatureEnabledOutputOptions) (*core.Command, error)
NewIsFeatureEnabledCommand constructs a command to make a call to specific runtime version IsFeatureEnabled API Input Parameter inputOpts has all input parameters which are required for Runtime IsFeatureEnabled API Input Parameter: outputOpts has details about expected output from Runtime IsFeatureEnabled API call Return: command to execute or error if any validations fails for IsFeatureEnabledInputOptions or IsFeatureEnabledOutputOptions This method does validate the input parameters IsFeatureEnabledInputOptions or IsFeatureEnabledOutputOptions based on Runtime API Version For more details about supported parameters refer to IsFeatureEnabledInputOptions or IsFeatureEnabledOutputOptions definition(and FeatureOpts struct, which is embedded)
func NewSetFeatureCommand ¶
func NewSetFeatureCommand(inputOpts *SetFeatureInputOptions, outputOpts *SetFeatureOutputOptions) (*core.Command, error)
NewSetFeatureCommand constructs a command to make a call to specific runtime version SetFeature API Input Parameter inputOpts has all input parameters which are required for Runtime SetFeature API Input Parameter: outputOpts has details about expected output from Runtime SetFeature API call Return: command to execute or error if any validations fails for SetFeatureInputOptions or SetFeatureOutputOptions This method does validate the input parameters SetFeatureInputOptions or SetFeatureOutputOptions based on Runtime API Version For more details about supported parameters refer to SetFeatureInputOptions or SetFeatureOutputOptions definition(and FeatureOpts struct, which is embedded)
Types ¶
type CfgFeatureArgs ¶
type CfgFeatureArgs struct { *core.RuntimeAPIVersion Plugin string Key string Value string FeatureEnabled bool ValidationStrategy core.ValidationStrategy Error string }
type CfgFeatureOptionArgs ¶
type CfgFeatureOptionArgs func(*CfgFeatureArgs)
func WithError ¶
func WithError(e string) CfgFeatureOptionArgs
func WithFeatureEnabled ¶
func WithFeatureEnabled(e bool) CfgFeatureOptionArgs
func WithKey ¶
func WithKey(k string) CfgFeatureOptionArgs
func WithPlugin ¶
func WithPlugin(p string) CfgFeatureOptionArgs
func WithRuntimeAPIVersion ¶
func WithRuntimeAPIVersion(v *core.RuntimeAPIVersion) CfgFeatureOptionArgs
func WithStrictValidationStrategy ¶
func WithStrictValidationStrategy() CfgFeatureOptionArgs
func WithValidationStrategy ¶
func WithValidationStrategy(vs core.ValidationStrategy) CfgFeatureOptionArgs
func WithValue ¶
func WithValue(v string) CfgFeatureOptionArgs
type DeleteFeatureInputOptions ¶
type DeleteFeatureInputOptions struct { *core.RuntimeAPIVersion // required Plugin string // required Key string // required }
DeleteFeatureInputOptions used to generate DeleteFeature command
func (*DeleteFeatureInputOptions) Validate ¶
func (opts *DeleteFeatureInputOptions) 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 DeleteFeatureOutputOptions ¶
type DeleteFeatureOutputOptions struct { *core.RuntimeAPIVersion // required Error string // expected error message could be the sub string of actual error message }
DeleteFeatureOutputOptions used to generate DeleteFeature command
type IsFeatureEnabledInputOptions ¶
type IsFeatureEnabledInputOptions struct { *core.RuntimeAPIVersion // required Plugin string // required Key string // required }
IsFeatureEnabledInputOptions used to generate GetFeature command
func (*IsFeatureEnabledInputOptions) Validate ¶
func (opts *IsFeatureEnabledInputOptions) 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 IsFeatureEnabledOutputOptions ¶
type IsFeatureEnabledOutputOptions struct { *core.RuntimeAPIVersion // required FeatureEnabled bool // For specific version options look into FeatureOpts 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 }
IsFeatureEnabledOutputOptions used to generate GetFeature command
type SetFeatureInputOptions ¶
type SetFeatureInputOptions struct { *core.RuntimeAPIVersion // required Plugin string // required Key string // required Value string // required }
SetFeatureInputOptions used to generate SetFeature command
func (*SetFeatureInputOptions) Validate ¶
func (opts *SetFeatureInputOptions) Validate() (bool, error)
Validate the setFeatureInputOptions as per runtime version i.e. check whether mandatory fields are set and throw error if missing
type SetFeatureOutputOptions ¶
type SetFeatureOutputOptions struct { *core.RuntimeAPIVersion // required Error string // expected error message could be the sub string of actual error message }
SetFeatureOutputOptions used to generate SetFeature command