Documentation ¶
Index ¶
- Constants
- type AsyncWorker
- type ModuleService
- type Service
- func (s *Service) ApplyAction(ctx context.Context, urn string, act module.ActionRequest) (*resource.Resource, error)
- func (s *Service) CreateResource(ctx context.Context, res resource.Resource) (*resource.Resource, error)
- func (s *Service) DeleteResource(ctx context.Context, urn string) error
- func (s *Service) GetLog(ctx context.Context, urn string, filter map[string]string) (<-chan module.LogChunk, error)
- func (s *Service) GetResource(ctx context.Context, urn string) (*resource.Resource, error)
- func (s *Service) GetRevisions(ctx context.Context, selector resource.RevisionsSelector) ([]resource.Revision, error)
- func (s *Service) HandleSyncJob(ctx context.Context, job worker.Job) ([]byte, error)
- func (s *Service) ListResources(ctx context.Context, filter resource.Filter) ([]resource.Resource, error)
- func (s *Service) UpdateResource(ctx context.Context, urn string, req resource.UpdateRequest) (*resource.Resource, error)
Constants ¶
View Source
const ( JobKindSyncResource = "sync_resource" JobKindScheduledSyncResource = "sched_sync_resource" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncWorker ¶
type ModuleService ¶ added in v0.1.3
type ModuleService interface { PlanAction(ctx context.Context, res module.ExpandedResource, act module.ActionRequest) (*module.Plan, 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, asyncWorker AsyncWorker, clockFn func() time.Time, lg *zap.Logger) *Service
func (*Service) ApplyAction ¶
func (*Service) CreateResource ¶
func (*Service) DeleteResource ¶
func (*Service) GetResource ¶
func (*Service) GetRevisions ¶ added in v0.1.2
func (*Service) HandleSyncJob ¶
HandleSyncJob is meant to be invoked by asyncWorker when an enqueued job is ready. TODO: make this private and move the registration of this handler inside New().
func (*Service) ListResources ¶
Click to show internal directories.
Click to hide internal directories.