config

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustExistsEnv

func MustExistsEnv(key string) error

func SetConfigFile

func SetConfigFile(filename string)

Types

type BindingConfig

type BindingConfig struct {
	Name       string   `json:"name"`
	Sources    Spec     `json:"sources"`
	Targets    Spec     `json:"targets"`
	Properties Metadata `json:"properties"`
}

func (BindingConfig) Validate

func (b BindingConfig) Validate() error

type Config

type Config struct {
	Bindings []BindingConfig `json:"bindings" json:"bindings"`
	ApiPort  int             `json:"apiPort" yaml:"apiPort"`
	LogLevel string          `json:"logLevel" yaml:"logLevel"`
}

func Load

func Load(cfgCh chan *Config) (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type Metadata

type Metadata map[string]string

func NewMetadata

func NewMetadata() Metadata

func (Metadata) Get

func (m Metadata) Get(key string) string

func (Metadata) MustParseAddress

func (m Metadata) MustParseAddress(key, defaultValue string) (string, int, error)

func (Metadata) MustParseBool

func (m Metadata) MustParseBool(key string) (bool, error)

func (Metadata) MustParseByteArray

func (m Metadata) MustParseByteArray(key string) ([]byte, error)

func (Metadata) MustParseEnv

func (m Metadata) MustParseEnv(key, envVar, defaultValue string) (string, error)

func (Metadata) MustParseInt

func (m Metadata) MustParseInt(key string) (int, error)

func (Metadata) MustParseIntWithRange

func (m Metadata) MustParseIntWithRange(key string, min, max int) (int, error)

func (Metadata) MustParseJsonMap

func (m Metadata) MustParseJsonMap(key string) (map[string]string, error)

func (Metadata) MustParseString

func (m Metadata) MustParseString(key string) (string, error)

func (Metadata) MustParseStringList

func (m Metadata) MustParseStringList(key string) ([]string, error)

func (Metadata) ParseBool

func (m Metadata) ParseBool(key string, defaultValue bool) bool

func (Metadata) ParseInt

func (m Metadata) ParseInt(key string, defaultValue int) int

func (Metadata) ParseIntWithRange

func (m Metadata) ParseIntWithRange(key string, defaultValue, min, max int) (int, error)

func (Metadata) ParseString

func (m Metadata) ParseString(key, defaultValue string) string

func (Metadata) ParseStringList

func (m Metadata) ParseStringList(key string) []string

func (Metadata) ParseStringMap

func (m Metadata) ParseStringMap(key string, stringMap map[string]string) (string, error)

func (Metadata) Set

func (m Metadata) Set(key, value string) Metadata

func (Metadata) String

func (m Metadata) String() string

type Spec

type Spec struct {
	Kind        string     `json:"kind"`
	Connections []Metadata `json:"connections"`
}

func (Spec) Validate

func (s Spec) Validate() error

Jump to

Keyboard shortcuts

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