config

package
v0.0.0-...-0273df7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server          Server
	HTTPHealthCheck []HTTPHealthCheck
	Concurrency     int
	Kubernetes      Kubernetes
	Consul          Consul
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Config

func (*Config) Flags

func (c *Config) Flags() *Flags

func (*Config) ReadConfig

func (c *Config) ReadConfig() error

func (*Config) ReadConfigFromConfigMap

func (c *Config) ReadConfigFromConfigMap() error

ReadConfigFromFile reads the configuration from a Kubernetes ConfigMap.

func (*Config) ReadConfigFromFile

func (c *Config) ReadConfigFromFile()

ReadConfigFromFile reads the configuration from a file.

func (*Config) SetDefault

func (c *Config) SetDefault() error

func (*Config) SetFromEnv

func (c *Config) SetFromEnv() error

type Consul

type Consul struct {
	Enabled            bool
	Address            string
	Scheme             string
	CAFile             string
	CertFile           string
	KeyFile            string
	InsecureSkipVerify bool
	Token              string
	Timeout            time.Duration
}

type Flags

type Flags struct {
	Kubeconfig string
	ConfigFile string
	ConfigMap  string
	InCluster  bool
}

type HTTPHealthCheck

type HTTPHealthCheck struct {
	Timeout            time.Duration
	Type               string
	RequestPath        string
	Port               int
	Host               string
	Service            string
	Namespace          string
	InsecureSkipVerify bool
	Discovery          string
}

type Kubernetes

type Kubernetes struct {
	Enabled bool
}

type Option

type Option func(c *Config)

func WithFile

func WithFile(file string) Option

func WithFlags

func WithFlags(flags *Flags) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

type Server

type Server struct {
	Address     string
	Port        int
	IdleTimeout time.Duration
}

Jump to

Keyboard shortcuts

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