core

package
v0.0.0-...-b022d11 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, config *types.Config)

Init inits the core store only once

Types

type Store

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

Store use core to store meta

func Get

func Get() *Store

Get returns the core store instance

func New

func New(ctx context.Context, config *types.Config) (*Store, error)

New new a Store

func (*Store) GetClient

func (c *Store) GetClient() pb.CoreRPCClient

GetClient returns a gRPC client

func (*Store) GetIdentifier

func (c *Store) GetIdentifier(ctx context.Context) string

GetIdentifier returns the identifier of core

func (*Store) GetNode

func (c *Store) GetNode(ctx context.Context, nodename string) (*types.Node, error)

GetNode return a node by core

func (*Store) GetNodeStatus

func (c *Store) GetNodeStatus(ctx context.Context, nodename string) (*types.NodeStatus, error)

GetNodeStatus gets the status of node

func (*Store) ListPodNodes

func (c *Store) ListPodNodes(ctx context.Context, all bool, podname string, labels map[string]string) ([]*types.Node, error)

ListPodNodes list nodes by given conditions, note that not all the fields are filled.

func (*Store) NodeStatusStream

func (c *Store) NodeStatusStream(ctx context.Context) (<-chan *types.NodeStatus, <-chan error)

NodeStatusStream watches the changes of node status

func (*Store) SetNodeStatus

func (c *Store) SetNodeStatus(ctx context.Context, ttl int64) error

SetNodeStatus reports the status of node SetNodeStatus always reports alive status, when not alive, TTL will cause expiration of node

func (*Store) SetWorkloadStatus

func (c *Store) SetWorkloadStatus(ctx context.Context, status *types.WorkloadStatus, ttl int64) error

SetWorkloadStatus deploy containers

Jump to

Keyboard shortcuts

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