Documentation ¶
Index ¶
- type Option
- type OptionValueType
- type StartCommandConfig
- func (c *StartCommandConfig) GetLogLevelLogrus() logrus.Level
- func (c *StartCommandConfig) GetStateHash() string
- func (c *StartCommandConfig) SetFromEnv() error
- func (c *StartCommandConfig) SetFromHTTPRequestHeaders(header http.Header, logger *logrus.Logger) error
- func (c *StartCommandConfig) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option[T OptionValueType] struct { Name string Description string IsAddedToCLI bool Value T }
func (*Option[T]) GetEnvName ¶
func (*Option[T]) GetFlagName ¶
func (*Option[T]) GetHeaderName ¶
func (*Option[T]) MarkAsAddedToCLI ¶
func (o *Option[T]) MarkAsAddedToCLI()
MarkAsAddedToCLI developed for avoiding forgetting adding config's fields to the cobra CLI commands
type StartCommandConfig ¶
type StartCommandConfig struct { LogLevel Option[string] `default:"debug" description:"Verbosity level (panic, fatal, error, warn, info, debug, trace)"` LocalPort Option[int] `default:"80" description:"Listening port for the proxy"` RemoteURI Option[string] `default:"https://example.com:443" description:"URI of the remote resource"` ThrottleRateLimit Option[float64] `description:"How many requests can be send to the remote resource per second"` TransformRequestUrlSED Option[string] `description:"SED expression for request URL transformation"` AdditionalRequestHeaders Option[[]string] `description:"Array of additional request headers in format Header: Value"` TransformRequestBodySED Option[[]string] `description:"Pipeline of SED expressions for request body transformation"` TransformRequestBodyJQ Option[[]string] `description:"Pipeline of JQ expressions for request body transformation"` AdditionalResponseHeaders Option[[]string] `description:"Array of additional response headers in format Header: Value"` TransformResponseBodySED Option[[]string] `description:"Pipeline of SED expressions for response body transformation"` TransformResponseBodyJQ Option[[]string] `description:"Pipeline of JQ expressions for response body transformation"` }
func GetStartCommandConfig ¶
func GetStartCommandConfig() *StartCommandConfig
func (*StartCommandConfig) GetLogLevelLogrus ¶
func (c *StartCommandConfig) GetLogLevelLogrus() logrus.Level
func (*StartCommandConfig) GetStateHash ¶
func (c *StartCommandConfig) GetStateHash() string
func (*StartCommandConfig) SetFromEnv ¶
func (c *StartCommandConfig) SetFromEnv() error
func (*StartCommandConfig) SetFromHTTPRequestHeaders ¶
func (c *StartCommandConfig) SetFromHTTPRequestHeaders(header http.Header, logger *logrus.Logger) error
TODO add availableInRuntime mapstructure flag and based on this flag throw the error if the user try to change cfg for this field through the http headers
func (*StartCommandConfig) Validate ¶
func (c *StartCommandConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.