api

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &charm.Spec{
	Name:  "api",
	Usage: "api [options] sub-command",
	Short: "perform lake actions on Zed service",
	Long: `
The "api" command provides client access to a Zed lake service running
at the URL provided in the "-lake" option.  This option defaults to
http://localhost:9867 so you can conveniently connect to a lake service
running locally on the default port, like the one launched by the Brim
application.

You can also set the environment variable ZED_LAKE to override the default
"-lake" option.

All of the relevant "lake" commands are available through the "api" command.
Refer to the help of the individual sub-commands for more details.`,
	New: New,
}

Functions

func New

func New(parent charm.Command, f *flag.FlagSet) (charm.Command, error)

Types

type Command

type Command struct {
	*root.Command
	Host string
	// contains filtered or unexported fields
}

func (*Command) Connection added in v0.33.0

func (c *Command) Connection() (*client.Connection, error)

func (*Command) LoadCredentials added in v0.33.0

func (c *Command) LoadCredentials() (*Credentials, error)

func (*Command) Open

func (c *Command) Open(ctx context.Context) (api.Interface, error)

func (*Command) Root

func (c *Command) Root() *root.Command

func (*Command) SaveCredentials added in v0.33.0

func (c *Command) SaveCredentials(creds *Credentials) error

type Credentials added in v0.33.0

type Credentials struct {
	Version  int           `json:"version"`
	Services []ServiceInfo `json:"services"`
}

func (*Credentials) AddTokens added in v0.33.0

func (c *Credentials) AddTokens(url string, tokens ServiceTokens)

func (*Credentials) RemoveTokens added in v0.33.0

func (c *Credentials) RemoveTokens(url string)

func (*Credentials) ServiceTokens added in v0.33.0

func (c *Credentials) ServiceTokens(url string) (ServiceTokens, bool)

type ServiceInfo added in v0.33.0

type ServiceInfo struct {
	URL    string        `json:"url"`
	Tokens ServiceTokens `json:"tokens"`
}

type ServiceTokens added in v0.33.0

type ServiceTokens struct {
	Access  string `json:"access"`
	ID      string `json:"id"`
	Refresh string `json:"refresh"`
}

Jump to

Keyboard shortcuts

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