apikey

package
v1.63.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Index  int
	Key    string
	Secret string
	Fields map[string]string
}

func (*Entry) Get

func (e *Entry) Get(field string) (val string, ok bool)

func (*Entry) GetKeySecret

func (e *Entry) GetKeySecret() (key, secret string)

func (*Entry) String

func (e *Entry) String() string

type EnvKeyLoader

type EnvKeyLoader struct {
	Prefix  string
	Postfix string

	RequiredFields []string
	AllowPartial   bool
	// contains filtered or unexported fields
}

func NewEnvKeyLoader

func NewEnvKeyLoader(prefix, postfix string, fields ...string) *EnvKeyLoader

func (*EnvKeyLoader) Load

func (l *EnvKeyLoader) Load(envVars []string) (*Source, error)

Load loads the environment variables and returns a Source object. call Load(os.Environ())

type RandomBalancer

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

func NewRandomBalancer

func NewRandomBalancer(source *Source) *RandomBalancer

func (*RandomBalancer) GetStats

func (b *RandomBalancer) GetStats() map[int]float64

func (*RandomBalancer) Next

func (b *RandomBalancer) Next() *Entry

type RoundTripBalancer

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

func NewRoundTripBalancer

func NewRoundTripBalancer(source *Source) *RoundTripBalancer

func (*RoundTripBalancer) GetStats

func (b *RoundTripBalancer) GetStats() map[int]float64

func (*RoundTripBalancer) Next

func (b *RoundTripBalancer) Next() *Entry

func (*RoundTripBalancer) Peek

func (b *RoundTripBalancer) Peek() *Entry

func (*RoundTripBalancer) Reset

func (b *RoundTripBalancer) Reset()

type Source

type Source struct {
	Entries []Entry
}

func NewSourceFromArray

func NewSourceFromArray(data [][]string) *Source

func (*Source) Add

func (s *Source) Add(entry Entry)

func (*Source) Get

func (s *Source) Get(index int) *Entry

func (*Source) Len

func (s *Source) Len() int

Jump to

Keyboard shortcuts

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