feat: complete MVP epics E7-E10 (provisioning, console proxy, audit, frontend)
This commit is contained in:
@@ -12,11 +12,16 @@ import (
|
||||
type Repository interface {
|
||||
ListProjectVMs(ctx context.Context, profileID string, projectID string) ([]VM, bool, error)
|
||||
GetVM(ctx context.Context, profileID string, vmID string) (VM, bool, error)
|
||||
GetProjectInfo(ctx context.Context, profileID string, projectID string) (ProjectInfo, bool, error)
|
||||
CheckQuota(ctx context.Context, projectID string) (QuotaInfo, error)
|
||||
ReserveNextVMID(ctx context.Context, clusterID string) (int, error)
|
||||
InsertVM(ctx context.Context, vm InsertVMRecord) (VM, error)
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
repository Repository
|
||||
power PowerDependencies
|
||||
provision ProvisionDependencies
|
||||
}
|
||||
|
||||
type Option func(*Handler)
|
||||
@@ -27,6 +32,12 @@ func WithPower(dependencies PowerDependencies) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithProvision(dependencies ProvisionDependencies) Option {
|
||||
return func(h *Handler) {
|
||||
h.provision = dependencies
|
||||
}
|
||||
}
|
||||
|
||||
func NewHandler(repository Repository, opts ...Option) Handler {
|
||||
handler := Handler{repository: repository}
|
||||
for _, opt := range opts {
|
||||
|
||||
Reference in New Issue
Block a user