Documentation ¶
Overview ¶
Package instruments provides a high-level client for management of imaging instruments
Index ¶
- Variables
- func HandleSleepAction(ctx context.Context, _ InstrumentID, name string, params hcl.Body) error
- func NewDomainEmbeds() database.DomainEmbeds
- type Action
- type ActionHandler
- type AdminID
- type AutomationJob
- type AutomationJobID
- type Camera
- type CameraID
- type Controller
- type ControllerAction
- type ControllerActionRunner
- type ControllerActionRunnerGetter
- type ControllerActionRunnerStore
- func (s *ControllerActionRunnerStore) GetActionRunner(ctx context.Context, iid InstrumentID, controllerName string) (runners map[ControllerID]ControllerActionRunner, err error)
- func (s *ControllerActionRunnerStore) HandleControllerAction(ctx context.Context, iid InstrumentID, name string, params hcl.Body) error
- type ControllerID
- type Deletable
- type Identifiable
- type Insertable
- type Instrument
- type InstrumentID
- type JobOrchestrator
- func (o *JobOrchestrator) Add(id AutomationJobID, instrumentID InstrumentID, name, specType, rawSpec string) error
- func (o *JobOrchestrator) Close()
- func (o *JobOrchestrator) Get(id AutomationJobID) (j *OrchestratedJob, ok bool)
- func (o *JobOrchestrator) Orchestrate(ctx context.Context) error
- func (o *JobOrchestrator) Remove(id AutomationJobID)
- func (o *JobOrchestrator) Update(id AutomationJobID, instrumentID InstrumentID, name, specType, rawSpec string) error
- type OrchestratedJob
- type ParsedSpecification
- type Schedule
- type SleepAction
- type Store
- func (s *Store) AddAutomationJob(ctx context.Context, c AutomationJob) (automationJobID AutomationJobID, err error)
- func (s *Store) AddCamera(ctx context.Context, c Camera) (cameraID CameraID, err error)
- func (s *Store) AddController(ctx context.Context, c Controller) (cid ControllerID, err error)
- func (s *Store) AddInstrument(ctx context.Context, i Instrument) (instrumentID InstrumentID, err error)
- func (s *Store) DeleteAutomationJob(ctx context.Context, id AutomationJobID) (err error)
- func (s *Store) DeleteCamera(ctx context.Context, id CameraID) (err error)
- func (s *Store) DeleteController(ctx context.Context, id ControllerID) (err error)
- func (s *Store) DeleteInstrument(ctx context.Context, id InstrumentID) (err error)
- func (s *Store) GetCamera(ctx context.Context, id CameraID) (i Camera, err error)
- func (s *Store) GetEnabledAutomationJobs(ctx context.Context) (jobs []AutomationJob, err error)
- func (s *Store) GetEnabledControllersByProtocol(ctx context.Context, protocol string) (controllers []Controller, err error)
- func (s *Store) GetInstrument(ctx context.Context, id InstrumentID) (i Instrument, err error)
- func (s *Store) GetInstrumentControllersByName(ctx context.Context, instrumentID InstrumentID, name string) (controllers []Controller, err error)
- func (s *Store) GetInstruments(ctx context.Context) (instruments []Instrument, err error)
- func (s *Store) GetInstrumentsByAdminID(ctx context.Context, adminID AdminID) (instruments []Instrument, err error)
- func (s *Store) UpdateAutomationJob(ctx context.Context, c AutomationJob) (err error)
- func (s *Store) UpdateCamera(ctx context.Context, c Camera) (err error)
- func (s *Store) UpdateController(ctx context.Context, c Controller) (err error)
- func (s *Store) UpdateInstrumentDescription(ctx context.Context, id InstrumentID, description string) (err error)
- func (s *Store) UpdateInstrumentName(ctx context.Context, id InstrumentID, name string) (err error)
- type Subcomponent
- type SubcomponentInsertable
- type Updateable
Constants ¶
This section is empty.
Variables ¶
View Source
var MigrationFiles []string = []string{
"1-initialize-schema-v0.1.7",
"2-rename-user-to-identity-v0.1.11",
"3-add-camera-controller-index-v0.1.15",
"4-add-enabled-flag-v0.3.4",
"5-enabled-not-null-v0.3.5",
"6-add-automation-jobs-v0.3.5",
"7-add-names-v0.3.5",
}
Functions ¶
func HandleSleepAction ¶ added in v0.3.5
func HandleSleepAction(ctx context.Context, _ InstrumentID, name string, params hcl.Body) error
func NewDomainEmbeds ¶ added in v0.1.7
func NewDomainEmbeds() database.DomainEmbeds
Types ¶
type ActionHandler ¶ added in v0.3.5
type ActionHandler func( ctx context.Context, instrumentID InstrumentID, name string, params hcl.Body, ) error
type AutomationJob ¶ added in v0.3.5
type AutomationJob struct { ID AutomationJobID InstrumentID InstrumentID Enabled bool Name string Description string Type string Specification string }
func (AutomationJob) GetID ¶ added in v0.3.6
func (j AutomationJob) GetID() AutomationJobID
func (AutomationJob) GetInstrumentID ¶ added in v0.3.6
func (j AutomationJob) GetInstrumentID() InstrumentID
func (AutomationJob) NewDelete ¶ added in v0.3.6
func (j AutomationJob) NewDelete() map[string]interface{}
func (AutomationJob) NewInsertion ¶ added in v0.3.6
func (j AutomationJob) NewInsertion() map[string]interface{}
func (AutomationJob) NewUpdate ¶ added in v0.3.6
func (j AutomationJob) NewUpdate() map[string]interface{}
type AutomationJobID ¶ added in v0.3.5
type AutomationJobID int64
type Camera ¶ added in v0.1.7
type Camera struct { ID CameraID InstrumentID InstrumentID Enabled bool Name string Description string Protocol string URL string }
func (Camera) GetInstrumentID ¶ added in v0.3.6
func (c Camera) GetInstrumentID() InstrumentID
func (Camera) NewInsertion ¶ added in v0.3.6
type Controller ¶ added in v0.1.7
type Controller struct { ID ControllerID InstrumentID InstrumentID Enabled bool Name string Description string Protocol string URL string }
func (Controller) GetID ¶ added in v0.3.6
func (c Controller) GetID() ControllerID
func (Controller) GetInstrumentID ¶ added in v0.3.6
func (c Controller) GetInstrumentID() InstrumentID
func (Controller) NewDelete ¶ added in v0.3.6
func (c Controller) NewDelete() map[string]interface{}
func (Controller) NewInsertion ¶ added in v0.3.6
func (c Controller) NewInsertion() map[string]interface{}
func (Controller) NewUpdate ¶ added in v0.3.6
func (c Controller) NewUpdate() map[string]interface{}
type ControllerAction ¶ added in v0.3.5
type ControllerActionRunner ¶ added in v0.3.5
type ControllerActionRunnerGetter ¶ added in v0.3.5
type ControllerActionRunnerGetter func(id ControllerID) (a ControllerActionRunner, ok bool)
type ControllerActionRunnerStore ¶ added in v0.3.5
type ControllerActionRunnerStore struct {
// contains filtered or unexported fields
}
func NewControllerActionRunnerStore ¶ added in v0.3.5
func NewControllerActionRunnerStore( instruments *Store, protocolGetters map[string]ControllerActionRunnerGetter, ) *ControllerActionRunnerStore
func (*ControllerActionRunnerStore) GetActionRunner ¶ added in v0.3.5
func (s *ControllerActionRunnerStore) GetActionRunner( ctx context.Context, iid InstrumentID, controllerName string, ) (runners map[ControllerID]ControllerActionRunner, err error)
func (*ControllerActionRunnerStore) HandleControllerAction ¶ added in v0.3.5
func (s *ControllerActionRunnerStore) HandleControllerAction( ctx context.Context, iid InstrumentID, name string, params hcl.Body, ) error
type ControllerID ¶ added in v0.3.4
type ControllerID int64
type Deletable ¶ added in v0.3.6
type Deletable[ID ~int64] interface { Identifiable[ID] NewDelete() map[string]interface{} }
type Identifiable ¶ added in v0.3.6
type Identifiable[ID ~int64] interface { GetID() ID }
type Insertable ¶ added in v0.3.6
type Insertable[ID ~int64] interface { Identifiable[ID] NewInsertion() map[string]interface{} }
type Instrument ¶
type Instrument struct { ID InstrumentID Name string Description string AdminID AdminID Cameras map[CameraID]Camera Controllers map[ControllerID]Controller AutomationJobs map[AutomationJobID]AutomationJob }
func (Instrument) GetID ¶ added in v0.3.6
func (i Instrument) GetID() InstrumentID
func (Instrument) NewDelete ¶ added in v0.3.6
func (i Instrument) NewDelete() map[string]interface{}
type InstrumentID ¶ added in v0.3.4
type InstrumentID int64
type JobOrchestrator ¶ added in v0.3.5
type JobOrchestrator struct {
// contains filtered or unexported fields
}
func NewJobOrchestrator ¶ added in v0.3.5
func NewJobOrchestrator( actionHandlers map[string]ActionHandler, logger godest.Logger, ) *JobOrchestrator
func (*JobOrchestrator) Add ¶ added in v0.3.5
func (o *JobOrchestrator) Add( id AutomationJobID, instrumentID InstrumentID, name, specType, rawSpec string, ) error
func (*JobOrchestrator) Close ¶ added in v0.3.5
func (o *JobOrchestrator) Close()
func (*JobOrchestrator) Get ¶ added in v0.3.5
func (o *JobOrchestrator) Get(id AutomationJobID) (j *OrchestratedJob, ok bool)
func (*JobOrchestrator) Orchestrate ¶ added in v0.3.5
func (o *JobOrchestrator) Orchestrate(ctx context.Context) error
func (*JobOrchestrator) Remove ¶ added in v0.3.5
func (o *JobOrchestrator) Remove(id AutomationJobID)
func (*JobOrchestrator) Update ¶ added in v0.3.5
func (o *JobOrchestrator) Update( id AutomationJobID, instrumentID InstrumentID, name, specType, rawSpec string, ) error
type OrchestratedJob ¶ added in v0.3.5
type OrchestratedJob struct { ID AutomationJobID InstrumentID InstrumentID Name string Type string RawSpec string ParsedSpec ParsedSpecification // contains filtered or unexported fields }
func NewOrchestratedJob ¶ added in v0.3.5
func NewOrchestratedJob( id AutomationJobID, instrumentID InstrumentID, name, specType, rawSpec string, ) (job *OrchestratedJob, err error)
func (*OrchestratedJob) Cancel ¶ added in v0.3.5
func (j *OrchestratedJob) Cancel()
func (*OrchestratedJob) Run ¶ added in v0.3.5
func (j *OrchestratedJob) Run(ctx context.Context, handlers map[string]ActionHandler) error
type ParsedSpecification ¶ added in v0.3.5
type Schedule ¶ added in v0.3.5
type SleepAction ¶ added in v0.3.5
type SleepAction struct {
Duration string `hcl:"duration"`
}
type Store ¶ added in v0.1.7
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddAutomationJob ¶ added in v0.3.5
func (s *Store) AddAutomationJob( ctx context.Context, c AutomationJob, ) (automationJobID AutomationJobID, err error)
func (*Store) AddController ¶ added in v0.1.7
func (s *Store) AddController(ctx context.Context, c Controller) (cid ControllerID, err error)
func (*Store) AddInstrument ¶ added in v0.1.7
func (s *Store) AddInstrument( ctx context.Context, i Instrument, ) (instrumentID InstrumentID, err error)
func (*Store) DeleteAutomationJob ¶ added in v0.3.5
func (s *Store) DeleteAutomationJob(ctx context.Context, id AutomationJobID) (err error)
func (*Store) DeleteCamera ¶ added in v0.1.7
func (*Store) DeleteController ¶ added in v0.1.7
func (s *Store) DeleteController(ctx context.Context, id ControllerID) (err error)
func (*Store) DeleteInstrument ¶ added in v0.1.7
func (s *Store) DeleteInstrument(ctx context.Context, id InstrumentID) (err error)
func (*Store) GetEnabledAutomationJobs ¶ added in v0.3.5
func (s *Store) GetEnabledAutomationJobs(ctx context.Context) (jobs []AutomationJob, err error)
func (*Store) GetEnabledControllersByProtocol ¶ added in v0.3.5
func (*Store) GetInstrument ¶ added in v0.1.7
func (s *Store) GetInstrument(ctx context.Context, id InstrumentID) (i Instrument, err error)
func (*Store) GetInstrumentControllersByName ¶ added in v0.3.5
func (s *Store) GetInstrumentControllersByName( ctx context.Context, instrumentID InstrumentID, name string, ) (controllers []Controller, err error)
func (*Store) GetInstruments ¶ added in v0.1.7
func (s *Store) GetInstruments(ctx context.Context) (instruments []Instrument, err error)
func (*Store) GetInstrumentsByAdminID ¶ added in v0.1.7
func (*Store) UpdateAutomationJob ¶ added in v0.3.5
func (s *Store) UpdateAutomationJob(ctx context.Context, c AutomationJob) (err error)
func (*Store) UpdateCamera ¶ added in v0.1.7
func (*Store) UpdateController ¶ added in v0.1.7
func (s *Store) UpdateController(ctx context.Context, c Controller) (err error)
func (*Store) UpdateInstrumentDescription ¶ added in v0.1.7
func (*Store) UpdateInstrumentName ¶ added in v0.1.7
type Subcomponent ¶ added in v0.3.6
type Subcomponent interface {
GetInstrumentID() InstrumentID
}
type SubcomponentInsertable ¶ added in v0.3.6
type SubcomponentInsertable[ID ~int64] interface { Subcomponent Insertable[ID] }
type Updateable ¶ added in v0.3.6
type Updateable[ID ~int64] interface { Identifiable[ID] NewUpdate() map[string]interface{} }
Click to show internal directories.
Click to hide internal directories.