Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
Middleware describes a service middleware.
func NewInstrumentingService ¶
func NewInstrumentingService(duration metrics.Histogram) Middleware
NewInstrumentingService returns a new instance of an instrumented Service. It used for business-domain instrumenting.
func NewLoggingService ¶
func NewLoggingService(logger log.Logger) Middleware
NewLoggingService returns a new instance of a logging Service. It used for business-domain logging.
type Service ¶
type Service interface { GetConfig() *config.Config // Info returns some info about the Service Info() (string, string) // Healthz is a liveness probe Healthz() bool // Readyz is a readyness probe Readyz() bool // VMList returns list of VMs VMList(context.Context, *types.VMListParams) (map[string]string, error) // VMInfo provide summary information about VM VMInfo(context.Context, *types.VMInfoParams) (*types.VMSummary, error) // VMDelete destroys a Virtual Machine VMDelete(context.Context, *types.VMDeleteParams) error // VMFind find VM by path and return its UUID VMFind(context.Context, *types.VMFindParams) (*types.VMFound, error) // VMDeploy create VM from OVA file VMDeploy(context.Context, *types.VMDeployParams) (string, error) // VMSnapshotsList returns VM snapshots list VMSnapshotsList(context.Context, *types.VMSnapshotsListParams) ([]types.Snapshot, error) // VMSnapshotCreate creates a VM snapshot VMSnapshotCreate(context.Context, *types.SnapshotCreateParams) (int32, error) // VMRestoreFromSnapshot creates a VM snapshot VMRestoreFromSnapshot(context.Context, *types.VMRestoreFromSnapshotParams) error // VMSnapshotDelete deletes snapshot VMSnapshotDelete(context.Context, *types.VMSnapshotDeleteParams) error VMRolesList(context.Context, *types.VMRolesListParams) ([]types.Role, error) VMAddRole(context.Context, *types.VMAddRoleParams) error RoleList(context.Context) ([]types.Role, error) TaskInfo(context.Context, string) (map[string]interface{}, error) // Reads Open API spec file OpenAPI(context.Context) ([]byte, error) }
Service is the interface that represents methods of the business logic
type Statuser ¶
type Statuser interface { NewTask() TaskStatuser FindByID(id string) TaskStatuser }
Statuser represents behavior of storage that keeps statuses nolint: misspell
type TaskStatuser ¶ added in v0.5.0
type TaskStatuser interface { ID() string Str(keyvals ...string) TaskStatuser StrArr(key string, arr []string) TaskStatuser Get() (statuses map[string]interface{}) }
TaskStatuser represents behavior of every single task
Click to show internal directories.
Click to hide internal directories.