consulagent

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulAgent

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

ConsulAgent holds a singleton consul agent and a logger

func NewConsulAgent

func NewConsulAgent(options ...Options) *ConsulAgent

NewConsulAgent will initialize consul client.

func (*ConsulAgent) CreateKV

func (ca *ConsulAgent) CreateKV(key string, value interface{}) bool

CreateKV creates a key value pair

func (*ConsulAgent) DeleteKV

func (ca *ConsulAgent) DeleteKV(key string) bool

DeleteKV creates a key value pair

func (*ConsulAgent) GetKeyValuePairs

func (ca *ConsulAgent) GetKeyValuePairs(prefix string) map[string][]byte

GetKeyValuePairs gets the list of keys and corresponding values for a prefix string

func (*ConsulAgent) GetKeys

func (ca *ConsulAgent) GetKeys(prefix string) []string

GetKeys gets the list of keys for the prefix string

func (*ConsulAgent) GetValue

func (ca *ConsulAgent) GetValue(key string) []byte

GetValue gets the value of the key

type Options

type Options func(c *ConsulAgent)

Options sets a parameter for consul agent

func ConsulHost

func ConsulHost(hostName string) Options

ConsulHost sets the IP for consul agent. Defults to 127.0.0.1

func ConsulPort

func ConsulPort(portNumber int) Options

ConsulPort sets the port for consul agent. Defaults to 8500

func Logger

func Logger(customLogger *gologger.CustomLogger) Options

Logger sets the logger for consul Defaults to consul logger

Jump to

Keyboard shortcuts

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