client

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DSConnectionStatusNotConnected = "DATASERVER_NOT_CONNECTED"

Variables

This section is empty.

Functions

func GetDataServerAddress added in v0.0.55

func GetDataServerAddress() string

func GetLocalDataServerAddress added in v0.0.55

func GetLocalDataServerAddress() string

func NewEphemeral added in v0.0.55

func NewEphemeral(
	ctx context.Context,
	cfg *Config,
) (sdcpb.DataServerClient, func() error, error)

NewEphemeral returns a short-lived client and a close function. Call closeFn() when you're done.

func OneShot added in v0.0.55

func OneShot(
	ctx context.Context,
	cfg *Config,
	fn func(ctx context.Context, c sdcpb.DataServerClient) error,
) error

OneShot runs a function with a short-lived DataServerClient. It dials, runs fn, and always closes the connection.

Types

type Client

type Client interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context)
	GetAddress() string
	IsConnectionReady() bool
	IsConnected() bool
	ConnState() connectivity.State
	WaitForStateChange(ctx context.Context, source connectivity.State) bool
	Connect()
	sdcpb.DataServerClient
}

Client is a long-lived DataServer client (for controllers, daemons, etc.).

func New

func New(cfg *Config) (Client, error)

func NewFakeClient

func NewFakeClient() Client

type Config

type Config struct {
	Address    string
	Username   string
	Password   string
	Proxy      bool
	NoTLS      bool
	TLSCA      string
	TLSCert    string
	TLSKey     string
	SkipVerify bool
	Insecure   bool
	MaxMsgSize int
}

Jump to

Keyboard shortcuts

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