cmd

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetData

func GetData(r io.ReadCloser, v interface{}) error

func GetJson

func GetJson(r io.ReadCloser) (string, error)

func NewClientError

func NewClientError(err error, detail string) error

func NewRequest

func NewRequest(opts ...RequestOption) (*http.Request, error)

func PrintData

func PrintData(p Printer, r io.ReadCloser) error

Types

type AppUser

type AppUser struct {
	Application string `json:"application"`
	Username    string `json:"username"`
	Password    string `json:"password"`
}

type ClientError

type ClientError struct {
	Cause   error
	Details string
}

func (*ClientError) Error

func (c *ClientError) Error() string

type MasterPass

type MasterPass struct {
	Password string `json:"master_password"`
}

type Printer

type Printer interface {
	String() string
}

type RequestOption

type RequestOption func(*http.Request) (*http.Request, error)

func SetBody

func SetBody(body io.Reader) RequestOption

func SetCredentials

func SetCredentials(user, pass string) RequestOption

func SetMethod

func SetMethod(method string) RequestOption

func SetQuery

func SetQuery(query map[string]string) RequestOption

func SetURL

func SetURL(URL string) RequestOption

Jump to

Keyboard shortcuts

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