Versions in this module Expand all Collapse all v0 v0.20.0 Nov 6, 2022 Changes in this version + const AgentMetricsRPCFunc + const AgentPoliciesReqRPCFunc + const AgentPolicyRPCFunc + const AgentResetRPCFunc + const AgentStopRPCFunc + const CapabilitiesTopic + const CurrentCapabilitiesSchemaVersion + const CurrentHeartbeatSchemaVersion + const CurrentRPCSchemaVersion + const DatasetRemovedRPCFunc + const DefaultTimeout + const GroupMembershipRPCFunc + const GroupMembershipReqRPCFunc + const GroupRemovedRPCFunc + const HeartbeatFreq + const HeartbeatsTopic + const LogTopic + const MaxMsgPayloadSize + const RPCFromCoreTopic + const RPCToCoreTopic + var ErrConflict = errors.New("entity already exists") + var ErrCreateAgent = errors.New("failed to create agent") + var ErrCreateAgentGroup = errors.New("failed to create agent group") + var ErrEntityConnected = errors.New("check connection in database error") + var ErrMaintainAgentGroupChannels = errors.New("failed to maintain agent group channels") + var ErrMalformedEntity = errors.New("malformed entity specification") + var ErrNotFound = errors.New("non-existent entity") + var ErrPayloadTooBig = errors.New("payload too big") + var ErrRemoveEntity = errors.New("failed to remove entity") + var ErrScanMetadata = errors.New("failed to scan metadata in db") + var ErrSchemaMalformed = errors.New("schema malformed") + var ErrSchemaVersion = errors.New("unsupported schema version") + var ErrSelectEntity = errors.New("select entity from db error") + var ErrThings = errors.New("failed to receive response from Things service") + var ErrUnauthorizedAccess = errors.New("missing or invalid credentials provided") + var ErrUpdateEntity = errors.New("failed to update entity") + type Agent struct + AgentMetadata types.Metadata + AgentTags types.Tags + Created time.Time + LastHB time.Time + LastHBData types.Metadata + MFChannelID string + MFKeyID string + MFOwnerID string + MFThingID string + MatchingGroups types.Metadata + Name types.Identifier + OrbTags types.Tags + State State + type AgentCommsService interface + NotifyAgentAllDatasets func(a Agent) error + NotifyAgentGroupMemberships func(a Agent) error + NotifyAgentNewGroupMembership func(a Agent, ag AgentGroup) error + NotifyAgentReset func(agent Agent, fullReset bool, reason string) error + NotifyAgentStop func(agent Agent, reason string) error + NotifyGroupDatasetEdit func(ctx context.Context, ag AgentGroup, datasetID, policyID, ownerID string, ...) error + NotifyGroupDatasetRemoval func(ag AgentGroup, dsID string, policyID string) error + NotifyGroupNewDataset func(ctx context.Context, ag AgentGroup, datasetID string, policyID string, ...) error + NotifyGroupPolicyRemoval func(ag AgentGroup, policyID string, policyName string, backend string) error + NotifyGroupPolicyUpdate func(ctx context.Context, ag AgentGroup, policyID string, ownerID string) error + NotifyGroupRemoval func(ctx context.Context, ag AgentGroup) error + Start func() error + Stop func() error + func CommsMetricsMiddleware(svc AgentCommsService, counter metrics.Counter, latency metrics.Histogram) AgentCommsService + func NewFleetCommsService(logger *zap.Logger, policyClient pb.PolicyServiceClient, ...) AgentCommsService + type AgentGroup struct + Created time.Time + Description string + ID string + MFChannelID string + MFOwnerID string + MatchingAgents types.Metadata + Name types.Identifier + Tags types.Tags + type AgentGroupRepository interface + Delete func(ctx context.Context, groupID string, ownerID string) error + RetrieveAllAgentGroupsByOwner func(ctx context.Context, ownerID string, pm PageMetadata) (PageAgentGroup, error) + RetrieveAllByAgent func(ctx context.Context, a Agent) ([]AgentGroup, error) + RetrieveByID func(ctx context.Context, groupID string, ownerID string) (AgentGroup, error) + RetrieveMatchingGroups func(ctx context.Context, ownerID string, thingID string) (MatchingGroups, error) + Save func(ctx context.Context, group AgentGroup) (string, error) + Update func(ctx context.Context, ownerID string, group AgentGroup) (AgentGroup, error) + type AgentGroupService interface + CreateAgentGroup func(ctx context.Context, token string, s AgentGroup) (AgentGroup, error) + EditAgentGroup func(ctx context.Context, token string, ag AgentGroup) (AgentGroup, error) + ListAgentGroups func(ctx context.Context, token string, pm PageMetadata) (PageAgentGroup, error) + RemoveAgentGroup func(ctx context.Context, token string, id string) error + ValidateAgentGroup func(ctx context.Context, token string, s AgentGroup) (AgentGroup, error) + ViewAgentGroupByID func(ctx context.Context, token string, id string) (AgentGroup, error) + ViewAgentGroupByIDInternal func(ctx context.Context, groupID string, ownerID string) (AgentGroup, error) + type AgentHeartbeatRepository interface + UpdateHeartbeatByIDWithChannel func(ctx context.Context, agent Agent) error + type AgentMetricsRPC struct + Func string + Payload []AgentMetricsRPCPayload + SchemaVersion string + type AgentMetricsRPCPayload struct + BEVersion string + Data []byte + Datasets []string + Format string + PolicyID string + PolicyName string + type AgentPoliciesReqRPCPayload struct + type AgentPolicyRPC struct + FullList bool + Func string + Payload []AgentPolicyRPCPayload + SchemaVersion string + type AgentPolicyRPCPayload struct + Action string + AgentGroupID string + Backend string + Data interface{} + DatasetID string + ID string + Name string + Version int32 + type AgentRepository interface + Delete func(ctx context.Context, ownerID string, thingID string) error + RetrieveAgentInfoByChannelID func(ctx context.Context, channelID string) (Agent, error) + RetrieveAgentMetadataByOwner func(ctx context.Context, ownerID string) ([]types.Metadata, error) + RetrieveAll func(ctx context.Context, owner string, pm PageMetadata) (Page, error) + RetrieveAllByAgentGroupID func(ctx context.Context, owner string, agentGroupID string, onlinishOnly bool) ([]Agent, error) + RetrieveByID func(ctx context.Context, ownerID string, thingID string) (Agent, error) + RetrieveByIDWithChannel func(ctx context.Context, thingID string, channelID string) (Agent, error) + RetrieveMatchingAgents func(ctx context.Context, owner string, tags types.Tags) (types.Metadata, error) + Save func(ctx context.Context, agent Agent) error + SetStaleStatus func(ctx context.Context, minutes time.Duration) (int64, error) + UpdateAgentByID func(ctx context.Context, ownerID string, agent Agent) error + UpdateDataByIDWithChannel func(ctx context.Context, agent Agent) error + type AgentResetRPC struct + Func string + Payload AgentResetRPCPayload + SchemaVersion string + type AgentResetRPCPayload struct + FullReset bool + Reason string + type AgentService interface + CreateAgent func(ctx context.Context, token string, a Agent) (Agent, error) + EditAgent func(ctx context.Context, token string, agent Agent) (Agent, error) + GetPolicyState func(ctx context.Context, agent Agent) (map[string]interface{}, error) + ListAgentBackends func(ctx context.Context, token string) ([]string, error) + ListAgents func(ctx context.Context, token string, pm PageMetadata) (Page, error) + RemoveAgent func(ctx context.Context, token string, thingID string) error + ResetAgent func(ct context.Context, token string, agentID string) error + ValidateAgent func(ctx context.Context, token string, a Agent) (Agent, error) + ViewAgentBackend func(ctx context.Context, token string, name string) (interface{}, error) + ViewAgentByID func(ctx context.Context, token string, thingID string) (Agent, error) + ViewAgentByIDInternal func(ctx context.Context, ownerID string, thingID string) (Agent, error) + ViewAgentInfoByChannelIDInternal func(ctx context.Context, channelID string) (Agent, error) + ViewAgentMatchingGroupsByID func(ctx context.Context, token string, thingID string) (MatchingGroups, error) + ViewAgentMatchingGroupsByIDInternal func(ctx context.Context, agentID string, ownerID string) (MatchingGroups, error) + type AgentStopRPC struct + Func string + Payload AgentStopRPCPayload + SchemaVersion string + type AgentStopRPCPayload struct + Reason string + type BackendInfo struct + Data map[string]interface{} + Version string + type BackendStateInfo struct + Error string + LastError string + LastRestartReason string + LastRestartTS time.Time + RestartCount int64 + State string + type Capabilities struct + AgentTags map[string]string + Backends map[string]BackendInfo + OrbAgent OrbAgentInfo + SchemaVersion string + type DatasetRemovedRPC struct + Func string + Payload DatasetRemovedRPCPayload + SchemaVersion string + type DatasetRemovedRPCPayload struct + DatasetID string + PolicyID string + type Group struct + GroupID string + GroupName types.Identifier + type GroupMembershipData struct + ChannelID string + GroupID string + Name string + type GroupMembershipRPC struct + Func string + Payload GroupMembershipRPCPayload + SchemaVersion string + type GroupMembershipRPCPayload struct + FullList bool + Groups []GroupMembershipData + type GroupMembershipReqRPCPayload struct + type GroupRemovedRPC struct + Func string + Payload GroupRemovedRPCPayload + SchemaVersion string + type GroupRemovedRPCPayload struct + AgentGroupID string + ChannelID string + Datasets []string + type GroupStateInfo struct + GroupChannel string + GroupName string + type Heartbeat struct + BackendState map[string]BackendStateInfo + GroupState map[string]GroupStateInfo + PolicyState map[string]PolicyStateInfo + SchemaVersion string + State State + TimeStamp time.Time + type MatchingGroups struct + Groups []Group + OwnerID string + type OrbAgentInfo struct + Version string + type Page struct + Agents []Agent + type PageAgentGroup struct + AgentGroups []AgentGroup + type PageMetadata struct + Dir string + Limit uint64 + Metadata types.Metadata + Name string + Offset uint64 + Order string + Tags types.Tags + Total uint64 + type PolicyStateInfo struct + Backend string + Datasets []string + Error string + LastScrapeBytes int64 + LastScrapeTS time.Time + Name string + State string + Version int32 + type RPC struct + Func string + Payload interface{} + SchemaVersion string + type SchemaVersionCheck struct + SchemaVersion string + type Service interface + func NewFleetService(logger *zap.Logger, auth mainflux.AuthServiceClient, agentRepo AgentRepository, ...) Service + type State int + const New + const Offline + const Online + const Removed + const Stale + const UpgradeRequired + func (s *State) Scan(value interface{}) error + func (s State) String() string + func (s State) Value() (driver.Value, error)