Documentation
¶
Index ¶
- func FilterMessages(resp interface{}, err error) (interface{}, error)
- func ReadStream(stream MachineStream) (io.ReadCloser, <-chan error, error)
- func WithNodes(ctx context.Context, nodes ...string) context.Context
- type Client
- func (c *Client) Close() error
- func (c *Client) Containers(ctx context.Context, namespace string, driver common.ContainerDriver, ...) (resp *osapi.ContainersResponse, err error)
- func (c *Client) Copy(ctx context.Context, rootPath string) (io.ReadCloser, <-chan error, error)
- func (c *Client) Dmesg(ctx context.Context, follow, tail bool) (osapi.OSService_DmesgClient, error)
- func (c *Client) Interfaces(ctx context.Context, callOptions ...grpc.CallOption) (resp *networkapi.InterfacesResponse, err error)
- func (c *Client) Kubeconfig(ctx context.Context) ([]byte, error)
- func (c *Client) KubeconfigRaw(ctx context.Context) (io.ReadCloser, <-chan error, error)
- func (c *Client) LS(ctx context.Context, req machineapi.ListRequest) (stream machineapi.MachineService_ListClient, err error)
- func (c *Client) Logs(ctx context.Context, namespace string, driver common.ContainerDriver, ...) (stream machineapi.MachineService_LogsClient, err error)
- func (c *Client) Memory(ctx context.Context, callOptions ...grpc.CallOption) (resp *osapi.MemoryResponse, err error)
- func (c *Client) Mounts(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.MountsResponse, err error)
- func (c *Client) Processes(ctx context.Context, callOptions ...grpc.CallOption) (resp *osapi.ProcessesResponse, err error)
- func (c *Client) Read(ctx context.Context, path string) (io.ReadCloser, <-chan error, error)
- func (c *Client) Reboot(ctx context.Context) (err error)
- func (c *Client) Reset(ctx context.Context, graceful, reboot bool) (err error)
- func (c *Client) Restart(ctx context.Context, namespace string, driver common.ContainerDriver, ...) (err error)
- func (c *Client) Routes(ctx context.Context, callOptions ...grpc.CallOption) (resp *networkapi.RoutesResponse, err error)
- func (c *Client) ServiceInfo(ctx context.Context, id string, callOptions ...grpc.CallOption) (services []ServiceInfo, err error)
- func (c *Client) ServiceList(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.ServiceListResponse, err error)
- func (c *Client) ServiceRestart(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceRestartResponse, err error)
- func (c *Client) ServiceStart(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceStartResponse, err error)
- func (c *Client) ServiceStop(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceStopResponse, err error)
- func (c *Client) Shutdown(ctx context.Context) (err error)
- func (c *Client) Stats(ctx context.Context, namespace string, driver common.ContainerDriver, ...) (resp *osapi.StatsResponse, err error)
- func (c *Client) Time(ctx context.Context, callOptions ...grpc.CallOption) (resp *timeapi.TimeResponse, err error)
- func (c *Client) TimeCheck(ctx context.Context, server string, callOptions ...grpc.CallOption) (resp *timeapi.TimeResponse, err error)
- func (c *Client) Upgrade(ctx context.Context, image string, preserve bool, ...) (resp *machineapi.UpgradeResponse, err error)
- func (c *Client) Version(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.VersionResponse, err error)
- type Credentials
- type MachineStream
- type NodeError
- type ServiceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterMessages ¶
FilterMessages removes error Messagess from resp and builds multierror.
nolint: gocyclo
func ReadStream ¶
func ReadStream(stream MachineStream) (io.ReadCloser, <-chan error, error)
ReadStream converts grpc stream into io.Reader.
Types ¶
type Client ¶
type Client struct { MachineClient machineapi.MachineServiceClient TimeClient timeapi.TimeServiceClient NetworkClient networkapi.NetworkServiceClient // contains filtered or unexported fields }
Client implements the proto.OSClient interface. It serves as the concrete type with the required methods.
func NewClient ¶
func NewClient(cfg *tls.Config, endpoints []string, port int, opts ...grpc.DialOption) (c *Client, err error)
NewClient initializes a Client.
func (*Client) Containers ¶
func (c *Client) Containers(ctx context.Context, namespace string, driver common.ContainerDriver, callOptions ...grpc.CallOption) (resp *osapi.ContainersResponse, err error)
Containers implements the proto.OSClient interface.
func (*Client) Interfaces ¶
func (c *Client) Interfaces(ctx context.Context, callOptions ...grpc.CallOption) (resp *networkapi.InterfacesResponse, err error)
Interfaces implements the proto.OSClient interface.
func (*Client) Kubeconfig ¶
Kubeconfig returns K8s client config (kubeconfig).
func (*Client) KubeconfigRaw ¶
KubeconfigRaw returns K8s client config (kubeconfig).
func (*Client) LS ¶
func (c *Client) LS(ctx context.Context, req machineapi.ListRequest) (stream machineapi.MachineService_ListClient, err error)
LS implements the proto.OSClient interface.
func (*Client) Logs ¶
func (c *Client) Logs(ctx context.Context, namespace string, driver common.ContainerDriver, id string, follow bool, tailLines int32) (stream machineapi.MachineService_LogsClient, err error)
Logs implements the proto.OSClient interface.
func (*Client) Memory ¶
func (c *Client) Memory(ctx context.Context, callOptions ...grpc.CallOption) (resp *osapi.MemoryResponse, err error)
Memory implements the proto.OSClient interface.
func (*Client) Mounts ¶
func (c *Client) Mounts(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.MountsResponse, err error)
Mounts implements the proto.OSClient interface.
func (*Client) Processes ¶
func (c *Client) Processes(ctx context.Context, callOptions ...grpc.CallOption) (resp *osapi.ProcessesResponse, err error)
Processes implements the proto.OSClient interface.
func (*Client) Restart ¶
func (c *Client) Restart(ctx context.Context, namespace string, driver common.ContainerDriver, id string, callOptions ...grpc.CallOption) (err error)
Restart implements the proto.OSClient interface.
func (*Client) Routes ¶
func (c *Client) Routes(ctx context.Context, callOptions ...grpc.CallOption) (resp *networkapi.RoutesResponse, err error)
Routes implements the networkdproto.NetworkClient interface.
func (*Client) ServiceInfo ¶
func (c *Client) ServiceInfo(ctx context.Context, id string, callOptions ...grpc.CallOption) (services []ServiceInfo, err error)
ServiceInfo returns info about a single service
This is implemented via service list API, as we don't have many services If service with given id is not registered, function returns nil
func (*Client) ServiceList ¶
func (c *Client) ServiceList(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.ServiceListResponse, err error)
ServiceList returns list of services with their state
func (*Client) ServiceRestart ¶
func (c *Client) ServiceRestart(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceRestartResponse, err error)
ServiceRestart restarts a service.
func (*Client) ServiceStart ¶
func (c *Client) ServiceStart(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceStartResponse, err error)
ServiceStart starts a service.
func (*Client) ServiceStop ¶
func (c *Client) ServiceStop(ctx context.Context, id string, callOptions ...grpc.CallOption) (resp *machineapi.ServiceStopResponse, err error)
ServiceStop stops a service.
func (*Client) Stats ¶
func (c *Client) Stats(ctx context.Context, namespace string, driver common.ContainerDriver, callOptions ...grpc.CallOption) (resp *osapi.StatsResponse, err error)
Stats implements the proto.OSClient interface.
func (*Client) Time ¶
func (c *Client) Time(ctx context.Context, callOptions ...grpc.CallOption) (resp *timeapi.TimeResponse, err error)
Time returns the time
func (*Client) TimeCheck ¶
func (c *Client) TimeCheck(ctx context.Context, server string, callOptions ...grpc.CallOption) (resp *timeapi.TimeResponse, err error)
TimeCheck returns the time compared to the specified ntp server
func (*Client) Upgrade ¶
func (c *Client) Upgrade(ctx context.Context, image string, preserve bool, callOptions ...grpc.CallOption) (resp *machineapi.UpgradeResponse, err error)
Upgrade initiates a Talos upgrade ... and implements the proto.OSClient interface
func (*Client) Version ¶
func (c *Client) Version(ctx context.Context, callOptions ...grpc.CallOption) (resp *machineapi.VersionResponse, err error)
Version implements the proto.OSClient interface.
type Credentials ¶
type Credentials struct { CA []byte Crt tls.Certificate }
Credentials represents the set of values required to initialize a valid Client.
func NewClientContextAndCredentialsFromConfig ¶
func NewClientContextAndCredentialsFromConfig(p string, ctx string) (context *config.Context, creds *Credentials, err error)
NewClientContextAndCredentialsFromConfig initializes Credentials from config file.
func NewClientContextAndCredentialsFromParsedConfig ¶
func NewClientContextAndCredentialsFromParsedConfig(c *config.Config, ctx string) (context *config.Context, creds *Credentials, err error)
NewClientContextAndCredentialsFromParsedConfig initializes Credentials from parsed configuration.
type MachineStream ¶
type MachineStream interface { Recv() (*common.Data, error) grpc.ClientStream }
MachineStream is a common interface for streams returned by streaming APIs.
type ServiceInfo ¶
type ServiceInfo struct { Metadata *common.Metadata Service *machineapi.ServiceInfo }
ServiceInfo provides info about a service and node metadata