commands

package
v2.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 21 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(command Command) error

func Export

func Export(serverName string) error

func GetAllServerIds

func GetAllServerIds() []string

func GetConfig

func GetConfig(serverId string, excludeRefreshableTokens bool) (*config.ServerDetails, error)

func Import

func Import(configTokenString string) error

func ShowConfig

func ShowConfig(serverName string) error

Types

type AuthenticationMethod added in v2.18.7

type AuthenticationMethod string
const (
	AccessToken AuthenticationMethod = "Access Token"
	BasicAuth   AuthenticationMethod = "Username and Password / API Key"
	MTLS        AuthenticationMethod = "Mutual TLS"
)

type Command

type Command interface {
	// Runs the command
	Run() error
	// Returns the Server details. The usage report is sent to this server.
	ServerDetails() (*config.ServerDetails, error)
	// The command name for the usage report.
	CommandName() string
}

type ConfigAction added in v2.16.0

type ConfigAction string
const (
	AddOrEdit ConfigAction = "AddOrEdit"
	Delete    ConfigAction = "Delete"
	Use       ConfigAction = "Use"
	Clear     ConfigAction = "Clear"
)

type ConfigCommand

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

func NewConfigCommand

func NewConfigCommand(cmdType ConfigAction, serverId string) *ConfigCommand

func (*ConfigCommand) CommandName

func (cc *ConfigCommand) CommandName() string

func (*ConfigCommand) Run

func (cc *ConfigCommand) Run() (err error)

func (*ConfigCommand) ServerDetails

func (cc *ConfigCommand) ServerDetails() (*config.ServerDetails, error)

func (*ConfigCommand) SetDefaultDetails

func (cc *ConfigCommand) SetDefaultDetails(defaultDetails *config.ServerDetails) *ConfigCommand

func (*ConfigCommand) SetDetails

func (cc *ConfigCommand) SetDetails(details *config.ServerDetails) *ConfigCommand

func (*ConfigCommand) SetEncPassword

func (cc *ConfigCommand) SetEncPassword(encPassword bool) *ConfigCommand

func (*ConfigCommand) SetInteractive

func (cc *ConfigCommand) SetInteractive(interactive bool) *ConfigCommand

func (*ConfigCommand) SetServerId

func (cc *ConfigCommand) SetServerId(serverId string) *ConfigCommand

func (*ConfigCommand) SetUseBasicAuthOnly

func (cc *ConfigCommand) SetUseBasicAuthOnly(useBasicAuthOnly bool) *ConfigCommand

type ConfigCommandConfiguration

type ConfigCommandConfiguration struct {
	ServerDetails *config.ServerDetails
	Interactive   bool
	EncPassword   bool
	BasicAuthOnly bool
}

type CurlCommand

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

func NewCurlCommand

func NewCurlCommand() *CurlCommand

func (*CurlCommand) GetCmd

func (curlCmd *CurlCommand) GetCmd() *exec.Cmd

func (*CurlCommand) GetEnv

func (curlCmd *CurlCommand) GetEnv() map[string]string

func (*CurlCommand) GetErrWriter

func (curlCmd *CurlCommand) GetErrWriter() io.WriteCloser

func (*CurlCommand) GetServerDetails

func (curlCmd *CurlCommand) GetServerDetails() (*config.ServerDetails, error)

Returns server details

func (*CurlCommand) GetStdWriter

func (curlCmd *CurlCommand) GetStdWriter() io.WriteCloser

func (*CurlCommand) Run

func (curlCmd *CurlCommand) Run() error

func (*CurlCommand) ServerDetails

func (curlCmd *CurlCommand) ServerDetails() (*config.ServerDetails, error)

func (*CurlCommand) SetArguments

func (curlCmd *CurlCommand) SetArguments(arguments []string) *CurlCommand

func (*CurlCommand) SetExecutablePath

func (curlCmd *CurlCommand) SetExecutablePath(executablePath string) *CurlCommand

func (*CurlCommand) SetServerDetails

func (curlCmd *CurlCommand) SetServerDetails(serverDetails *config.ServerDetails) *CurlCommand

func (*CurlCommand) SetUrl

func (curlCmd *CurlCommand) SetUrl(url string) *CurlCommand

Jump to

Keyboard shortcuts

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