cluster

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 8 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

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.

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

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"`
	DNSSockGID     string            `json:"dns_sock_gid"`
	DNSSockUID     string            `json:"dns_sock_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