config

package
v0.0.0-...-9ce36fb Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServicePing = "ping"
	ServicePong = "pong"
)
View Source
const DefaultDataplaneImage = "hashicorp/consul-dataplane:1.0.0"
View Source
const DefaultEnvoyVersion = "v1.24.0"
View Source
const PrimaryCluster = "dc1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Name         string `hcl:"name,label"`
	Servers      int    `hcl:"servers,optional"`
	Clients      int    `hcl:"clients,optional"`
	MeshGateways int    `hcl:"mesh_gateways,optional"`
}

type Config

type Config struct {
	ConfName                         string // name from config.hcl
	Versions                         Versions
	CanaryVersions                   Versions
	CanaryNodes                      []string
	EncryptionTLS                    bool
	EncryptionTLSAPI                 bool
	EncryptionTLSGRPC                bool
	EncryptionServerTLSGRPC          bool
	EncryptionGossip                 bool
	SecurityDisableACLs              bool
	SecurityDisableDefaultIntentions bool
	VaultEnabled                     bool
	VaultImage                       string
	VaultAsMeshCA                    map[string]struct{}
	KubernetesEnabled                bool
	EnvoyLogLevel                    string
	PrometheusEnabled                bool
	InitialMasterToken               string
	ConfigEntries                    map[string][]api.ConfigEntry
	GossipKey                        string
	AgentMasterToken                 string
	EnterpriseEnabled                bool
	EnterpriseSegments               map[string]int
	EnterprisePartitions             []*Partition
	EnterpriseLicensePath            string
	TopologyNetworkShape             string
	TopologyLinkMode                 string
	TopologyNodeMode                 string
	TopologyClusters                 []*Cluster
	TopologyNodes                    []*Node
}

Config is the runtime configuration struct derived from rawConfig.

func LoadConfig

func LoadConfig(pathname string) (*Config, error)

LoadConfig loads up the default config file (config.hcl), parses it, and does some light validation.

func (*Config) CanaryInfo

func (c *Config) CanaryInfo() (configured bool, nodes map[string]struct{})

type Node

type Node struct {
	NodeName           string            `hcl:"name,label"`
	Mode               string            `hcl:"mode,optional"`
	Segment            string            `hcl:"segment,optional"`
	Partition          string            `hcl:"partition,optional"`
	UpstreamName       string            `hcl:"upstream_name,optional"`
	UpstreamNamespace  string            `hcl:"upstream_namespace,optional"`
	UpstreamPartition  string            `hcl:"upstream_partition,optional"`
	UpstreamPeer       string            `hcl:"upstream_peer,optional"`
	UpstreamDatacenter string            `hcl:"upstream_datacenter,optional"`
	UpstreamExtraHCL   string            `hcl:"upstream_extra_hcl,optional"`
	ServiceMeta        map[string]string `hcl:"service_meta,optional"` // key -> val
	ServiceNamespace   string            `hcl:"service_namespace,optional"`
	UseBuiltinProxy    bool              `hcl:"use_builtin_proxy,optional"`
	Dead               bool              `hcl:"dead,optional"`

	// mesh-gateway settings
	RetainInPrimaryGatewaysList bool `hcl:"retain_in_primary_gateways_list,optional"`
	UseDNSWANAddress            bool `hcl:"use_dns_wan_address,optional"`
}

func (*Node) Meta

func (c *Node) Meta() map[string]string

type Partition

type Partition struct {
	Name       string   `hcl:"name,label"`
	Namespaces []string `hcl:"namespaces,optional"`
}

func (*Partition) IsDefault

func (c *Partition) IsDefault() bool

func (*Partition) String

func (c *Partition) String() string

type Versions

type Versions struct {
	ConsulImage    string
	Envoy          string
	DataplaneImage string
}

Jump to

Keyboard shortcuts

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