* enable CI check Signed-off-by: Minghe Huang <h.minghe@gmail.com> * lint * clean up lint issue * fix Makefile * uncomment * fix coverage * check infrastructure during up command (#411) * check infrastructure during up command Signed-off-by: Minghe Huang <h.minghe@gmail.com> * add unit test Signed-off-by: Minghe Huang <h.minghe@gmail.com>
32 lines
743 B
Go
32 lines
743 B
Go
package infra
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/metrue/fx/types"
|
|
)
|
|
|
|
// Clouder cloud interface
|
|
type Clouder interface {
|
|
Provision() error
|
|
GetConfig() (string, error)
|
|
GetType() string
|
|
Dump() ([]byte, error)
|
|
IsHealth() (bool, error)
|
|
}
|
|
|
|
// Deployer deploy interface
|
|
type Deployer interface {
|
|
Deploy(ctx context.Context, fn string, name string, image string, bindings []types.PortBinding) error
|
|
Destroy(ctx context.Context, name string) error
|
|
Update(ctx context.Context, name string) error
|
|
GetStatus(ctx context.Context, name string) (types.Service, error)
|
|
List(ctx context.Context, name string) ([]types.Service, error)
|
|
Ping(ctx context.Context) error
|
|
}
|
|
|
|
// Infra infrastructure provision interface
|
|
type Infra interface {
|
|
Deployer
|
|
}
|