Documentation
¶
Index ¶
- Constants
- type AdministrateChecker
- type Controller
- func (this *Controller) Convert(ctx context.Context, token string, namespace string, xml string) (model.Conversion, error)
- func (this *Controller) CorrelateMessage(ctx context.Context, token string, input model.MessageInput) (model.CorrelationResult, error)
- func (this *Controller) CreateDeployment(ctx context.Context, token string, namespace string, ...) (model.Deployment, error)
- func (this *Controller) CreateModel(ctx context.Context, token string, namespace string, input model.ModelInput) (result model.Model, err error)
- func (this *Controller) CreateSchedule(ctx context.Context, token string, namespace string, input model.ScheduleInput) (result model.Schedule, err error)
- func (this *Controller) DebugState(ctx context.Context, token string, namespace string, id string, ...) (result model.DebugState, err error)
- func (this *Controller) DeleteDeployment(ctx context.Context, token string, namespace string, id string) error
- func (this *Controller) DeleteInstances(ctx context.Context, token string, namespace string, ids []string) error
- func (this *Controller) DeleteIoValue(ctx context.Context, token string, key string) error
- func (this *Controller) DeleteModel(ctx context.Context, token string, namespace string, id string, force bool) error
- func (this *Controller) DeleteModule(ctx context.Context, token string, namespace string, id string) error
- func (this *Controller) DeleteNamespace(ctx context.Context, token string, name string) error
- func (this *Controller) DeleteSchedule(ctx context.Context, token string, namespace string, id string) error
- func (this *Controller) DeleteUser(ctx context.Context, token string, userId string) error
- func (this *Controller) DeleteUserData(ctx context.Context, userId string) error
- func (this *Controller) DeleteVariable(ctx context.Context, token string, namespace string, id string, name string) error
- func (this *Controller) DeploymentInstanceCount(ctx context.Context, token string, namespace string, id string, version int) (result model.Count, err error)
- func (this *Controller) DeploymentParameters(ctx context.Context, token string, namespace string, id string) ([]model.ParameterDescription, error)
- func (this *Controller) EventEvaluations(ctx context.Context, token string, namespace string, id string, ...) (result model.EventReconstruction, err error)
- func (this *Controller) GetDeployment(ctx context.Context, token string, namespace string, id string) (result model.Deployment, err error)
- func (this *Controller) GetDeploymentVersion(ctx context.Context, token string, namespace string, id string, version int) (result model.DeploymentVersion, err error)
- func (this *Controller) GetInstance(ctx context.Context, token string, namespace string, id string) (result model.Instance, err error)
- func (this *Controller) GetIoValue(ctx context.Context, token string, key string) (model.IoValue, error)
- func (this *Controller) GetModel(ctx context.Context, token string, namespace string, id string) (result model.Model, err error)
- func (this *Controller) GetModelVersion(ctx context.Context, token string, namespace string, id string, version int) (result model.ModelVersion, err error)
- func (this *Controller) GetModule(ctx context.Context, token string, namespace string, id string) (result model.Module, err error)
- func (this *Controller) GetNamespace(ctx context.Context, token string, namespace string) (model.Namespace, error)
- func (this *Controller) GetNetwork(ctx context.Context, token string, networkId string) (model.Network, error)
- func (this *Controller) GetSchedule(ctx context.Context, token string, namespace string, id string) (result model.Schedule, err error)
- func (this *Controller) GetStartParameters(ctx context.Context, token string, namespace string, deploymentId string) (result []model.StartParameter, err error)
- func (this *Controller) GetUserDependents(ctx context.Context, token string, userId string) (result model.UserDependents, err error)
- func (this *Controller) GetUserSettings(ctx context.Context, token string, userId string) (result model.UserSettings, err error)
- func (this *Controller) GetVariable(ctx context.Context, token string, namespace string, id string, name string, ...) (result model.Variable, err error)
- func (this *Controller) GetVariables(ctx context.Context, token string, namespace string, id string) (result []model.Variable, err error)
- func (this *Controller) HistoryState(ctx context.Context, token string, namespace string, id string, ...) (result model.DebugState, err error)
- func (this *Controller) HistoryVariable(ctx context.Context, token string, namespace string, id string, name string, ...) (result model.HistoryVariable, err error)
- func (this *Controller) IoBulk(ctx context.Context, token string, bulk model.IoBulk) ([]model.IoValue, error)
- func (this *Controller) ListActivities(ctx context.Context, token string, namespace string, id string, ...) (result model.ActivityPage, err error)
- func (this *Controller) ListDeploymentVersions(ctx context.Context, token string, namespace string, id string, ...) (result model.Page[model.DeploymentVersion], err error)
- func (this *Controller) ListDeployments(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Deployment], err error)
- func (this *Controller) ListElementStats(ctx context.Context, token string, namespace string, id string, run int) (result []model.ElementStats, err error)
- func (this *Controller) ListEventDescriptions(ctx context.Context, token string, namespace string, deploymentId string) (result []model.EventDescription, err error)
- func (this *Controller) ListIncidents(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Incident], err error)
- func (this *Controller) ListInstances(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Instance], err error)
- func (this *Controller) ListIoValues(ctx context.Context, token string, options model.IoListOptions) (model.Page[model.IoValue], error)
- func (this *Controller) ListMaintenanceProcedures(ctx context.Context, token string, namespace string, id string) (result []model.MaintenanceProcedure, err error)
- func (this *Controller) ListModelVersions(ctx context.Context, token string, namespace string, id string, ...) (result model.Page[model.ModelVersion], err error)
- func (this *Controller) ListModels(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Model], err error)
- func (this *Controller) ListModules(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Module], err error)
- func (this *Controller) ListNamespaces(ctx context.Context, token string) ([]model.Namespace, error)
- func (this *Controller) ListNetworks(ctx context.Context, token string) ([]model.Network, error)
- func (this *Controller) ListRuns(ctx context.Context, token string, namespace string, id string) (result []model.Run, err error)
- func (this *Controller) ListSchedules(ctx context.Context, token string, namespace string, ...) (result model.Page[model.Schedule], err error)
- func (this *Controller) MaintenanceParameters(ctx context.Context, token string, namespace string, id string, ...) ([]model.ParameterDescription, error)
- func (this *Controller) PrepareDeployment(ctx context.Context, token string, namespace string, input model.PrepareInput) (result model.PreparedDeployment, err error)
- func (this *Controller) PublishModel(ctx context.Context, token string, namespace string, id string, ...) (result model.Model, err error)
- func (this *Controller) PutDeployment(ctx context.Context, token string, namespace string, id string, ...) (result model.Deployment, err error)
- func (this *Controller) PutInstance(ctx context.Context, token string, namespace string, id string, ...) (model.Instance, error)
- func (this *Controller) PutNamespace(ctx context.Context, token string, name string, ns model.Namespace) (model.Namespace, error)
- func (this *Controller) RecomputeDeviceGroup(ctx context.Context, groupId string) error
- func (this *Controller) RecomputeEvents(ctx context.Context, deploymentId string) error
- func (this *Controller) RemoveResource(ctx context.Context, ref model.ResourceRef) error
- func (this *Controller) ResetRestarts(ctx context.Context, token string, namespace string, id string) (result model.Deployment, err error)
- func (this *Controller) ResourceUsage(ctx context.Context, token string, namespace string, kind string, id string) (result model.ResourceUsage, err error)
- func (this *Controller) RestartInstance(ctx context.Context, token string, namespace string, id string, ...) (model.Instance, error)
- func (this *Controller) SetDeploymentDisabled(ctx context.Context, token string, namespace string, id string, ...) (result model.Deployment, err error)
- func (this *Controller) SetDescriber(describer *events.Describer)
- func (this *Controller) SetEventDebugging(series events.Series, evaluator *events.Evaluator, ...)
- func (this *Controller) SetIo(io *processio.Service)
- func (this *Controller) SetIoValue(ctx context.Context, token string, key string, input model.IoValueInput) error
- func (this *Controller) SetLive(hub *debug.Hub, settings LiveSettings)
- func (this *Controller) SetNetworks(networks Networks)
- func (this *Controller) SetOwner(ctx context.Context, token string, namespace string, kind model.Kind, ...) error
- func (this *Controller) SetParameters(describer *prepare.Describer, userToken auth.UserTokenSource)
- func (this *Controller) SetPreparation(preparer *prepare.Preparer, access *prepare.Access)
- func (this *Controller) SetUserSettings(ctx context.Context, token string, userId string, settings model.UserSettings) (model.UserSettings, error)
- func (this *Controller) SetVariable(ctx context.Context, token string, namespace string, id string, name string, ...) error
- func (this *Controller) StartInstance(ctx context.Context, token string, namespace string, ...) (model.Instance, error)
- func (this *Controller) StartMaintenance(ctx context.Context, token string, namespace string, id string, ...) (model.Instance, error)
- func (this *Controller) StartMaintenanceInternal(ctx context.Context, id string, procedure string, variables map[string]any) (model.Instance, error)
- func (this *Controller) StopInstances(ctx context.Context, token string, namespace string, ids []string) error
- func (this *Controller) UpdateInstanceInfo(ctx context.Context, token string, namespace string, id string, ...) (result model.Instance, err error)
- func (this *Controller) UpdateModel(ctx context.Context, token string, namespace string, id string, ...) (result model.Model, err error)
- func (this *Controller) UpdateParameters(ctx context.Context, token string, namespace string, id string, ...) (model.Instance, error)
- func (this *Controller) UpdateSchedule(ctx context.Context, token string, namespace string, id string, ...) (result model.Schedule, err error)
- func (this *Controller) Validate(ctx context.Context, token string, namespace string, xml string) ([]model.Issue, error)
- func (this *Controller) Watch(ctx context.Context, token string, namespace string, id string, ...) (<-chan model.DebugMessage, error)
- type HubChecker
- type LiveSettings
- type Namespaces
- type Networks
- type Right
- type UserRemover
Constants ¶
const ( KindModel = model.KindModel KindDeployment = model.KindDeployment KindInstance = model.KindInstance )
const ( Read = permissions.Read Write = permissions.Write Execute = permissions.Execute Administrate = permissions.Administrate )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdministrateChecker ¶
type AdministrateChecker interface {
HasAdministrate(ctx context.Context, namespace string, kind model.Kind, id string, user string) (bool, error)
}
AdministrateChecker is implemented by authorizers that know shared rights (SEC-11).
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(s *store.Store, e *engine.Engine, namespaces Namespaces, auth permissions.Authorizer, certs *jwt.KeycloakCertProvider) *Controller
func (*Controller) Convert ¶
func (this *Controller) Convert(ctx context.Context, token string, namespace string, xml string) (model.Conversion, error)
Convert rewrites a model written for Camunda 7 and validates the result against the rules of the namespace, without storing it (MIG-04).
func (*Controller) CorrelateMessage ¶
func (this *Controller) CorrelateMessage(ctx context.Context, token string, input model.MessageInput) (model.CorrelationResult, error)
CorrelateMessage delivers a message to the caller's instances and deployments; admins, e.g. the event-worker with client credentials, correlate across owners or for one owner (EVT-01).
func (*Controller) CreateDeployment ¶
func (this *Controller) CreateDeployment(ctx context.Context, token string, namespace string, input model.DeploymentInput) (model.Deployment, error)
func (*Controller) CreateModel ¶
func (this *Controller) CreateModel(ctx context.Context, token string, namespace string, input model.ModelInput) (result model.Model, err error)
func (*Controller) CreateSchedule ¶
func (this *Controller) CreateSchedule(ctx context.Context, token string, namespace string, input model.ScheduleInput) (result model.Schedule, err error)
CreateSchedule needs the execute right on the deployment; the starts run as its owner.
func (*Controller) DebugState ¶
func (this *Controller) DebugState(ctx context.Context, token string, namespace string, id string, options model.DebugOptions) (result model.DebugState, err error)
DebugState returns the live state of an instance (DBG-02) with the read right on it or as admin (DBG-08); large values are cut and can be loaded with GetVariable (DBG-04).
func (*Controller) DeleteDeployment ¶
func (this *Controller) DeleteDeployment(ctx context.Context, token string, namespace string, id string) error
DeleteDeployment removes all versions with instances, history, incidents and start events in one transaction (DEP-11).
func (*Controller) DeleteInstances ¶
func (this *Controller) DeleteInstances(ctx context.Context, token string, namespace string, ids []string) error
DeleteInstances removes instances with history, variables, incidents and runtime state (HIST-03); a running instance is removed as well.
func (*Controller) DeleteIoValue ¶
func (*Controller) DeleteModel ¶
func (this *Controller) DeleteModel(ctx context.Context, token string, namespace string, id string, force bool) error
DeleteModel deletes a model unless deployments of module tasks use it; force deletes it anyway and is for admins (SMS-15)
func (*Controller) DeleteModule ¶
func (this *Controller) DeleteModule(ctx context.Context, token string, namespace string, id string) error
DeleteModule removes a module; its resource is removed through the outbox (SMS-06).
func (*Controller) DeleteNamespace ¶
func (*Controller) DeleteSchedule ¶
func (*Controller) DeleteUser ¶
DeleteUser removes everything the user owns in all namespaces and the user's rights on resources of others (SEC-08). Resources of others that depend on the user's resources are deleted with notification of their owners, or the deletion is rejected, as the namespace decides (SEC-13). Rights are removed first: if permissions-v2 fails, nothing is deleted and the call can be repeated.
func (*Controller) DeleteUserData ¶
func (this *Controller) DeleteUserData(ctx context.Context, userId string) error
DeleteUserData deletes a user without a request token, e.g. for the Kafka topic user, which remains as fallback for users deleted outside of user-management (SEC-14).
func (*Controller) DeleteVariable ¶
func (this *Controller) DeleteVariable(ctx context.Context, token string, namespace string, id string, name string) error
DeleteVariable removes a variable of an instance (SMS-10).
func (*Controller) DeploymentInstanceCount ¶
func (this *Controller) DeploymentInstanceCount(ctx context.Context, token string, namespace string, id string, version int) (result model.Count, err error)
DeploymentInstanceCount counts the instances of all users on a version of a deployment, for those who may administrate it, e.g. to see how many have not moved to a new version yet
func (*Controller) DeploymentParameters ¶
func (this *Controller) DeploymentParameters(ctx context.Context, token string, namespace string, id string) ([]model.ParameterDescription, error)
DeploymentParameters describes the start parameters of a deployment with their options; it needs execute on the deployment, as before for releases (SMS-08).
func (*Controller) EventEvaluations ¶
func (this *Controller) EventEvaluations(ctx context.Context, token string, namespace string, id string, options model.EventReconstructionOptions) (result model.EventReconstruction, err error)
EventEvaluations reconstructs the evaluations of a device event while its element waited, from the values in the time series and with the code of the event worker (EVT-10, EVT-11).
func (*Controller) GetDeployment ¶
func (this *Controller) GetDeployment(ctx context.Context, token string, namespace string, id string) (result model.Deployment, err error)
func (*Controller) GetDeploymentVersion ¶
func (this *Controller) GetDeploymentVersion(ctx context.Context, token string, namespace string, id string, version int) (result model.DeploymentVersion, err error)
func (*Controller) GetInstance ¶
func (*Controller) GetIoValue ¶
func (*Controller) GetModelVersion ¶
func (this *Controller) GetModelVersion(ctx context.Context, token string, namespace string, id string, version int) (result model.ModelVersion, err error)
func (*Controller) GetNamespace ¶
func (*Controller) GetNetwork ¶
func (this *Controller) GetNetwork(ctx context.Context, token string, networkId string) (model.Network, error)
GetNetwork shows a gateway with the desired and the applied state of its resources (SYNC-13).
func (*Controller) GetSchedule ¶
func (*Controller) GetStartParameters ¶
func (this *Controller) GetStartParameters(ctx context.Context, token string, namespace string, deploymentId string) (result []model.StartParameter, err error)
func (*Controller) GetUserDependents ¶
func (this *Controller) GetUserDependents(ctx context.Context, token string, userId string) (result model.UserDependents, err error)
GetUserDependents is the dry run of DeleteUser; user-management calls it before any service deletes anything (SEC-14).
func (*Controller) GetUserSettings ¶
func (this *Controller) GetUserSettings(ctx context.Context, token string, userId string) (result model.UserSettings, err error)
func (*Controller) GetVariable ¶
func (this *Controller) GetVariable(ctx context.Context, token string, namespace string, id string, name string, elementId string) (result model.Variable, err error)
GetVariable returns the complete current value of a variable; with elementId the local variable of a token at that element (DBG-04).
func (*Controller) GetVariables ¶
func (*Controller) HistoryState ¶
func (this *Controller) HistoryState(ctx context.Context, token string, namespace string, id string, options model.HistoryOptions) (result model.DebugState, err error)
HistoryState reconstructs the state of an instance after an activity entry (DBG-13).
func (*Controller) HistoryVariable ¶
func (this *Controller) HistoryVariable(ctx context.Context, token string, namespace string, id string, name string, elementId string, options model.HistoryOptions) (result model.HistoryVariable, err error)
HistoryVariable returns the complete value of a variable at a step of the history; with elementId the local variable of that element (DBG-04).
func (*Controller) ListActivities ¶
func (this *Controller) ListActivities(ctx context.Context, token string, namespace string, id string, options model.ActivityListOptions) (result model.ActivityPage, err error)
func (*Controller) ListDeploymentVersions ¶
func (this *Controller) ListDeploymentVersions(ctx context.Context, token string, namespace string, id string, options model.PageOptions) (result model.Page[model.DeploymentVersion], err error)
func (*Controller) ListDeployments ¶
func (this *Controller) ListDeployments(ctx context.Context, token string, namespace string, options model.DeploymentListOptions) (result model.Page[model.Deployment], err error)
func (*Controller) ListElementStats ¶
func (this *Controller) ListElementStats(ctx context.Context, token string, namespace string, id string, run int) (result []model.ElementStats, err error)
func (*Controller) ListEventDescriptions ¶
func (this *Controller) ListEventDescriptions(ctx context.Context, token string, namespace string, deploymentId string) (result []model.EventDescription, err error)
func (*Controller) ListIncidents ¶
func (*Controller) ListInstances ¶
func (*Controller) ListIoValues ¶
func (this *Controller) ListIoValues(ctx context.Context, token string, options model.IoListOptions) (model.Page[model.IoValue], error)
ListIoValues lists the process-io values of the caller (IO-02).
func (*Controller) ListMaintenanceProcedures ¶
func (this *Controller) ListMaintenanceProcedures(ctx context.Context, token string, namespace string, id string) (result []model.MaintenanceProcedure, err error)
ListMaintenanceProcedures lists the procedures an instance offers (SMS-13).
func (*Controller) ListModelVersions ¶
func (this *Controller) ListModelVersions(ctx context.Context, token string, namespace string, id string, options model.PageOptions) (result model.Page[model.ModelVersion], err error)
func (*Controller) ListModels ¶
func (*Controller) ListModules ¶
func (this *Controller) ListModules(ctx context.Context, token string, namespace string, options model.ModuleListOptions) (result model.Page[model.Module], err error)
ListModules lists the modules of the instances a user may read (SMS-12).
func (*Controller) ListNamespaces ¶
func (*Controller) ListNetworks ¶
ListNetworks shows the gateways the user may read with their synchronisation (SYNC-12).
func (*Controller) ListSchedules ¶
func (this *Controller) ListSchedules(ctx context.Context, token string, namespace string, options model.ScheduleListOptions) (result model.Page[model.Schedule], err error)
ListSchedules lists the schedules of the caller; admins see all (RUN-07).
func (*Controller) MaintenanceParameters ¶
func (this *Controller) MaintenanceParameters(ctx context.Context, token string, namespace string, id string, procedure string) ([]model.ParameterDescription, error)
MaintenanceParameters describes the parameters of a maintenance procedure (SMS-13).
func (*Controller) PrepareDeployment ¶
func (this *Controller) PrepareDeployment(ctx context.Context, token string, namespace string, input model.PrepareInput) (result model.PreparedDeployment, err error)
PrepareDeployment returns what a deploy dialog needs: start parameters, validation findings and the selectable devices, groups and imports per device task and device event (DEP-01).
func (*Controller) PublishModel ¶
func (*Controller) PutDeployment ¶
func (this *Controller) PutDeployment(ctx context.Context, token string, namespace string, id string, input model.DeploymentInput) (result model.Deployment, err error)
PutDeployment creates a deployment with the given id or updates it. An update with the same BPMN and metadata as the current version changes nothing, so that repeating it is harmless.
func (*Controller) PutInstance ¶
func (*Controller) PutNamespace ¶
func (this *Controller) PutNamespace(ctx context.Context, token string, name string, ns model.Namespace) (model.Namespace, error)
PutNamespace creates or changes a namespace with its permissions-v2 topics (NS-02, NS-05).
func (*Controller) RecomputeDeviceGroup ¶
func (this *Controller) RecomputeDeviceGroup(ctx context.Context, groupId string) error
RecomputeDeviceGroup recomputes the deployments whose events depend on a device group.
func (*Controller) RecomputeEvents ¶
func (this *Controller) RecomputeEvents(ctx context.Context, deploymentId string) error
RecomputeEvents derives the event descriptions of the current version again, e.g. after a device group changed (DEP-08); only this deployment's descriptions change.
func (*Controller) RemoveResource ¶
func (this *Controller) RemoveResource(ctx context.Context, ref model.ResourceRef) error
RemoveResource removes a deployment, instance or watch a module refers to (SMS-06); one of a gateway is deleted there as well, as through the API (SMS-12).
func (*Controller) ResetRestarts ¶
func (this *Controller) ResetRestarts(ctx context.Context, token string, namespace string, id string) (result model.Deployment, err error)
ResetRestarts clears the faulty mark of a deployment after a restart loop (INC-04).
func (*Controller) ResourceUsage ¶
func (this *Controller) ResourceUsage(ctx context.Context, token string, namespace string, kind string, id string) (result model.ResourceUsage, err error)
ResourceUsage counts who uses a process model, flow or import type, so that its repository can refuse to delete it (SMS-15)
func (*Controller) RestartInstance ¶
func (*Controller) SetDeploymentDisabled ¶
func (this *Controller) SetDeploymentDisabled(ctx context.Context, token string, namespace string, id string, input model.DisabledInput) (result model.Deployment, err error)
SetDeploymentDisabled switches a deployment off or on (DEP-12). Off stops its running instances; while it is off, starts through the API are refused and schedules, timer and message starts are skipped. Updates keep the state. Deployments of gateways cannot be switched off, as with the engine wrapper.
func (*Controller) SetDescriber ¶
func (this *Controller) SetDescriber(describer *events.Describer)
SetDescriber enables event descriptions for event workers (DEP-07).
func (*Controller) SetEventDebugging ¶
func (this *Controller) SetEventDebugging(series events.Series, evaluator *events.Evaluator, userToken auth.UserTokenSource)
SetEventDebugging enables the reconstruction of event evaluations (EVT-10) and the evaluation of the current value of waiting events (DBG-18); both read with the token of the owner.
func (*Controller) SetIo ¶
func (this *Controller) SetIo(io *processio.Service)
SetIo enables the process-io API (IO-02).
func (*Controller) SetIoValue ¶
func (this *Controller) SetIoValue(ctx context.Context, token string, key string, input model.IoValueInput) error
func (*Controller) SetLive ¶
func (this *Controller) SetLive(hub *debug.Hub, settings LiveSettings)
SetLive enables live debug streams.
func (*Controller) SetNetworks ¶
func (this *Controller) SetNetworks(networks Networks)
SetNetworks enables deployments to gateways.
func (*Controller) SetOwner ¶
func (this *Controller) SetOwner(ctx context.Context, token string, namespace string, kind model.Kind, id string, input model.OwnerInput) error
SetOwner changes the owner of a resource. Allowed are platform admins and users who administrate the resource; the new owner must already administrate it (SEC-11).
func (*Controller) SetParameters ¶
func (this *Controller) SetParameters(describer *prepare.Describer, userToken auth.UserTokenSource)
SetParameters enables start parameters with options (SMS-08); userToken serves starts without a caller, e.g. by the watcher.
func (*Controller) SetPreparation ¶
func (this *Controller) SetPreparation(preparer *prepare.Preparer, access *prepare.Access)
SetPreparation enables selection options and access checks of selected devices.
func (*Controller) SetUserSettings ¶
func (this *Controller) SetUserSettings(ctx context.Context, token string, userId string, settings model.UserSettings) (model.UserSettings, error)
SetUserSettings sets the limits of a user; a lower retention applies at once (HIST-04).
func (*Controller) SetVariable ¶
func (*Controller) StartInstance ¶
func (this *Controller) StartInstance(ctx context.Context, token string, namespace string, input model.StartInstanceInput) (model.Instance, error)
func (*Controller) StartMaintenance ¶
func (this *Controller) StartMaintenance(ctx context.Context, token string, namespace string, id string, procedure string, input model.MaintenanceStartInput) (model.Instance, error)
StartMaintenance starts a procedure of an instance as an instance of its own that refers to it; administrate on the instance is needed, as before (SMS-13).
func (*Controller) StartMaintenanceInternal ¶
func (this *Controller) StartMaintenanceInternal(ctx context.Context, id string, procedure string, variables map[string]any) (model.Instance, error)
StartMaintenanceInternal starts a procedure without a caller, e.g. for the watcher (TASK-27); the procedure runs as the owner of the instance.
func (*Controller) StopInstances ¶
func (*Controller) UpdateInstanceInfo ¶
func (this *Controller) UpdateInstanceInfo(ctx context.Context, token string, namespace string, id string, input model.InstanceInfoInput) (result model.Instance, err error)
UpdateInstanceInfo changes name and description of an instance; they are no part of the run, so instances of a gateway take them in the cloud.
func (*Controller) UpdateModel ¶
func (*Controller) UpdateParameters ¶
func (this *Controller) UpdateParameters(ctx context.Context, token string, namespace string, id string, input model.ParametersInput) (model.Instance, error)
UpdateParameters restarts an instance with new start parameters; the new run removes the modules of the previous one (SMS-03, SMS-09). Needs administrate on the instance and execute on its deployment, as before.
func (*Controller) UpdateSchedule ¶
func (*Controller) Watch ¶
func (this *Controller) Watch(ctx context.Context, token string, namespace string, id string, options model.WatchOptions) (<-chan model.DebugMessage, error)
Watch streams the debug state of an instance: a snapshot, then deltas, and the end state when the instance ends (DBG-01). The channel closes when the stream ends or ctx is done; a stream that ends without end message was interrupted and can be resumed with After.
type HubChecker ¶
type HubChecker interface {
CheckHub(ctx context.Context, token jwt.Token, networkId string, right Right) (bool, error)
// the ids of the gateways the user may read
ReadableHubs(ctx context.Context, token jwt.Token) ([]string, error)
}
HubChecker checks rights on gateways in permissions-v2, topic hubs (SEC-05).
type LiveSettings ¶
type LiveSettings struct {
// streams per user and replica
MaxPerUser int
// deltas are merged when changes come faster than this
MinInterval time.Duration
// a stream checks its instance at least this often, in case a wake-up got lost
Fallback time.Duration
// a resume or a delta covering more activity entries sends a new snapshot instead
MaxDeltaActivities int
// interval of the evaluation of the current value of waiting events (DBG-18)
EventInterval time.Duration
}
LiveSettings bound the live debug streams (DBG-10).
func DefaultLiveSettings ¶
func DefaultLiveSettings() LiveSettings
type Namespaces ¶
type Namespaces interface {
Get(name string) (model.Namespace, bool)
List() []model.Namespace
Put(ctx context.Context, ns model.Namespace) (model.Namespace, bool, error)
Delete(ctx context.Context, name string) error
}
Namespaces is the namespace registry (NS-02).
type Networks ¶
type Networks interface {
Desire(tx *store.Tx, networkId string, resource fogsync.Resource) error
// sends the desired state now instead of with the next pass
Wake()
// the networks with the ids, all if ids is nil, with their resources if detailed
Overview(ctx context.Context, ids []string, detailed bool) ([]model.Network, error)
// reads from a gateway (DBG-15) and watches an instance there (DBG-12)
Call(ctx context.Context, networkId string, method string, namespace string, instance string, args fogsync.RequestArgs, result any) error
Watch(ctx context.Context, networkId string, namespace string, instance string, options model.WatchOptions) (<-chan model.DebugMessage, error)
}
Networks keeps the desired state of gateways; set in the cloud when the synchronisation with gateways is configured (DEP-09, SYNC-01). Deployments and instances of a gateway are stored in the cloud with their network id, but run on the gateway: the cloud only desires them.
type Right ¶
type Right = permissions.Right
type UserRemover ¶
type UserRemover interface {
RemoveUser(ctx context.Context, userId string, owners permissions.Owners) error
}
UserRemover removes a deleted user's rights on resources of others (SEC-08).