service

package
v0.13.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 14 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, logger log.Logger) *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 DownstreamRefresher added in v0.9.0

type DownstreamRefresher interface {
	RefreshResourceDownstream(ctx context.Context, resourceURNs []resource.URN, logWriter writer.LogWriter) error
}

type DownstreamResolver added in v0.12.0

type DownstreamResolver interface {
	GetDownstreamByResourceURN(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (job.DownstreamList, error)
}

type EventHandler added in v0.7.0

type EventHandler interface {
	HandleEvent(moderator.Event)
}

type ResourceManager

type ResourceManager interface {
	CreateResource(ctx context.Context, res *resource.Resource) error
	UpdateResource(ctx context.Context, res *resource.Resource) error
	SyncResource(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) (resource.URN, error)
	Exist(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (bool, 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) Exist added in v0.12.0

func (m *ResourceMgr) Exist(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (bool, error)

func (*ResourceMgr) GetURN

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

func (*ResourceMgr) RegisterDatastore

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

func (*ResourceMgr) SyncResource added in v0.9.0

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

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
	Delete(ctx context.Context, res *resource.Resource) error
	ChangeNamespace(ctx context.Context, res *resource.Resource, newTenant tenant.Tenant) error
	ReadByFullName(ctx context.Context, tnnt tenant.Tenant, store resource.Store, fullName string, onlyActive bool) (*resource.Resource, error)
	ReadAll(ctx context.Context, tnnt tenant.Tenant, store resource.Store, onlyActive bool) ([]*resource.Resource, error)
	GetResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) ([]*resource.Resource, error)
}

type ResourceService

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

func NewResourceService

func NewResourceService(
	logger log.Logger,
	repo ResourceRepository, downstreamRefresher DownstreamRefresher, mgr ResourceManager,
	eventHandler EventHandler, downstreamResolver DownstreamResolver,
) *ResourceService

func (ResourceService) ChangeNamespace added in v0.8.0

func (rs ResourceService) ChangeNamespace(ctx context.Context, datastore resource.Store, resourceFullName string, oldTenant, newTenant tenant.Tenant) error

func (ResourceService) Create

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

func (ResourceService) Delete added in v0.12.0

func (ResourceService) Deploy

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

func (ResourceService) ExistInStore added in v0.12.0

func (rs ResourceService) ExistInStore(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (bool, 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) GetByURN added in v0.12.0

func (rs ResourceService) GetByURN(ctx context.Context, tnnt tenant.Tenant, urn resource.URN) (*resource.Resource, error)

func (ResourceService) SyncResources added in v0.9.0

func (rs ResourceService) SyncResources(ctx context.Context, tnnt tenant.Tenant, store resource.Store, names []string) (*resource.SyncResponse, error)

func (ResourceService) Update

func (rs ResourceService) Update(ctx context.Context, incoming *resource.Resource, logWriter writer.LogWriter) 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