Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDB ¶
func RegisterDB(name string, fn func(interface{}, map[string]string) (ValuesetDB, error))
Types ¶
type Config ¶
type Config struct {
ValuesetDBs []ValuesetDB
// contains filtered or unexported fields
}
func LoadConfig ¶
should get the root of the file
type ErrMultipleValues ¶
func (ErrMultipleValues) Error ¶
func (e ErrMultipleValues) Error() string
type LRUCache ¶
func NewValuesetLRUCache ¶
func (*LRUCache[K, V]) Lookup ¶
func (cache *LRUCache[K, V]) Lookup(req ls.ValuesetLookupRequest) (ls.ValuesetLookupResponse, bool)
ValuesetCache.Lookup returns the cached ValuesetLookupResponse if exists
func (*LRUCache[K, V]) Set ¶
func (cache *LRUCache[K, V]) Set(req ls.ValuesetLookupRequest, res ls.ValuesetLookupResponse)
ValuesetCache.Set caches a generated hash as a key, storing the request as its corresponding value
type NoCache ¶
type NoCache struct{}
func (NoCache) Lookup ¶
func (NoCache) Lookup(req ls.ValuesetLookupRequest) (ls.ValuesetLookupResponse, bool)
func (NoCache) Set ¶
func (NoCache) Set(req ls.ValuesetLookupRequest, res ls.ValuesetLookupResponse)
type ValuesetCache ¶
type ValuesetCache interface {
Lookup(req ls.ValuesetLookupRequest) (ls.ValuesetLookupResponse, bool)
Set(req ls.ValuesetLookupRequest, res ls.ValuesetLookupResponse)
}
type ValuesetDB ¶
type ValuesetDB interface {
ValueSetLookup(context.Context, string, map[string]string) (map[string]string, error)
GetTableIds() map[string]struct{}
Close() error
}
func UnmarshalSingleDatabaseConfig ¶
func UnmarshalSingleDatabaseConfig(database map[string]interface{}, env map[string]string) (ValuesetDB, error)
Click to show internal directories.
Click to hide internal directories.