Documentation ¶
Index ¶
- Variables
- func AttachEndpoint() string
- func ExecEndpoint() string
- func PortForwardEndpoint() string
- func StreamLogsEndpoint(unitName string, withMetadata bool) string
- type ItzoClient
- func (c *ItzoClient) Deploy(pod, name string, data io.Reader) error
- func (c *ItzoClient) GetFile(path string, lines, bytes int) ([]byte, error)
- func (c *ItzoClient) GetLogs(unit string, lines, bytes int) ([]byte, error)
- func (c *ItzoClient) GetStatus() (*api.PodStatusReply, error)
- func (c *ItzoClient) Healthcheck() error
- func (c *ItzoClient) ResizeVolume() error
- func (c *ItzoClient) RunCmd(cmdParams api.RunCmdParams) (string, error)
- func (c *ItzoClient) UpdateUnits(pp api.PodParameters) error
- type ItzoClientFactory
- type ItzoClientFactoryer
- type MockItzoClientFactory
- func (a *MockItzoClientFactory) DeleteClient(addy []api.NetworkAddress)
- func (a *MockItzoClientFactory) Deploy(pod, name string, data io.Reader) error
- func (a *MockItzoClientFactory) GetClient(addy []api.NetworkAddress) NodeClient
- func (a *MockItzoClientFactory) GetFile(unit string, lines, bytes int) ([]byte, error)
- func (a *MockItzoClientFactory) GetLogs(unit string, lines, bytes int) ([]byte, error)
- func (a *MockItzoClientFactory) GetStatus() (*api.PodStatusReply, error)
- func (a *MockItzoClientFactory) GetWSStream(addy []api.NetworkAddress, path string) (*wsstream.WSStream, error)
- func (a *MockItzoClientFactory) Healthcheck() error
- func (a *MockItzoClientFactory) ResizeVolume() error
- func (a *MockItzoClientFactory) RunCmd(cmdParams api.RunCmdParams) (string, error)
- func (a *MockItzoClientFactory) UpdateUnits(pp api.PodParameters) error
- type NodeClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SAVE_LOG_BYTES = 4096 MULTIPART_PKG_FIELD_NAME = "package" ItzoPort = 6421 ServerName = "MilpaNode" )
Functions ¶
func AttachEndpoint ¶
func AttachEndpoint() string
func ExecEndpoint ¶
func ExecEndpoint() string
func PortForwardEndpoint ¶
func PortForwardEndpoint() string
func StreamLogsEndpoint ¶
Types ¶
type ItzoClient ¶
type ItzoClient struct {
// contains filtered or unexported fields
}
func NewItzoClient ¶
func NewItzoClient(instanceIp string, tlsConfig *tls.Config) *ItzoClient
func NewItzoWithClient ¶
func NewItzoWithClient(serverURL string, client *http.Client) *ItzoClient
Used in testing, not sure if this is kosher
func (*ItzoClient) GetFile ¶
func (c *ItzoClient) GetFile(path string, lines, bytes int) ([]byte, error)
func (*ItzoClient) GetLogs ¶
func (c *ItzoClient) GetLogs(unit string, lines, bytes int) ([]byte, error)
func (*ItzoClient) GetStatus ¶
func (c *ItzoClient) GetStatus() (*api.PodStatusReply, error)
func (*ItzoClient) Healthcheck ¶
func (c *ItzoClient) Healthcheck() error
func (*ItzoClient) ResizeVolume ¶
func (c *ItzoClient) ResizeVolume() error
func (*ItzoClient) RunCmd ¶
func (c *ItzoClient) RunCmd(cmdParams api.RunCmdParams) (string, error)
func (*ItzoClient) UpdateUnits ¶
func (c *ItzoClient) UpdateUnits(pp api.PodParameters) error
type ItzoClientFactory ¶
type ItzoClientFactory struct {
// contains filtered or unexported fields
}
func NewItzoFactory ¶
func NewItzoFactory(rootCert *x509.Certificate, cert tls.Certificate, defaultToPublicIP bool) *ItzoClientFactory
func (*ItzoClientFactory) DeleteClient ¶
func (fac *ItzoClientFactory) DeleteClient(addy []api.NetworkAddress)
func (*ItzoClientFactory) GetClient ¶
func (fac *ItzoClientFactory) GetClient(addy []api.NetworkAddress) NodeClient
func (*ItzoClientFactory) GetWSStream ¶
func (fac *ItzoClientFactory) GetWSStream(addy []api.NetworkAddress, path string) (*wsstream.WSStream, error)
type ItzoClientFactoryer ¶
type ItzoClientFactoryer interface { // We pass in the whole NetworkAddress here since we might want to // connect to either the public or private IP of the node/pod, // depending on whether we are inside the cloud network GetClient([]api.NetworkAddress) NodeClient GetWSStream([]api.NetworkAddress, string) (*wsstream.WSStream, error) DeleteClient([]api.NetworkAddress) }
type MockItzoClientFactory ¶
type MockItzoClientFactory struct { Health func() error Logs func(unit string, lines, bytes int) ([]byte, error) File func(unit string, lines, bytes int) ([]byte, error) Resize func() error Status func() (*api.PodStatusReply, error) Update func(pp api.PodParameters) error DeployPackage func(pod, name string, data io.Reader) error }
func NewMockItzoClientFactory ¶
func NewMockItzoClientFactory() *MockItzoClientFactory
func (*MockItzoClientFactory) DeleteClient ¶
func (a *MockItzoClientFactory) DeleteClient(addy []api.NetworkAddress)
screw it, make the factory implement the interface as well...
func (*MockItzoClientFactory) Deploy ¶
func (a *MockItzoClientFactory) Deploy(pod, name string, data io.Reader) error
func (*MockItzoClientFactory) GetClient ¶
func (a *MockItzoClientFactory) GetClient(addy []api.NetworkAddress) NodeClient
screw it, make the factory implement the interface as well...
func (*MockItzoClientFactory) GetFile ¶
func (a *MockItzoClientFactory) GetFile(unit string, lines, bytes int) ([]byte, error)
func (*MockItzoClientFactory) GetLogs ¶
func (a *MockItzoClientFactory) GetLogs(unit string, lines, bytes int) ([]byte, error)
func (*MockItzoClientFactory) GetStatus ¶
func (a *MockItzoClientFactory) GetStatus() (*api.PodStatusReply, error)
func (*MockItzoClientFactory) GetWSStream ¶
func (a *MockItzoClientFactory) GetWSStream(addy []api.NetworkAddress, path string) (*wsstream.WSStream, error)
func (*MockItzoClientFactory) Healthcheck ¶
func (a *MockItzoClientFactory) Healthcheck() error
func (*MockItzoClientFactory) ResizeVolume ¶
func (a *MockItzoClientFactory) ResizeVolume() error
func (*MockItzoClientFactory) RunCmd ¶
func (a *MockItzoClientFactory) RunCmd(cmdParams api.RunCmdParams) (string, error)
func (*MockItzoClientFactory) UpdateUnits ¶
func (a *MockItzoClientFactory) UpdateUnits(pp api.PodParameters) error
type NodeClient ¶
type NodeClient interface { Healthcheck() error GetLogs(unit string, lines, bytes int) ([]byte, error) GetFile(filepath string, lines, bytes int) ([]byte, error) ResizeVolume() error GetStatus() (*api.PodStatusReply, error) UpdateUnits(api.PodParameters) error Deploy(pod, name string, data io.Reader) error RunCmd(cmd api.RunCmdParams) (string, error) }
Click to show internal directories.
Click to hide internal directories.