client

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package client provides a client interface to interact with server APIs

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCurrentNotSet   = errors.New("current server is not set")
	ErrCurrentNotFound = errors.New("current server not found")
	ErrServerNotFound  = errors.New("server not found")
)
View Source
var DefaultTLSConfig = &tls.Config{
	InsecureSkipVerify: false,
}

Functions

This section is empty.

Types

type ClientSet

type ClientSet struct {
	NodeV1Client nodev1.ClientV1
	TaskV1Client taskv1.ClientV1
	// contains filtered or unexported fields
}

func New

func New(server string, opts ...NewClientOption) (*ClientSet, error)

func (*ClientSet) Close

func (c *ClientSet) Close() error

func (*ClientSet) Connect

func (c *ClientSet) Connect()

func (*ClientSet) ContainerSetV1

func (c *ClientSet) ContainerSetV1() *containersetv1.ClientV1

func (*ClientSet) EventV1

func (c *ClientSet) EventV1() *eventv1.ClientV1

func (*ClientSet) ID

func (c *ClientSet) ID() string

func (*ClientSet) LeaseV1 added in v0.0.12

func (c *ClientSet) LeaseV1() leasev1.ClientV1

func (*ClientSet) LogV1

func (c *ClientSet) LogV1() *logv1.ClientV1

func (*ClientSet) NodeV1

func (c *ClientSet) NodeV1() nodev1.ClientV1

func (*ClientSet) State

func (c *ClientSet) State() connectivity.State

func (*ClientSet) TaskV1 added in v0.0.11

func (c *ClientSet) TaskV1() taskv1.ClientV1

func (*ClientSet) VolumeV1

func (c *ClientSet) VolumeV1() volumev1.ClientV1

type Config

type Config struct {
	Version string    `mapstructure:"version" json:"version" yaml:"version"`
	Servers []*Server `mapstructure:"servers" json:"servers" yaml:"servers"`
	Current string    `mapstructure:"current" json:"current" yaml:"current"`
}

func (*Config) AddServer

func (c *Config) AddServer(srv *Server) error

func (*Config) CurrentServer

func (c *Config) CurrentServer() (*Server, error)

func (*Config) GetServer

func (c *Config) GetServer(name string) (*Server, error)

func (*Config) Validate

func (c *Config) Validate() error

type NewClientOption

type NewClientOption func(c *ClientSet) error

func WithClientID

func WithClientID(id string) NewClientOption

func WithGrpcDialOption

func WithGrpcDialOption(opts ...grpc.DialOption) NewClientOption

func WithLogger

func WithLogger(l logger.Logger) NewClientOption

func WithTLSConfig

func WithTLSConfig(t *tls.Config) NewClientOption

func WithTLSConfigFromCfg

func WithTLSConfigFromCfg(cfg *Config) NewClientOption

WithTLSConfigFromCfg returns a NewClientOption using the provided client.Config. It runs Validate() on the config before returning. If passed in client config doesn't have tls configuration, then tls config is not set on the client.

func WithTLSConfigFromFlags

func WithTLSConfigFromFlags(f *pflag.FlagSet) NewClientOption

type Server

type Server struct {
	Name      string     `mapstructure:"name" json:"name" yaml:"name"`
	Address   string     `mapstructure:"address" json:"address" yaml:"address"`
	TLSConfig *TLSConfig `mapstructure:"tls" json:"tls" yaml:"tls"`
}

func (*Server) Validate

func (s *Server) Validate() error

type TLSConfig

type TLSConfig struct {
	CA          string `mapstructure:"ca,omitempty" json:"ca,omitempty" yaml:"ca,omitempty"`
	Certificate string `mapstructure:"certificate,omitempty" json:"certificate,omitempty" yaml:"certificate,omitempty"`
	Key         string `mapstructure:"key,omitempty" json:"key,omitempty" yaml:"key,omitempty"`
	Insecure    bool   `mapstructure:"insecure,omitempty" json:"insecure,omitempty" yaml:"insecure,omitempty"`
}

func (*TLSConfig) Validate

func (t *TLSConfig) Validate() error

Directories

Path Synopsis
containerset
v1
event
v1
Package v1 provides a client for working with events
Package v1 provides a client for working with events
lease
v1
Package v1 is a generated GoMock package.
Package v1 is a generated GoMock package.
log
v1
Package log provides a client interface to interact with logs
Package log provides a client interface to interact with logs
node
v1
Package v1 is a generated GoMock package.
Package v1 is a generated GoMock package.
task
v1
Package v1 is a generated GoMock package.
Package v1 is a generated GoMock package.
volume
v1
Package v1 is a generated GoMock package.
Package v1 is a generated GoMock package.

Jump to

Keyboard shortcuts

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