service

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigRule

type ConfigRule struct {
	// contains filtered or unexported fields
}

ConfigRule is a service struct to handle config.Rule for cmd applications

func NewConfigRule

func NewConfigRule(currentCmdPath string) *ConfigRule

NewConfigRule returns a new pointer instance of ConfigRule with the given arguments

func (ConfigRule) CurrentRule

func (c ConfigRule) CurrentRule() (config.Rule, error)

CurrentRule returns the current rule with applies to the path the cmd is executed in

type DynamicFlagConfig

type DynamicFlagConfig struct {
	// The type of command for which the dynamic flags should be used for. Must be one of:
	// branch || commit
	CommandType string `validate:"oneof='branch' 'commit'"`
	// contains filtered or unexported fields
}

DynamicFlagConfig is a service struct for handling dynamic flags for Cobra commands based on config.Rule

func NewDynamicFlagConfig

func NewDynamicFlagConfig(commandType string, configRule config.Rule) (*DynamicFlagConfig, error)

NewDynamicFlagConfig returns a new pointer instance of DynamicFlagConfig with the given arguments

func (DynamicFlagConfig) AddFlagsForCmd

func (d DynamicFlagConfig) AddFlagsForCmd(cmd *cobra.Command)

AddFlagsForCmd adds the DynamicFlagConfig.configRule defined flags to the cmd

Jump to

Keyboard shortcuts

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