core

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleService

type ModuleService interface {
	PlanAction(ctx context.Context, res module.ExpandedResource, act module.ActionRequest) (*resource.Resource, error)
	SyncState(ctx context.Context, res module.ExpandedResource) (*resource.State, error)
	StreamLogs(ctx context.Context, res module.ExpandedResource, filter map[string]string) (<-chan module.LogChunk, error)
	GetOutput(ctx context.Context, res module.ExpandedResource) (json.RawMessage, error)
}

type Service

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

func New

func New(repo resource.Store, moduleSvc ModuleService, clockFn func() time.Time) *Service

func (*Service) ApplyAction

func (svc *Service) ApplyAction(ctx context.Context, urn string, act module.ActionRequest) (*resource.Resource, error)

func (*Service) CreateResource

func (svc *Service) CreateResource(ctx context.Context, res resource.Resource) (*resource.Resource, error)

func (*Service) DeleteResource

func (svc *Service) DeleteResource(ctx context.Context, urn string) error

func (*Service) GetLog

func (svc *Service) GetLog(ctx context.Context, urn string, filter map[string]string) (<-chan module.LogChunk, error)

func (*Service) GetResource

func (svc *Service) GetResource(ctx context.Context, urn string) (*resource.Resource, error)

func (*Service) GetRevisions

func (svc *Service) GetRevisions(ctx context.Context, selector resource.RevisionsSelector) ([]resource.Revision, error)

func (*Service) ListResources

func (svc *Service) ListResources(ctx context.Context, filter resource.Filter) ([]resource.Resource, error)

func (*Service) RunSyncer

func (svc *Service) RunSyncer(ctx context.Context, interval time.Duration) error

RunSyncer runs the syncer thread that keeps performing resource-sync at regular intervals.

func (*Service) UpdateResource

func (svc *Service) UpdateResource(ctx context.Context, urn string, req resource.UpdateRequest) (*resource.Resource, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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