types

package
v0.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TrueMode always activates the feature.
	TrueMode = TrueFalseAutoMode{Mode: trueModeStr, Resolved: func() *bool { b := true; return &b }()}
	// FalseMode always deactivates the feature.
	FalseMode = TrueFalseAutoMode{Mode: falseModeStr, Resolved: func() *bool { b := false; return &b }()}
	// AutoMode decides automatically based on context.
	AutoMode = TrueFalseAutoMode{Mode: autoModeStr}
)

Functions

This section is empty.

Types

type Duration

type Duration struct {
	time.Duration `validate:"required"`
}

Duration is a wrapper type that parses time duration from text.

func NewDuration

func NewDuration(duration time.Duration) Duration

NewDuration returns Duration wrapper

func (Duration) JSONSchema

func (Duration) JSONSchema() *jsonschema.Schema

JSONSchema returns a custom schema to be used for the JSON Schema generation of this type

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText unmarshalls time duration from text.

type KeystoreFileConfig

type KeystoreFileConfig struct {
	// Path is the file path for the key store file
	Path string `mapstructure:"Path"`

	// Password is the password to decrypt the key store file
	Password string `mapstructure:"Password"`
}

KeystoreFileConfig has all the information needed to load a private key from a key store file

type TrueFalseAutoMode

type TrueFalseAutoMode struct {
	Mode     string `mapstructure:"-"`
	Resolved *bool  `mapstructure:"-"`
}

TrueFalseAutoMode represents a tri-state config value: true, false, or auto. Mode is set from the config file via UnmarshalText; Resolved is set programmatically.

func (*TrueFalseAutoMode) Resolve

func (m *TrueFalseAutoMode) Resolve(autoModeResult bool) bool

Resolve converts the mode to a boolean using autoModeResult for AutoMode, stores the result in Resolved, and returns it.

func (TrueFalseAutoMode) String

func (m TrueFalseAutoMode) String() string

String returns the mode string ("true", "false", "auto", or "").

func (*TrueFalseAutoMode) UnmarshalText

func (m *TrueFalseAutoMode) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (TrueFalseAutoMode) Validate

func (m TrueFalseAutoMode) Validate(fieldName string) error

Validate checks that the mode is a valid value. Empty mode is allowed.

Jump to

Keyboard shortcuts

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