Documentation
¶
Index ¶
- Constants
- func ParseNodename(key string) string
- func ParseStatusKey(key string) (string, string, string, string)
- func ProcessingKey(processing *types.Processing) string
- type Event
- type EventType
- type KV
- type Store
- func (s *Store) AddNode(ctx context.Context, opts *types.AddNodeOptions) (*types.Node, error)
- func (s *Store) AddPod(ctx context.Context, name, desc string) (*types.Pod, error)
- func (s *Store) AddWorkload(ctx context.Context, workload *types.Workload, processing *types.Processing) error
- func (s *Store) CreateProcessing(ctx context.Context, processing *types.Processing, count int) error
- func (s *Store) DeleteProcessing(ctx context.Context, processing *types.Processing) error
- func (s *Store) GetAllPods(ctx context.Context) ([]*types.Pod, error)
- func (s *Store) GetDeployStatus(ctx context.Context, appname, entryname string) (map[string]int, error)
- func (s *Store) GetNode(ctx context.Context, nodename string) (*types.Node, error)
- func (s *Store) GetNodeStatus(ctx context.Context, nodename string) (*types.NodeStatus, error)
- func (s *Store) GetNodes(ctx context.Context, nodenames []string) ([]*types.Node, error)
- func (s *Store) GetNodesByPod(ctx context.Context, nodeFilter *types.NodeFilter, withoutEngine bool) ([]*types.Node, error)
- func (s *Store) GetPod(ctx context.Context, name string) (*types.Pod, error)
- func (s *Store) GetServiceStatus(ctx context.Context) ([]string, error)
- func (s *Store) GetWorkload(ctx context.Context, ID string) (*types.Workload, error)
- func (s *Store) GetWorkloads(ctx context.Context, IDs []string) ([]*types.Workload, error)
- func (s *Store) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) ([]*types.Workload, error)
- func (s *Store) ListWorkloads(ctx context.Context, appname, entrypoint, nodename string, limit int64, ...) ([]*types.Workload, error)
- func (s *Store) MakeClient(ctx context.Context, node *types.Node) (engine.API, error)
- func (s *Store) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
- func (s *Store) RegisterService(ctx context.Context, serviceAddress string, expire time.Duration) (<-chan struct{}, func(), error)
- func (s *Store) RemoveNode(ctx context.Context, node *types.Node) error
- func (s *Store) RemovePod(ctx context.Context, podname string) error
- func (s *Store) RemoveWorkload(ctx context.Context, workload *types.Workload) error
- func (s *Store) ServiceStatusStream(ctx context.Context) chan []string
- func (s *Store) SetNodeStatus(ctx context.Context, node *types.Node, ttl int64) error
- func (s *Store) SetWorkloadStatus(ctx context.Context, status *types.StatusMeta, ttl int64) error
- func (s *Store) UpdateNodes(ctx context.Context, nodes ...*types.Node) error
- func (s *Store) UpdateWorkload(ctx context.Context, workload *types.Workload) error
- func (s *Store) WorkloadStatusStream(ctx context.Context, appname, entrypoint, nodename string, ...) chan *types.WorkloadStatus
Constants ¶
View Source
const ( // OrphanStatusTTL bounds a status reported before core recorded its entity, on every backend. OrphanStatusTTL = int64(time.Hour / time.Second) PodInfoKey = "/pod/info/%s" ServiceStatusKey = "/services/%s" NodeInfoKey = "/node/%s" NodePodKey = "/node/%s:pod/%s" NodeStatusPrefix = "/status:node/" NodeWorkloadsKey = "/node/%s:workloads/%s" WorkloadInfoKey = "/workloads/%s" WorkloadDeployPrefix = "/deploy" WorkloadStatusPrefix = "/status" WorkloadProcessingPrefix = "/processing" )
Variables ¶
This section is empty.
Functions ¶
func ParseNodename ¶
func ProcessingKey ¶
func ProcessingKey(processing *types.Processing) string
Types ¶
type KV ¶
type KV interface {
GetOne(ctx context.Context, key string) (string, error)
GetMulti(ctx context.Context, keys []string) (map[string]string, error)
GetPrefix(ctx context.Context, prefix string, limit int64) (map[string]string, error)
ListPrefix(ctx context.Context, prefix string) ([]string, error)
NotFound(err error) bool
Create(ctx context.Context, data map[string]string) error
Update(ctx context.Context, data map[string]string) error
Put(ctx context.Context, data map[string]string) error
Delete(ctx context.Context, keys []string) error
CreateAndDecr(ctx context.Context, data map[string]string, decrKey string) error
BindStatus(ctx context.Context, entityKey, statusKey, statusValue string, ttl int64) error
// Watch registers the watch before it returns, so no event is lost between a read and the first iteration.
Watch(ctx context.Context, prefix string) iter.Seq[Event]
StartEphemeral(ctx context.Context, path string, heartbeat time.Duration) (<-chan struct{}, func(), error)
CreateLock(key string, ttl time.Duration) (lock.DistributedLock, error)
}
KV is the key-value surface both store backends provide.
type Store ¶
type Store struct {
KV
Config types.Config
Pool *ants.PoolWithFunc
}
Store is the backend-independent half of the eru metadata store.
func (*Store) AddWorkload ¶
func (*Store) CreateProcessing ¶
func (*Store) DeleteProcessing ¶
func (*Store) GetDeployStatus ¶
func (*Store) GetNodeStatus ¶
func (*Store) GetNodesByPod ¶
func (*Store) GetServiceStatus ¶ added in v0.1.1
func (*Store) GetWorkload ¶
func (*Store) GetWorkloads ¶
func (*Store) ListNodeWorkloads ¶
func (*Store) ListWorkloads ¶
func (*Store) MakeClient ¶
func (*Store) NodeStatusStream ¶
func (s *Store) NodeStatusStream(ctx context.Context) chan *types.NodeStatus
func (*Store) RegisterService ¶
func (*Store) RemoveWorkload ¶
func (*Store) ServiceStatusStream ¶
func (*Store) SetNodeStatus ¶
func (*Store) SetWorkloadStatus ¶
func (*Store) UpdateNodes ¶
func (*Store) UpdateWorkload ¶
func (*Store) WorkloadStatusStream ¶
Click to show internal directories.
Click to hide internal directories.