mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 12:03:33 +00:00
chore: remove TODO about encapsulating Client in deploy operations
This commit is contained in:
@@ -10,8 +10,6 @@ import (
|
|||||||
// Operations can be composed to form complex deployment strategies.
|
// Operations can be composed to form complex deployment strategies.
|
||||||
type Operation interface {
|
type Operation interface {
|
||||||
// Execute performs the operation using the provided client.
|
// Execute performs the operation using the provided client.
|
||||||
// TODO: Encapsulate the client in the operation as otherwise it gives an impression that different clients
|
|
||||||
// can be provided. But in reality, the operation is tightly coupled with the client that was used to create it.
|
|
||||||
Execute(ctx context.Context, cli Client) error
|
Execute(ctx context.Context, cli Client) error
|
||||||
// Format returns a human-readable representation of the operation.
|
// Format returns a human-readable representation of the operation.
|
||||||
// TODO: get rid of the resolver and assign the required names for formatting in the operation itself.
|
// TODO: get rid of the resolver and assign the required names for formatting in the operation itself.
|
||||||
@@ -19,16 +17,14 @@ type Operation interface {
|
|||||||
String() string
|
String() string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NameResolver resolves machine and container IDs to their names.
|
|
||||||
type NameResolver interface {
|
|
||||||
MachineName(machineID string) string
|
|
||||||
ContainerName(containerID string) string
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: pass api.ServiceContainer to operations to simplify operation formatting in the plan.
|
|
||||||
|
|
||||||
// Client defines the interface required to execute deployment operations.
|
// Client defines the interface required to execute deployment operations.
|
||||||
type Client interface {
|
type Client interface {
|
||||||
api.ContainerClient
|
api.ContainerClient
|
||||||
api.VolumeClient
|
api.VolumeClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NameResolver resolves machine and container IDs to their names.
|
||||||
|
type NameResolver interface {
|
||||||
|
MachineName(machineID string) string
|
||||||
|
ContainerName(containerID string) string
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user