consulclient

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 5 Imported by: 2

README

consul-client

Consul client

Documentation

Index

Constants

View Source
const DEFAULT_CACHING_INTERVAL = time.Minute * 5

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Expired time.Time
	Value   any
}

type ConsulClient

type ConsulClient interface {
	Get(key string) (any, error)
	GetOrSet(key string, period time.Duration) (any, error)
}

func New

func New(config *ConsulConfig) (ConsulClient, error)

type ConsulClientService added in v1.0.3

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

func (*ConsulClientService) Get added in v1.0.3

func (service *ConsulClientService) Get(key string) (any, error)

func (*ConsulClientService) GetOrSet added in v1.0.3

func (service *ConsulClientService) GetOrSet(key string, period time.Duration) (any, error)

type ConsulConfig

type ConsulConfig struct {
	Address         string
	EnvironmentName string
	Scheme          string
	StorageName     string
	Token           string
}

Jump to

Keyboard shortcuts

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