consul

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package consul implements the consul configuration center integration, fulfilling the core/config/Source interface.

Index

Constants

View Source
const (
	// Name of the configuration source.
	Name = "consul"
	// Priority of this source. Higher than files, allowing remote overrides.
	Priority = 11
)

Variables

This section is empty.

Functions

func New

func New(options *config.SourceOptions) (config.Sourcer, error)

New initializes the Consul configuration source and starts the background watchers.

Types

type Config

type Config struct {
	Client    string `json:"client"`    // The name of the consul client to use from stores
	Delimiter string `json:"delimiter"` // Path separator, usually "/"
}

Config defines the settings for the Consul source implementation.

type Consul

type Consul struct {
	// contains filtered or unexported fields
}

Consul manages the connection to the Consul KV store and handles configuration synchronization.

func (*Consul) Disconnect

func (s *Consul) Disconnect()

Disconnect cleans up any resources if the source is closed.

func (*Consul) GetAll

func (s *Consul) GetAll() map[string]*config.Value

GetAll is a placeholder as Consul uses a push-based 'watch' mechanism.

func (*Consul) Name

func (s *Consul) Name() string

func (*Consul) Priority

func (s *Consul) Priority() int

func (*Consul) Set

func (s *Consul) Set(key string, value any) error

Set is a placeholder; currently, this source is read-only for the application.

Jump to

Keyboard shortcuts

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