agent

package
v0.0.0-...-e258396 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package agent represents the CLI UI for Ubuntu Pro agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App encapsulate commands and options of the daemon, which can be controlled by env variables and config files.

func New

func New(o ...option) *App

New registers commands and return a new App.

func (*App) PublicDir

func (a *App) PublicDir() (string, error)

PublicDir creates a directory to store public data in.

func (*App) Quit

func (a *App) Quit()

Quit gracefully shutdown the service.

func (App) RootCmd

func (a App) RootCmd() cobra.Command

RootCmd returns a copy of the root command for the app. Shouldn't be in general necessary apart when running generators.

func (*App) Run

func (a *App) Run() error

Run executes the command and associated process. It returns an error on syntax/usage error.

func (*App) SetArgs

func (a *App) SetArgs(args ...string)

SetArgs changes the root command args. Shouldn't be in general necessary apart for tests.

func (App) UsageError

func (a App) UsageError() bool

UsageError returns if the error is a command parsing or runtime one.

func (*App) WaitReady

func (a *App) WaitReady()

WaitReady signals when the daemon is ready Note: we need to use a pointer to not copy the App object before the daemon is ready, and thus, creates a data race.

Jump to

Keyboard shortcuts

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