cluster

package
v3.0.0-beta12 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitData

func InitData()

InitData reset package objects data, it can be used for tests.

Types

type Config

type Config struct {
	Issues     []string       `json:"issues"`
	ID         string         `json:"id"`
	Name       string         `json:"name"`
	Nodes      Nodes          `json:"nodes"`
	DNS        []string       `json:"dns"`
	CASecPaths []string       `json:"ca_sec_paths"`
	Listener   ConfigListener `json:"listener"`
	Quorum     bool           `json:"quorum"`
	// contains filtered or unexported fields
}

Config describes the cluster id, name and nodes The cluster name is used as the right most part of cluster dns names.

func (*Config) DeepCopy

func (t *Config) DeepCopy() *Config

func (*Config) SSHKeyFile

func (t *Config) SSHKeyFile() (string, bool)

SSHKeyFile returns the configured SSH key file path and a boolean indicating if the file exists and is regular.

func (*Config) Secret

func (t *Config) Secret() string

func (*Config) SetSSHKeyFile

func (t *Config) SetSSHKeyFile(s string)

func (*Config) SetSecret

func (t *Config) SetSecret(s string)

type ConfigListener

type ConfigListener struct {
	CRL            string            `json:"crl"`
	Addr           string            `json:"addr"`
	Port           int               `json:"port"`
	OpenIDIssuer   string            `json:"openid_issuer"`
	OpenIDClientID string            `json:"openid_client_id"`
	DNSSockGID     string            `json:"dns_sock_gid"`
	DNSSockUID     string            `json:"dns_sock_uid"`
	RateLimiter    RateLimiterConfig `json:"rate_limiter"`
}

type DataT

type DataT[T Dataer] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

DataT defines a shared holder for all objects Dataer

var (

	// ConfigData is the package data holder for local cluster config
	ConfigData *DataT[Config]
)

func NewData

func NewData[T Dataer]() *DataT[T]

func (*DataT[T]) Get

func (c *DataT[T]) Get() *T

func (*DataT[T]) IsSet

func (c *DataT[T]) IsSet() bool

func (*DataT[T]) Set

func (c *DataT[T]) Set(v *T)

type Dataer

type Dataer interface {
	Config
}

type Nodes

type Nodes []string

func (Nodes) Contains

func (t Nodes) Contains(s string) bool

type RateLimiterConfig

type RateLimiterConfig struct {
	Rate    rate.Limit    `json:"rate"`
	Burst   int           `json:"burst"`
	Expires time.Duration `json:"expires"`
}

Jump to

Keyboard shortcuts

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