cmd

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd has the commands which sign in to a server, in a browser, with OAuth, and keep the token, which the other commands send, with ClientEndpoint, and sign out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientEndpoint added in v0.0.15

func ClientEndpoint(ctx server.Cmd) (string, []client.ClientOpt, error)

ClientEndpoint returns the endpoint of the command's HTTP flags, and its client options, as the command's ClientEndpoint does, with the token which signing in kept for the endpoint, when it hasn't expired

func TokenOpts added in v0.0.15

func TokenOpts(ctx server.Cmd, endpoint string) []client.ClientOpt

TokenOpts returns the client option of the token which signing in kept for the endpoint, or none, when there isn't one, or it's expired

Types

type AuthCommands

type AuthCommands struct {
	Login   LoginCmd   `` /* 127-byte string literal not displayed */
	Session SessionCmd `cmd:"" name:"session" help:"Show who's signed in, with the kept token." group:"AUTH"`
	Logout  LogoutCmd  `cmd:"" name:"logout" help:"Sign out, ending the session, and forget the token." group:"AUTH"`
}

AuthCommands sign in to the server, show the session, and sign out

type LoginCmd added in v0.0.15

type LoginCmd struct {
	Scopes    []string      `name:"scope" help:"Scopes to ask for. Without them, they're all the session's. Can be specified more than once."`
	NoBrowser bool          `name:"no-browser" help:"Print the URL to sign in at, rather than opening it in a browser."`
	Timeout   time.Duration `name:"wait" default:"5m" help:"How long to wait for signing in."`
}

func (*LoginCmd) Run added in v0.0.15

func (cmd *LoginCmd) Run(ctx server.Cmd) (err error)

Run signs in: the server is discovered, the command registers, with a loopback callback, and is authorized, in a browser, and the token is kept

type LogoutCmd added in v0.0.15

type LogoutCmd struct{}

func (*LogoutCmd) Run added in v0.0.15

func (cmd *LogoutCmd) Run(ctx server.Cmd) (err error)

Run ends the session of the kept token, and forgets it, which it does when the session has already ended

type SessionCmd added in v0.0.15

type SessionCmd struct{}

func (*SessionCmd) Run added in v0.0.15

func (cmd *SessionCmd) Run(ctx server.Cmd) (err error)

Run shows the session of the kept token

Jump to

Keyboard shortcuts

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