aconfig

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NoResponse doesn't send any response, the TCP ACK is all you get.
	NoResponse sarama.RequiredAcks = 0
	// WaitForLocal waits for only the local commit to succeed before responding.
	WaitForLocal sarama.RequiredAcks = 1
	// WaitForAll waits for all in-sync replicas to commit before responding.
	// The minimum number of in-sync replicas is configured on the broker via
	// the `min.insync.replicas` configuration key.
	WaitForAll sarama.RequiredAcks = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	TypeMeta   `json:",inline"`
	ObjectMeta `json:"metadata,omitempty"`
	Spec       ApplicationSpec `json:"spec,omitempty"`
}

func New

func New(configFile string, funcs ...PreProcessFunc) (*Application, error)

func (*Application) GetAPIVersion

func (a *Application) GetAPIVersion() string

func (*Application) GetCustomConfig

func (a *Application) GetCustomConfig() KV

func (*Application) GetMatchedPrimaryPort

func (a *Application) GetMatchedPrimaryPort(name PortName) *MatchedPrimaryPort

func (*Application) GetMatchedPrimaryPortLocation

func (a *Application) GetMatchedPrimaryPortLocation(name PortName) *Location

func (*Application) GetName

func (a *Application) GetName() string

func (*Application) GetSecondaryPort

func (a *Application) GetSecondaryPort(name PortName) *SecondaryPort

func (*Application) GetSecondaryPorts

func (a *Application) GetSecondaryPorts() map[PortName]SecondaryPort

type ApplicationSpec

type ApplicationSpec struct {
	PrimaryPorts   map[PortName]PrimaryPort   `json:"primary_ports,omitempty"`
	SecondaryPorts map[PortName]SecondaryPort `json:"secondary_ports,omitempty"`
	CustomConfig   KV                         `json:"custom_config,omitempty"`
}

type Common

type Common struct {
	Log          Log          `json:"log,omitempty"`
	Database     Database     `json:"database,omitempty"`
	Encryptor    Encryptor    `json:"encryptor,omitempty"`
	Var          Var          `json:"var,omitempty"`
	SaramaConfig SaramaConfig `json:"sarama_config,omitempty"`
}

func (*Common) Complete

func (c *Common) Complete(applicationName string)

type Database

type Database struct {
	MaxOpenConnections        int   `json:"max_open_connections,omitempty"`
	MaxIdleConnections        int   `json:"max_idle_connections,omitempty"`
	ConnectionMaxLifeSeconds  int64 `json:"connection_max_life_seconds,omitempty"`
	ConnectionMaxIdleSeconds  int64 `json:"connection_max_idle_seconds,omitempty"`
	SlowThresholdMilliseconds int64 `json:"slow_threshold_milliseconds,omitempty"`
}

type Encryptor added in v0.0.25

type Encryptor struct {
	S string `json:"s,omitempty"`
}

type Interface

type Interface struct {
	Name string `json:"name,omitempty"`
}

type KV

type KV map[string]interface{}

func (KV) Get

func (kv KV) Get(key string) interface{}

func (KV) GetBool

func (kv KV) GetBool(key string) bool

func (KV) GetDuration

func (kv KV) GetDuration(key string) time.Duration

func (KV) GetFloat64

func (kv KV) GetFloat64(key string) float64

func (KV) GetInt

func (kv KV) GetInt(key string) int

func (KV) GetInt32

func (kv KV) GetInt32(key string) int32

func (KV) GetInt64

func (kv KV) GetInt64(key string) int64

func (KV) GetString

func (kv KV) GetString(key string) string

func (KV) GetStringMap

func (kv KV) GetStringMap(key string) map[string]interface{}

func (KV) GetStringMapString

func (kv KV) GetStringMapString(key string) map[string]string

func (KV) GetStringMapStringSlice

func (kv KV) GetStringMapStringSlice(key string) map[string][]string

func (KV) GetStringSlice

func (kv KV) GetStringSlice(key string) []string

func (KV) GetTime

func (kv KV) GetTime(key string) time.Time

func (KV) GetUint

func (kv KV) GetUint(key string) uint

func (KV) GetUint32

func (kv KV) GetUint32(key string) uint32

func (KV) GetUint64

func (kv KV) GetUint64(key string) uint64

func (KV) LoadTo

func (kv KV) LoadTo(out interface{}) error

type Location

type Location struct {
	Address string `json:"address,omitempty"`
	Port    int    `json:"port,omitempty"`
}

type Log

type Log struct {
	Level     string `json:"level,omitempty"`
	Directory string `json:"directory,omitempty"`
	Format    string `json:"format,omitempty"`
}

type MatchedPrimaryPort

type MatchedPrimaryPort struct {
	Location        *Location `json:"location,omitempty"`
	ApplicationName string    `json:"application_name,omitempty"`
}

type ObjectMeta

type ObjectMeta struct {
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

type PortName

type PortName string

type PreProcessFunc

type PreProcessFunc func([]byte) ([]byte, error)

type PrimaryPort

type PrimaryPort struct {
	Interface Interface `json:"interface,omitempty"`
	Location  *Location `json:"location,omitempty"`
}

type SaramaConfig

type SaramaConfig struct {
	ClientID                string              `json:"client_id,omitempty"`
	ChannelBufferSize       int                 `json:"channel_buffer_size,omitempty"`
	ProducerReturnSuccesses bool                `json:"producer_return_successes,omitempty"`
	ProducerRetryMax        int                 `json:"producer_retry_max,omitempty"`
	ProducerRequiredAcks    sarama.RequiredAcks `json:"producer_required_acks,omitempty"`
	ProducerTimeout         int                 `json:"producer_timeout,omitempty"`
	ProducerFlushFrequency  int                 `json:"producer_flush_frequency,omitempty"`

	NetTLSEnable       bool        `json:"net_tls_enable,omitempty"`
	NetTLSConfig       *tls.Config `json:"net_tls_config,omitempty"`
	InsecureSkipVerify bool        `json:"insecure_skip_verify,omitempty"`
	CertFile           string      `json:"cert_file,omitempty"`
	KeyFile            string      `json:"key_file,omitempty"`
	CaFile             string      `json:"ca_file,omitempty"`
	K8sNamespace       string      `json:"k8s_namespace,omitempty"`
	K8sSecret          string      `json:"k8s_secret,omitempty"`
}

type SecondaryPort

type SecondaryPort struct {
	Interface          Interface           `json:"interface,omitempty"`
	Options            KV                  `json:"options,omitempty"`
	MatchedPrimaryPort *MatchedPrimaryPort `json:"matched_primary_port,omitempty"`
}

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty"`
	APIVersion string `json:"api_version,omitempty"`
}

type Var

type Var struct {
	TmpDirectory     string `json:"tmp_directory,omitempty"`
	PrivateDirectory string `json:"private_directory,omitempty"`
}

func (*Var) GetPrivateDirectory

func (v *Var) GetPrivateDirectory() string

func (*Var) GetTmpDirectory

func (v *Var) GetTmpDirectory() string

Jump to

Keyboard shortcuts

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