service

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupManager

type BackupManager interface {
	Backup(ctx context.Context, backup *resource.Backup, resources []*resource.Resource) (*resource.BackupResult, error)
}

type BackupRepository

type BackupRepository interface {
	GetByID(ctx context.Context, id resource.BackupID) (*resource.Backup, error)
	GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Backup, error)
	Create(ctx context.Context, backup *resource.Backup) error
}

type BackupService

type BackupService struct {
	// contains filtered or unexported fields
}

func NewBackupService

func NewBackupService(repo BackupRepository, resources ResourceProvider, manager BackupManager) *BackupService

func (BackupService) Create

func (BackupService) Get

func (BackupService) List

func (s BackupService) List(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Backup, error)

type ResourceManager

type ResourceManager interface {
	CreateResource(ctx context.Context, res *resource.Resource) error
	UpdateResource(ctx context.Context, res *resource.Resource) error
	BatchUpdate(ctx context.Context, store resource.Store, resources []*resource.Resource) error
	Validate(res *resource.Resource) error
	GetURN(res *resource.Resource) (string, error)
}

type ResourceMgr

type ResourceMgr struct {
	// contains filtered or unexported fields
}

func NewResourceManager

func NewResourceManager(repo ResourceStatusRepo, logger log.Logger) *ResourceMgr

func (*ResourceMgr) Backup

func (m *ResourceMgr) Backup(ctx context.Context, details *resource.Backup, resources []*resource.Resource) (*resource.BackupResult, error)

func (*ResourceMgr) BatchUpdate

func (m *ResourceMgr) BatchUpdate(ctx context.Context, store resource.Store, resources []*resource.Resource) error

func (*ResourceMgr) CreateResource

func (m *ResourceMgr) CreateResource(ctx context.Context, res *resource.Resource) error

func (*ResourceMgr) GetURN

func (m *ResourceMgr) GetURN(res *resource.Resource) (string, error)

func (*ResourceMgr) RegisterDatastore

func (m *ResourceMgr) RegisterDatastore(store resource.Store, dataStore DataStore)

func (*ResourceMgr) UpdateResource

func (m *ResourceMgr) UpdateResource(ctx context.Context, res *resource.Resource) error

func (*ResourceMgr) Validate

func (m *ResourceMgr) Validate(res *resource.Resource) error

type ResourceProvider

type ResourceProvider interface {
	GetResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) ([]*resource.Resource, error)
}

type ResourceRepository

type ResourceRepository interface {
	Create(ctx context.Context, res *resource.Resource) error
	Update(ctx context.Context, res *resource.Resource) error
	ReadByFullName(ctx context.Context, tnnt tenant.Tenant, store resource.Store, fullName string) (*resource.Resource, error)
	ReadAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error)
}

type ResourceService

type ResourceService struct {
	// contains filtered or unexported fields
}

func NewResourceService

func NewResourceService(logger log.Logger, repo ResourceRepository, mgr ResourceManager) *ResourceService

func (ResourceService) Create

func (rs ResourceService) Create(ctx context.Context, incoming *resource.Resource) error

func (ResourceService) Deploy

func (rs ResourceService) Deploy(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resources []*resource.Resource) error

func (ResourceService) Get

func (rs ResourceService) Get(ctx context.Context, tnnt tenant.Tenant, store resource.Store, resourceFullName string) (*resource.Resource, error)

func (ResourceService) GetAll

func (rs ResourceService) GetAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store) ([]*resource.Resource, error)

func (ResourceService) Update

func (rs ResourceService) Update(ctx context.Context, incoming *resource.Resource) error

type ResourceStatusRepo

type ResourceStatusRepo interface {
	UpdateStatus(ctx context.Context, res ...*resource.Resource) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL