domain

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Query(app, env, key string) (*concept.Element, bool)
	Set(app, env, key string, elem *concept.Element)
}

func NewCache

func NewCache(size uint) Cache

NewCache construct a cache instance to help app manages caches. FIXED(@yeqown): how to clear caches? or cache items will be released at time. Solution: limit cache size with cache replacing algorithm so that no need to worry about OOM.

DONE(@yeqown): using LRU-2 cache replacing algorithm to limit cache.

type InstancePool

type InstancePool interface {
	Register(insId string, app, env string, keys []string) <-chan *concept.Element

	Unregister(insId string)

	Notify(insId string, element *concept.Element)

	ListWatchingInstances(app, env, key string) set.StringSet
}

InstancePool is a pool provide open API ability to Register / Unregister / Notify instances.

func NewInstancePool

func NewInstancePool() InstancePool

Jump to

Keyboard shortcuts

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