Documentation
¶
Overview ¶
internal/cli/cli.go
internal/cli/client.go
internal/cli/commands.go
internal/cli/daemon_bootstrap.go
internal/cli/output.go
Index ¶
- Constants
- Variables
- func Run(argv []string, stdout, stderr io.Writer) int
- type Client
- func (c *Client) Info(ctx context.Context, arg string) (admin.InfoPayload, error)
- func (c *Client) List(ctx context.Context) (admin.ListResponse, error)
- func (c *Client) Reshare(ctx context.Context, id string) (admin.SharePayload, error)
- func (c *Client) Revoke(ctx context.Context, id string) error
- func (c *Client) Share(ctx context.Context, req admin.ShareRequest) (admin.SharePayload, error)
- func (c *Client) Status(ctx context.Context) (admin.StatusResponse, error)
- func (c *Client) Stop(ctx context.Context) error
- type Format
Constants ¶
View Source
const ( ExitOK = 0 ExitGeneric = 1 ExitUsage = 2 ExitConfig = 3 ExitDaemon = 4 ExitNotFound = 5 ExitSourceBad = 6 )
Exit codes, documented in README.
Variables ¶
View Source
var ErrUnreachable = errors.New("daemon unreachable")
ErrUnreachable is returned when the daemon is not running.
Functions ¶
Types ¶
type Client ¶
Client talks to the local daemon's admin API.
func EnsureDaemon ¶
EnsureDaemon makes sure the daemon is running and returns an admin client wired to it. If the daemon is not running, spawns it (forwarding cfgPath via --config so the child loads the same config as the CLI) and waits up to 2 seconds for readiness.
func (*Client) Share ¶
func (c *Client) Share(ctx context.Context, req admin.ShareRequest) (admin.SharePayload, error)
Click to show internal directories.
Click to hide internal directories.