cluster

package
v3.0.0-rc77 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DNSExpireMin = 65 * time.Second
	DNSExpireMax = math.MaxUint32 * time.Second
)

DNSExpireMin and DNSExpireMax bound cluster.dns_expire: the expiry outlasts a refresh and a retry of the nameservers, 60s and 5s, else they drop their copy between two transfers, and fits the 32 bits of the SOA.

Variables

This section is empty.

Functions

func InitData

func InitData()

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

func ParseAIAgentURL

func ParseAIAgentURL(value string) (*url.URL, error)

ParseAIAgentURL reads ai.agent_url: an https origin, without credentials, path, query or fragment, which the browsers running om3-webapp call.

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"`
	DNSReverse bool     `json:"dns_reverse"`

	// DNSExpire is the expiry the SOA of the cluster zones says: how
	// long a secondary answers from its copy of a zone without its
	// primary.
	DNSExpire time.Duration `json:"dns_expire"`

	// DNSZone is the apex of the cluster zone, under which the
	// cluster nameservers publish the objects, the cluster name when
	// empty: the Zone method says it.
	DNSZone string `json:"dns_zone"`

	// DNSContact is the mailbox of the people in charge of the
	// cluster zones, which their SOA names, empty for the hostmaster
	// of the zone.
	DNSContact string         `json:"dns_contact"`
	CASecPaths []string       `json:"ca_sec_paths"`
	Listener   ConfigListener `json:"listener"`
	AI         ConfigAI       `json:"ai"`
	Quorum     bool           `json:"quorum"`

	// UXGroups are the grants of the members of a unix group
	// connected to the user socket, by group name, as the
	// [uxgroup#<group>] sections say them for this node.
	UXGroups map[string][]string `json:"ux_groups"`
	// 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)

func (*Config) Zone

func (t *Config) Zone() string

Zone returns the apex of the cluster zone, without its final dot and in lower case, as the names asked are compared: cluster.dns_zone, else the cluster name.

type ConfigAI

type ConfigAI struct {
	// AgentURL is the origin of the OpenSVC AI agent om3-webapp
	// calls, none when empty.
	AgentURL string `json:"agent_url"`
}

ConfigAI is the [ai] section of the cluster configuration.

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"`

	// DNSAddr and DNSPort are where the daemon serves the cluster
	// zones to the nameserver of the node, by zone transfer.
	DNSAddr string `json:"dns_addr"`
	DNSPort int    `json:"dns_port"`

	// DNSNotifyPort is the port the nameserver of the node listens
	// on, which the daemon notifies of each change of a zone.
	DNSNotifyPort int `json:"dns_notify_port"`

	// DNSUID is the uid of the nameserver of the node, the user
	// allowed to query the zones the daemon serves, beside root.
	DNSUID int `json:"dns_uid"`

	RateLimiter RateLimiterConfig `json:"rate_limiter"`

	// TLSSecs are the secs whose certificates the listener presents
	// to the clients asking one of their names.
	TLSSecs []string `json:"tls_secs"`

	// ACMEPort is the port the listener answers the http-01 ACME
	// challenges on, none when zero.
	ACMEPort int `json:"acme_port"`

	// UXOwnerGroup is the group owning the user socket, whose
	// members reach the api as themselves. Empty, the node serves
	// no user socket.
	UXOwnerGroup string `json:"ux_owner_group"`

	// PublicMetrics serves /metrics with no authentication. The
	// detail pages, /metrics/<subsystem>, stay protected.
	PublicMetrics bool `json:"public_metrics"`

	// VsockPort is the vsock port the api is served on, for the
	// hypervisor of the node, none when zero.
	VsockPort int `json:"vsock_port"`
}

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