pkg

package
v0.0.0-...-cf74f9b Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comfigurator

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

func NewComfigurator

func NewComfigurator() *Comfigurator

func (*Comfigurator) AddKVStoreGateway

func (c *Comfigurator) AddKVStoreGateway(kvg *KVStoreGateway)

func (*Comfigurator) GenerateFromPath

func (c *Comfigurator) GenerateFromPath(path string, pattern string, configMake func() interface{}) (map[string]interface{}, error)

GenerateFromPath creates a series of yaml configs based on the path and a given string pattern. the pattern is the same as used by filepath.Match.

type KVStoreGateway

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

func NewKVStoreGateway

func NewKVStoreGateway() *KVStoreGateway

func (*KVStoreGateway) AddStore

func (sg *KVStoreGateway) AddStore(s Store)

AddStore adds a new KV store to the gateway, they are searched in order of first added, if no value is found in the first then the second will be searched. If none are found then an error is thrown

func (*KVStoreGateway) Get

func (sg *KVStoreGateway) Get(key string) string

func (*KVStoreGateway) GetArray

func (sg *KVStoreGateway) GetArray(key string) map[string]string

func (*KVStoreGateway) GetMap

func (sg *KVStoreGateway) GetMap(key string) map[string]string

type MemoryStore

type MemoryStore struct {
	Cache      map[string]string
	MapCache   map[string]map[string]string
	ArrayCache map[string][]string
}

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Get

func (m *MemoryStore) Get(key string) (string, bool)

func (*MemoryStore) GetArray

func (m *MemoryStore) GetArray(key string) ([]string, bool)

func (*MemoryStore) GetMap

func (m *MemoryStore) GetMap(key string) (map[string]string, bool)

type Store

type Store interface {
	Get(string) (string, bool)
	GetMap(string) (map[string]string, bool)
	GetArray(string) ([]string, bool)
}

Jump to

Keyboard shortcuts

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