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 ¶
ConsulHost sets the IP for consul agent. Defults to 127.0.0.1
func ConsulPort ¶
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
Click to show internal directories.
Click to hide internal directories.