twemproxy

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthPoolName    string = "health"
	HealthBindAddress string = "127.0.0.1:22333"
)
View Source
const (
	TwemproxyConfigFile = "/etc/twemproxy/nutcracker.yml"
)

Variables

This section is empty.

Functions

func AddTwemproxySidecar

func AddTwemproxySidecar(dep appsv1.Deployment, spec *saasv1alpha1.TwemproxySpec) *appsv1.Deployment

Types

type Server added in v0.16.1

type Server struct {
	Address  string
	Priority int
	Name     string
}

func (*Server) MarshalJSON added in v0.16.1

func (srv *Server) MarshalJSON() ([]byte, error)

func (*Server) UnmarshalJSON added in v0.16.1

func (srv *Server) UnmarshalJSON(data []byte) error

type ServerPoolConfig added in v0.16.1

type ServerPoolConfig struct {
	Listen             string   `json:"listen"`
	Hash               string   `json:"hash,omitempty"`
	HashTag            string   `json:"hash_tag,omitempty"`
	Distribution       string   `json:"distribution,omitempty"`
	Timeout            int      `json:"timeout,omitempty"`
	Backlog            int      `json:"backlog,omitempty"`
	PreConnect         bool     `json:"preconnect"`
	Redis              bool     `json:"redis"`
	AutoEjectHosts     bool     `json:"auto_eject_hosts"`
	ServerFailureLimit int      `json:"server_failure_limit,omitempty"`
	Servers            []Server `json:"servers"`
}

func GenerateServerPool added in v0.16.1

func GenerateServerPool(pool saasv1alpha1.TwemproxyServerPool, targets map[string]Server) ServerPoolConfig

type TwemproxyOptions

type TwemproxyOptions struct {
	ConfigFile     pod.EnvVarValue `env:"TWEMPROXY_CONFIG_FILE"`
	MetricsAddress pod.EnvVarValue `env:"TWEMPROXY_METRICS_ADDRESS"`
	StatsInterval  pod.EnvVarValue `env:"TWEMPROXY_STATS_INTERVAL"`
	LogLevel       pod.EnvVarValue `env:"TWEMPROXY_LOG_LEVEL"`
}

TwemproxyOptions holds configuration for the Twemproxy sidecar

func NewTwemproxyOptions

func NewTwemproxyOptions(spec saasv1alpha1.TwemproxySpec) TwemproxyOptions

NewTwemproxyOptions returns a NewTwemproxyOptions struct for the given saasv1alpha1.BackendSpec

Jump to

Keyboard shortcuts

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