agent

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInCluster = errors.New("unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined")

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(options *Options) (*Agent, error)

func (*Agent) Close

func (agent *Agent) Close() error

func (*Agent) Run

func (agent *Agent) Run() error

func (*Agent) Start

func (agent *Agent) Start(ctx context.Context) error

func (*Agent) Wait

func (agent *Agent) Wait() error

type Config

type Config struct {
	// Protocol version
	Version string

	// Name of the agent
	Name string

	// Token used to authenticate with proxy server
	Token string

	// Kubernetes apiserver host
	KubernetesSvcHost string

	// KubeSphere apigateway host
	KubeSphereSvcHost string

	// agent certificates
	// CertData holds PEM-encoded bytes (typically read from a client certificate file).
	CertData []byte `json:",omitempty"`
	// KeyData holds PEM-encoded bytes (typically read from a client certificate key file).
	KeyData []byte `json:",omitempty"`
	// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
	CAData []byte `json:",omitempty"`

	// Server requires Bearer authentication. This client will not attempt to use
	// refresh tokens for an OAuth2 flow.
	BearerToken []byte `json:",omitempty"`
}

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

func (*Config) Unmarshal

func (c *Config) Unmarshal(b []byte) error

type Options

type Options struct {
	KeepAlive              time.Duration
	MaxRetryCount          int
	MaxRetryInterval       time.Duration
	KubernetesApiserverSvc string
	KubesphereApiserverSvc string
	Server                 string
	Name                   string
	Token                  string

	Kubeconfig string
}

Jump to

Keyboard shortcuts

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