Documentation ¶
Index ¶
- func SaveAccessToken(state, code, expectedState, env, controllerURL string, hosts map[string]string, ...) error
- type ClientInterface
- type ColumnPrinter
- type Config
- type DNSServer
- type ErrorPrinter
- type FileSystem
- type LogPrinter
- type Login
- type MockFS
- type MyStackHTTPClient
- type ObjPrinter
- type PortForwardPrinter
- type Printer
- type Proxy
- type RealFS
- type RoutePrinter
- type ServerControl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveAccessToken ¶
func SaveAccessToken( state, code, expectedState, env, controllerURL string, hosts map[string]string, fs FileSystem, client ClientInterface, ) error
SaveAccessToken get access token from authorization code and saves locally
Types ¶
type ClientInterface ¶ added in v1.2.0
type ClientInterface interface { Get(url, host string) ([]byte, int, error) GetToStdOut(url, host string) error Put(url string, body map[string]interface{}) ([]byte, int, error) Delete(url string) ([]byte, int, error) }
ClientInterface interface
type ColumnPrinter ¶
type ColumnPrinter struct { Title string Column []interface{} }
ColumnPrinter implements the Printer interface
type Config ¶
type Config struct { Token string `json:"token"` ControllerURL string `json:"controllerUrl"` ControllerHost string `json:"controllerHost"` LoggerHost string `json:"loggerHost"` Env string `json:"env"` }
Config struct
type DNSServer ¶
type DNSServer struct { Domains []string PointTo string RouterDomain string // contains filtered or unexported fields }
DNSServer struct
type ErrorPrinter ¶
ErrorPrinter implements the Printer interface
func NewErrorPrinter ¶
func NewErrorPrinter(body []byte, status int) *ErrorPrinter
NewErrorPrinter is the ErrorPrinter ctor
type FileSystem ¶ added in v1.2.0
type FileSystem interface { MkdirAll(path string, perm os.FileMode) error Create(name string) (afero.File, error) RemoveAll(path string) error IsNotExist(err error) bool Stat(name string) (os.FileInfo, error) }
FileSystem interface
type LogPrinter ¶
LogPrinter implements the Printer interface
func NewLogPrinter ¶
func NewLogPrinter(body []byte, title string) *LogPrinter
NewLogPrinter is the LogPrinter ctor
func NewStrLogPrinter ¶ added in v1.0.0
func NewStrLogPrinter(body string, title string) *LogPrinter
NewLogPrinter is the LogPrinter ctor
type MockFS ¶ added in v1.2.0
MockFS implements FileSystem interface
func (*MockFS) IsNotExist ¶ added in v1.2.0
IsNotExist returns true if err if of type FileNotExists
type MyStackHTTPClient ¶
type MyStackHTTPClient struct {
// contains filtered or unexported fields
}
MyStackHTTPClient struct
func NewMyStackHTTPClient ¶
func NewMyStackHTTPClient(config *Config) *MyStackHTTPClient
NewMyStackHTTPClient ctor
func (*MyStackHTTPClient) Delete ¶
func (c *MyStackHTTPClient) Delete(url string) ([]byte, int, error)
Delete does a put request
func (*MyStackHTTPClient) Get ¶
func (c *MyStackHTTPClient) Get(url, host string) ([]byte, int, error)
Get does a get request
func (*MyStackHTTPClient) GetToStdOut ¶ added in v1.0.0
func (c *MyStackHTTPClient) GetToStdOut(url, host string) error
GetToStdOut streams the content received from server to stdout
type ObjPrinter ¶
ObjPrinter implements the Printer interface
type PortForwardPrinter ¶ added in v1.1.0
type PortForwardPrinter struct {
// contains filtered or unexported fields
}
PortForwardPrinter implements the Printer interface It prints the port binded for each mystack service of a cluster
func NewPortForwarderPrinter ¶ added in v1.1.0
func NewPortForwarderPrinter() *PortForwardPrinter
NewPortForwarderPrinter returns a PortForwardPrinter
func (*PortForwardPrinter) AddApp ¶ added in v1.2.0
func (p *PortForwardPrinter) AddApp(app, host string)
Add a new port binded to a app
func (*PortForwardPrinter) AddSvc ¶ added in v1.2.0
func (p *PortForwardPrinter) AddSvc(service, host string)
Add a new port binded to a service
func (*PortForwardPrinter) Print ¶ added in v1.1.0
func (p *PortForwardPrinter) Print()
Print formats and prints the ports for each service
type Printer ¶
type Printer interface {
Print()
}
Printer is the printer interface Helps unifying printers that print in different ways
type Proxy ¶ added in v1.1.0
type Proxy struct {
// contains filtered or unexported fields
}
type RealFS ¶ added in v1.2.0
type RealFS struct{}
RealFS implements FileSystem interface
func (*RealFS) IsNotExist ¶ added in v1.2.0
IsNotExist returns true if err if of type FileNotExists
type RoutePrinter ¶
RoutePrinter implements the Printer interface
type ServerControl ¶
type ServerControl struct { CloseServer chan bool // contains filtered or unexported fields }
ServerControl starts a go routine to end the server after callback
func NewServerControl ¶
func NewServerControl(listener net.Listener) *ServerControl
NewServerControl is the ServerControl ctor