util

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GrpcRetryBackoffMillisecs         = 100
	EnvoyUpdateDefaultBatchWaitMillis = 250 * time.Millisecond
)
View Source
const RequestIdHeader = "x-request-id"
View Source
const RequestIdHeaderCanonical = "X-Request-Id"

Variables

This section is empty.

Functions

func CreateRequestId

func CreateRequestId() string

func GetBoolEnvar

func GetBoolEnvar(key string, defaultValue bool) (bool, error)

func GetHttpClient

func GetHttpClient() (*http.Client, error)

func GetHttpClientFromTLSOptions

func GetHttpClientFromTLSOptions(tlsOptions *TLSOptions) *http.Client

func GetIntEnvar

func GetIntEnvar(key string, defaultValue int) (int, error)

func GetKafkaConsumerName

func GetKafkaConsumerName(modelName, prefix string, maxConsumers int) string

func GetOrignalModelNameAndVersion

func GetOrignalModelNameAndVersion(versionedModel string) (string, uint32, error)

func GetPinnedModelVersion

func GetPinnedModelVersion() uint32

func GetVersionedModelName

func GetVersionedModelName(model string, version uint32) string

func Hash

func Hash(s string) (uint32, error)

func XXHash

func XXHash(key string) string

Types

type LoadBalancer

type LoadBalancer interface {
	AddServer(serverName string)
	RemoveServer(serverName string)
	GetServersForKey(key string) []string
}

type RingLoadBalancer

type RingLoadBalancer struct {
	// contains filtered or unexported fields
}

func NewRingLoadBalancer

func NewRingLoadBalancer(replicationFactor int) *RingLoadBalancer

func (*RingLoadBalancer) AddServer

func (lb *RingLoadBalancer) AddServer(serverName string)

func (*RingLoadBalancer) GetServersForKey

func (lb *RingLoadBalancer) GetServersForKey(key string) []string

func (*RingLoadBalancer) RemoveServer

func (lb *RingLoadBalancer) RemoveServer(serverName string)

type TLSOptions

type TLSOptions struct {
	TLS  bool
	Cert *seldontls.CertificateStore
}

func CreateTLSClientOptions

func CreateTLSClientOptions() (*TLSOptions, error)

func CreateUpstreamDataplaneServerTLSOptions

func CreateUpstreamDataplaneServerTLSOptions() (TLSOptions, error)

Jump to

Keyboard shortcuts

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