config

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateDir

func CertificateDir() string

func ClientConfigFile

func ClientConfigFile() string

func ConfigDir

func ConfigDir() string

func ConfigFile

func ConfigFile() string

func Save

func Save(cfg *Config, cfgFile string) error

func Validate

func Validate(cfg *Config) error

Types

type Config

type Config struct {
	Database     *dbConfig           `json:"database,omitempty"`
	Service      *svcConfig          `json:"service,omitempty"`
	KV           *kvConfig           `json:"kv,omitempty"`
	Alertmanager *alertmanagerConfig `json:"alertmanager,omitempty"`
	Auth         *authConfig         `json:"auth,omitempty"`
	Prometheus   *prometheusConfig   `json:"prometheus,omitempty"`
	CA           *ca.Config          `json:"ca,omitempty"`
	Tracing      *tracingConfig      `json:"tracing,omitempty"`
	GitOps       *gitOpsConfig       `json:"gitOps,omitempty"`
}

func Load

func Load(cfgFile string) (*Config, error)

func LoadOrGenerate

func LoadOrGenerate(cfgFile string) (*Config, error)

func NewDefault

func NewDefault(opts ...ConfigOption) *Config

func NewFromFile

func NewFromFile(cfgFile string) (*Config, error)

func (*Config) String

func (cfg *Config) String() string

type ConfigOption added in v0.8.1

type ConfigOption func(*Config)

func WithTracingEnabled added in v0.8.1

func WithTracingEnabled() ConfigOption

type EnrollmentService added in v0.6.0

type EnrollmentService struct {
	client.Config

	// EnrollmentUIEndpoint is the address of the device enrollment UI
	EnrollmentUIEndpoint string `json:"enrollment-ui-endpoint,omitempty"`
}

func (*EnrollmentService) Equal added in v0.6.0

type ManagementService added in v0.6.0

type ManagementService struct {
	client.Config
}

func (*ManagementService) Equal added in v0.6.0

type RateLimitConfig added in v0.9.0

type RateLimitConfig struct {
	Requests     int           `json:"requests,omitempty"`     // max requests per window
	Window       util.Duration `json:"window,omitempty"`       // e.g. "1m" for one minute
	AuthRequests int           `json:"authRequests,omitempty"` // max auth requests per window
	AuthWindow   util.Duration `json:"authWindow,omitempty"`   // e.g. "1h" for one hour
	// TrustedProxies specifies IP addresses/networks that are allowed to set proxy headers
	// If empty, proxy headers are ignored for security (only direct connection IPs are used)
	TrustedProxies []string `json:"trustedProxies,omitempty"`
}

type SecureString added in v0.9.2

type SecureString string

func (SecureString) GoString added in v0.9.2

func (s SecureString) GoString() string

GoString implements fmt.GoStringer interface (used by %#v)

func (SecureString) MarshalJSON added in v0.9.2

func (s SecureString) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface

func (SecureString) String added in v0.9.2

func (s SecureString) String() string

String implements fmt.Stringer interface, used by fmt.Println, fmt.Printf, etc.

func (SecureString) Value added in v0.9.2

func (s SecureString) Value() string

type ServiceConfig added in v0.6.0

type ServiceConfig struct {
	// EnrollmentService is the client configuration for connecting to the device enrollment server
	EnrollmentService EnrollmentService `json:"enrollment-service,omitempty"`
	// ManagementService is the client configuration for connecting to the device management server
	ManagementService ManagementService `json:"management-service,omitempty"`
}

func NewServiceConfig added in v0.6.0

func NewServiceConfig() ServiceConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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