Documentation
¶
Index ¶
- func WithProxy(config *TestProviderConfig)
- type Client
- func (c *Client) Clean()
- func (c *Client) Create(ctx context.Context, node *proto.Node) (string, error)
- func (c *Client) Exec(ctx context.Context, id string, execCmd []string) error
- func (c *Client) GetIP(id string) string
- func (c *Client) PullImage(ctx context.Context, image string) error
- func (c *Client) Remove(id string) error
- type Provider
- func (p *Provider) Apply(t *TestTask) string
- func (p *Provider) CreateResource(node *proto.Node) (*proto.Node, error)
- func (p *Provider) DeleteResource(node *proto.Node) (*proto.Node, error)
- func (p *Provider) Exec(handler string, path string, args ...string) error
- func (p *Provider) FinalizeTask(uuid string) error
- func (p *Provider) GetTask() (*proto.Task, error)
- func (p *Provider) GetTaskByID(id string) *proto.Task
- func (p *Provider) LoadCluster(id string) (*proto.Cluster, error)
- func (p *Provider) Remove(node *proto.Node)
- func (p *Provider) Resource() schema.Schema
- func (p *Provider) Setup() error
- func (p *Provider) Start() error
- func (p *Provider) Stop()
- func (p *Provider) UpdateNodeStatus(node *proto.Node) (*proto.Node, error)
- func (p *Provider) WaitForTask(id string)
- type TestProviderCallback
- type TestProviderConfig
- type TestTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithProxy ¶
func WithProxy(config *TestProviderConfig)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a sugarcoat version of the docker client
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is a mock provider for the swarm
func NewTestProvider ¶
func NewTestProvider(t *testing.T, backend string, callback TestProviderCallback) (*Provider, func())
func (*Provider) Apply ¶
Apply applies a change. If the resource does not exists its a Create op if the resource exists its an Update op
func (*Provider) CreateResource ¶
func (*Provider) DeleteResource ¶
func (*Provider) FinalizeTask ¶
func (*Provider) UpdateNodeStatus ¶
func (*Provider) WaitForTask ¶
WaitForTask waits for a task to finish
type TestProviderCallback ¶
type TestProviderCallback func(config *TestProviderConfig)
type TestProviderConfig ¶
type TestProviderConfig struct {
Proxy bool
}
Click to show internal directories.
Click to hide internal directories.