agent

package
v0.0.0-...-1aed651 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config) error

func StartAPIServer

func StartAPIServer(ctx context.Context) error

StartAPIServer TODO APIServer(轻量化 k8s APIServer),供节点直接调用,获取本地存储中的资源,增/改/删 操作需要透传至云端

func SyncData

func SyncData(
	ctx context.Context,
	cfg *Config,
	ins dsync.Interface,
	healthIns health.Interface,
) error

Types

type Client

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

func NewClient

func NewClient(host, nodeName string) *Client

func (*Client) Data

func (c *Client) Data(ctx context.Context, manifest *suid.AssembleManifest, fn func(msg *sse.Message) error) error

func (*Client) Manifest

func (c *Client) Manifest(ctx context.Context, state suid.UID) (*suid.AssembleManifest, error)

type Config

type Config struct {
	Logger  logr.Config  `json:"logger,omitempty"`
	Agent   ConfigAgent  `json:"agent,omitempty"`
	Server  ConfigServer `json:"server"`
	Storage Storage      `json:"storage,omitempty"`
}

func Environ

func Environ(envPrefix string) *Config

func (*Config) Complete

func (c *Config) Complete()

func (*Config) Validate

func (c *Config) Validate() error

type ConfigAgent

type ConfigAgent struct {
	Name string `json:"name"`
}

type ConfigServer

type ConfigServer struct {
	Host string `json:"host" yaml:"host"`
}

type Storage

type Storage struct {
	Badger *badgerstorage.Config `json:"badger"`
}

Jump to

Keyboard shortcuts

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