cluster

package
v0.0.0-...-0a8b275 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 1 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 {
	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"`
	Vip        Vip            `json:"vip"`
	// 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) Secret

func (t Config) Secret() 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"`
	OpenIDWellKnown string `json:"openid_well_known"`
	DNSSockGID      string `json:"dns_sock_gid"`
	DNSSockUID      string `json:"dns_sock_uid"`
}

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 Vip

type Vip struct {
	// Default is the default vip configuration value, must be not zero to
	// enable cluster vip
	Default string `json:"default"`
	// Addr is the default vip addr
	Addr string `json:"name"`
	// Netmask is the default vip netmask
	Netmask string `json:"netmask"`
	// Dev is the default vip device
	Dev string `json:"dev"`
	// Devs is a map of node names to custom vip device (when
	// the device for node name is not equal to default vip device)
	Devs map[string]string `json:"devs"`
}

Vip struct describes cluster vip settings

func (*Vip) DeepCopy

func (v *Vip) DeepCopy() *Vip

func (*Vip) Equal

func (v *Vip) Equal(o *Vip) bool

Jump to

Keyboard shortcuts

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