client

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultServerAddr = "localhost:50051"

DefaultServerAddr is the default address for the client to connect to.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the client application.

func New

func New(params NewParams) *App

New creates a new App instance.

func (*App) AddDestination added in v0.0.12

func (a *App) AddDestination(ctx context.Context, name, url string) (id string, err error)

AddDestination adds a new destination to the server.

func (*App) ListDestinations added in v0.0.12

func (a *App) ListDestinations(ctx context.Context) (_ []domain.Destination, err error)

ListDestinations retrieves the list of destinations from the server.

func (*App) RemoveDestination added in v0.0.12

func (a *App) RemoveDestination(ctx context.Context, destinationID string, force bool) error

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run starts the application, and blocks until it is closed.

It returns nil if the application was closed by the user, or an error if it closed for any other reason.

func (*App) StartDestination added in v0.0.12

func (a *App) StartDestination(ctx context.Context, destinationID string) error

func (*App) StopDestination added in v0.0.12

func (a *App) StopDestination(ctx context.Context, destinationID string) error

func (*App) UpdateDestination added in v0.0.12

func (a *App) UpdateDestination(ctx context.Context, destinationID string, name, url optional.V[string]) error

type NewParams

type NewParams struct {
	ClipboardAvailable bool
	ServerAddr         string
	InsecureSkipVerify bool
	APIToken           string
	BuildInfo          domain.BuildInfo
	Screen             *terminal.Screen
	Logger             *slog.Logger
}

NewParams contains the parameters for the App.

Jump to

Keyboard shortcuts

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