agent

package
v1.23.11 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIDSecret           = "kubegems-edge-agent-id"
	DefaultKeepAliveInterval = 30 * time.Minute
)

Variables

This section is empty.

Functions

func DetectExternalIP added in v1.23.8

func DetectExternalIP() string

func ParseJSONFile

func ParseJSONFile(content []byte) (map[string]string, error)

func ParseKV

func ParseKV(file string) (map[string]string, error)

func ParseKVFile

func ParseKVFile(content []byte) (map[string]string, error)

ParseKVFile parse kv from FOO="bar" likes file

func ParseToMaps

func ParseToMaps(list []string) map[string]string

func ReadManufacture

func ReadManufacture(options *Options, clientID string) (map[string]string, error)

func Run

func Run(ctx context.Context, options *Options) error

Types

type AgentAPI

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

func (*AgentAPI) Run

func (a *AgentAPI) Run(ctx context.Context, listen string) error

type ClientTLS added in v1.23.8

type ClientTLS struct {
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

type EdgeAgent

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

func (*EdgeAgent) RunKeepAliveRouter

func (ea *EdgeAgent) RunKeepAliveRouter(ctx context.Context, duration time.Duration, annotationsfunc func(ctx context.Context) tunnel.Annotations) error

type Options added in v1.23.8

type Options struct {
	Listen            string        `json:"listen,omitempty"`
	DeviceID          string        `json:"deviceID,omitempty" description:"device id in kubegems edge,use random generated client-id by default"`
	DeviceIDKey       string        `json:"deviceIDKey,omitempty" description:"use value of key as device-id in manufacture"`
	ManufactureFile   []string      `json:"manufactureFile,omitempty" description:"file with manufacture info in json object format"`
	ManufactureRemap  []string      `json:"manufactureRemap,omitempty" description:"remap manufacture file key to newkey,example 'newkey=existskey'"`
	Manufacture       []string      `json:"manufacture,omitempty" description:"manufacture kvs,example 'some-key=value,foo=bar'"`
	EdgeHubAddr       string        `json:"edgeHubAddr,omitempty"`
	KeepAliveInterval time.Duration `json:"keepAliveInterval,omitempty"`
	TLS               *ClientTLS    `json:"tls,omitempty" description:"skip server tls verify"`
}

func NewDefaultOptions added in v1.23.8

func NewDefaultOptions() *Options

Jump to

Keyboard shortcuts

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