core

package
v0.2.9-rc Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 10 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 Options

type Options struct {
	DryRun bool
}

func WithDryRun

func WithDryRun(dryRun bool) Options

type Service

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

func New

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

func (*Service) ApplyAction

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

func (*Service) CreateResource

func (svc *Service) CreateResource(ctx context.Context, res resource.Resource, resourceOpts ...Options) (*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, withSpecConfigs bool) (resource.PagedResource, error)

func (*Service) RunSyncer

func (svc *Service) RunSyncer(ctx context.Context, workerCount int, interval time.Duration, scope map[string][]string, eg *errgroup.Group)

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, resourceOpts ...Options) (*resource.Resource, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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