Documentation
¶
Index ¶
- Constants
- type Address
- type AdminState
- type AutoEvent
- type BaseAddress
- type BaseReading
- type BaseScheduleAction
- type BaseScheduleDef
- type BinaryReading
- type ChannelType
- type CronScheduleDef
- type DBTimestamp
- type Device
- type DeviceCommand
- type DeviceControlAction
- type DeviceProfile
- type DeviceResource
- type DeviceService
- type DiscoveredDevice
- type EdgeXMessageBusAction
- type EmailAddress
- type Event
- type HealthCheck
- type IntervalScheduleDef
- type KVResponse
- type KVS
- type KeyData
- type KeyOnly
- type LogEntry
- type MQTTPubAddress
- type MessageBus
- type Notification
- type NotificationSeverity
- type NotificationStatus
- type NullReading
- type ObjectReading
- type OperatingState
- type ProtocolProperties
- type ProvisionWatcher
- type RESTAction
- type RESTAddress
- type Reading
- type Registration
- type ResourceOperation
- type ResourceProperties
- type ScheduleAction
- type ScheduleActionRecord
- type ScheduleActionRecordStatus
- type ScheduleActionType
- type ScheduleDef
- type ScheduleDefType
- type ScheduleJob
- type Security
- type SimpleReading
- type StoredData
- type Subscription
- type Transmission
- type TransmissionRecord
- type TransmissionStatus
- type ZeroMQAddress
Constants ¶
const ( // Locked : device is locked // Unlocked : device is unlocked Locked = "LOCKED" Unlocked = "UNLOCKED" )
Constants for AdminState
const ( Rest = "REST" Email = "EMAIL" )
Constants for ChannelType
const ( Minor = "MINOR" Critical = "CRITICAL" Normal = "NORMAL" )
Constants for NotificationSeverity
const ( New = "NEW" Processed = "PROCESSED" EscalationSubscriptionName = "ESCALATION" EscalationPrefix = "escalated-" EscalatedContentNotice = "This notification is escalated by the transmission" )
Constants for NotificationStatus
const ( Failed = "FAILED" Sent = "SENT" Acknowledged = "ACKNOWLEDGED" RESENDING = "RESENDING" // Constants for ScheduleActionRecordStatus only Succeeded = "SUCCEEDED" Missed = "MISSED" )
Constants for TransmissionStatus and ScheduleActionRecordStatus
const ( Up = "UP" Down = "DOWN" Unknown = "UNKNOWN" )
Constants for OperatingState
const ( TraceLog = "TRACE" DebugLog = "DEBUG" InfoLog = "INFO" WarnLog = "WARN" ErrorLog = "ERROR" )
These constants identify the log levels in order of increasing severity.
const (
Escalated = "ESCALATED"
)
Constants for both NotificationStatus and TransmissionStatus
const Halt = "HALT"
Constant for Keeper health status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address interface {
GetBaseAddress() BaseAddress
}
type AdminState ¶
type AdminState string
AdminState controls the range of values which constitute valid administrative states for a device
func AssignAdminState ¶
func AssignAdminState(dtoAdminState string) AdminState
AssignAdminState provides a default value "UNLOCKED" to AdminState
type BaseAddress ¶
type BaseAddress struct {
// Type is used to identify the Address type, i.e., REST or MQTT
Type string
// Common properties
Scheme string // Scheme indicates the scheme of the URI, see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax
Host string
Port int
}
BaseAddress is a base struct contains the common fields, such as type, host, port, and so on.
type BaseReading ¶
type BaseScheduleAction ¶
type BaseScheduleAction struct {
// Id is the identifier of the action, no need to be in the DTO
Id string
Type ScheduleActionType
ContentType string
Payload []byte
}
type BaseScheduleDef ¶
type BaseScheduleDef struct {
Type ScheduleDefType
StartTimestamp int64
EndTimestamp int64
}
type BinaryReading ¶
type BinaryReading struct {
BaseReading `json:",inline"`
BinaryValue []byte
MediaType string
}
func (BinaryReading) GetBaseReading ¶
func (b BinaryReading) GetBaseReading() BaseReading
Implement GetBaseReading() method in order for BinaryReading and SimpleReading, ObjectReading structs to implement the abstract Reading interface and then be used as a Reading. Also, the Reading interface can access the BaseReading fields. This is Golang's way to implement inheritance.
type ChannelType ¶
type ChannelType string
ChannelType controls the range of values which constitute valid delivery types for channels
type CronScheduleDef ¶
type CronScheduleDef struct {
BaseScheduleDef
// Crontab is the cron expression
Crontab string
}
func (CronScheduleDef) GetBaseScheduleDef ¶
func (c CronScheduleDef) GetBaseScheduleDef() BaseScheduleDef
type DBTimestamp ¶
type Device ¶
type Device struct {
DBTimestamp
Id string
Name string
Parent string
Description string
AdminState AdminState
OperatingState OperatingState
Protocols map[string]ProtocolProperties
Labels []string
Location interface{}
ServiceName string
ProfileName string
AutoEvents []AutoEvent
Tags map[string]any
Properties map[string]any
}
type DeviceCommand ¶
type DeviceControlAction ¶
type DeviceControlAction struct {
BaseScheduleAction
DeviceName string
SourceName string
}
func (DeviceControlAction) GetBaseScheduleAction ¶
func (d DeviceControlAction) GetBaseScheduleAction() BaseScheduleAction
func (DeviceControlAction) WithEmptyPayloadAndId ¶
func (d DeviceControlAction) WithEmptyPayloadAndId() ScheduleAction
func (DeviceControlAction) WithId ¶
func (d DeviceControlAction) WithId(id string) ScheduleAction
type DeviceProfile ¶
type DeviceProfile struct {
DBTimestamp
ApiVersion string
Description string
Id string
Name string
Manufacturer string
Model string
Labels []string
DeviceResources []DeviceResource
DeviceCommands []DeviceCommand
}
type DeviceResource ¶
type DeviceService ¶
type DeviceService struct {
DBTimestamp
Id string
Name string
Description string
Labels []string
BaseAddress string
AdminState AdminState
Properties map[string]any
}
type DiscoveredDevice ¶
type DiscoveredDevice struct {
ProfileName string
AdminState AdminState
AutoEvents []AutoEvent
Properties map[string]any
}
type EdgeXMessageBusAction ¶
type EdgeXMessageBusAction struct {
BaseScheduleAction
Topic string
}
func (EdgeXMessageBusAction) GetBaseScheduleAction ¶
func (m EdgeXMessageBusAction) GetBaseScheduleAction() BaseScheduleAction
func (EdgeXMessageBusAction) WithEmptyPayloadAndId ¶
func (m EdgeXMessageBusAction) WithEmptyPayloadAndId() ScheduleAction
func (EdgeXMessageBusAction) WithId ¶
func (m EdgeXMessageBusAction) WithId(id string) ScheduleAction
type EmailAddress ¶
type EmailAddress struct {
BaseAddress
Recipients []string
}
EmailAddress is an Email specific struct
func (EmailAddress) GetBaseAddress ¶
func (a EmailAddress) GetBaseAddress() BaseAddress
type HealthCheck ¶
type IntervalScheduleDef ¶
type IntervalScheduleDef struct {
BaseScheduleDef
// Interval specifies the time interval between two consecutive executions
Interval string
}
func (IntervalScheduleDef) GetBaseScheduleDef ¶
func (d IntervalScheduleDef) GetBaseScheduleDef() BaseScheduleDef
type KVResponse ¶
type KVResponse interface {
SetKey(string)
}
KVResponse defines the Response Content for GET Keys of core-keeper (GET /kvs/key/{key} API).
type KVS ¶
type KVS struct {
Key string `json:"key,omitempty"`
StoredData
}
KVS defines the Response Content for GET Keys controller with keyOnly is false which inherits KVResponse interface.
type KeyOnly ¶
type KeyOnly string
KeyOnly defines the Response Content for GET Keys with keyOnly is true which inherits KVResponse interface.
type LogEntry ¶
type LogEntry struct {
Level string `bson:"logLevel,omitempty" json:"logLevel"`
Args []interface{} `bson:"args,omitempty" json:"args"`
OriginService string `bson:"originService,omitempty" json:"originService"`
Message string `bson:"message,omitempty" json:"message"`
Created int64 `bson:"created,omitempty" json:"created"`
// contains filtered or unexported fields
}
func (*LogEntry) UnmarshalJSON ¶
UnmarshalJSON implements the Unmarshaler interface for the LogEntry type
type MQTTPubAddress ¶
type MQTTPubAddress struct {
BaseAddress
MessageBus
Security
Publisher string
QoS int
KeepAlive int
Retained bool
AutoReconnect bool
ConnectTimeout int
}
MQTTPubAddress is a MQTT specific struct
func (MQTTPubAddress) GetBaseAddress ¶
func (a MQTTPubAddress) GetBaseAddress() BaseAddress
type MessageBus ¶
type MessageBus struct {
Topic string
}
MessageBus is a base struct contains the messageBus related fields.
type Notification ¶
type Notification struct {
DBTimestamp
Category string
Content string
ContentType string
Description string
Id string
Labels []string
Sender string
Severity NotificationSeverity
Status NotificationStatus
Acknowledged bool
}
type NotificationSeverity ¶
type NotificationSeverity string
NotificationSeverity indicates the level of severity for the notification.
type NotificationStatus ¶
type NotificationStatus string
NotificationStatus indicates the current processing status of the notification.
type NullReading ¶
type NullReading struct {
BaseReading `json:",inline"`
Value any
}
func NewNullReading ¶
func NewNullReading(b BaseReading) NullReading
func (NullReading) GetBaseReading ¶
func (n NullReading) GetBaseReading() BaseReading
type ObjectReading ¶
type ObjectReading struct {
BaseReading `json:",inline"`
ObjectValue any
}
func (ObjectReading) GetBaseReading ¶
func (o ObjectReading) GetBaseReading() BaseReading
type OperatingState ¶
type OperatingState string
OperatingState is an indication of the operations of the device.
type ProtocolProperties ¶
ProtocolProperties contains the device connection information in key/value pair
type ProvisionWatcher ¶
type ProvisionWatcher struct {
DBTimestamp
Id string
Name string
ServiceName string
Labels []string
Identifiers map[string]string
BlockingIdentifiers map[string][]string
AdminState AdminState
DiscoveredDevice DiscoveredDevice
}
type RESTAction ¶
type RESTAction struct {
BaseScheduleAction
Address string
Method string
InjectEdgeXAuth bool
}
func (RESTAction) GetBaseScheduleAction ¶
func (r RESTAction) GetBaseScheduleAction() BaseScheduleAction
func (RESTAction) WithEmptyPayloadAndId ¶
func (r RESTAction) WithEmptyPayloadAndId() ScheduleAction
func (RESTAction) WithId ¶
func (r RESTAction) WithId(id string) ScheduleAction
type RESTAddress ¶
type RESTAddress struct {
BaseAddress
Path string
HTTPMethod string
InjectEdgeXAuth bool
}
RESTAddress is a REST specific struct
func (RESTAddress) GetBaseAddress ¶
func (a RESTAddress) GetBaseAddress() BaseAddress
type Reading ¶
type Reading interface {
GetBaseReading() BaseReading
}
Reading is an abstract interface to be implemented by BinaryReading/SimpleReading
type Registration ¶
type Registration struct {
DBTimestamp
ServiceId string
Status string
Host string
Port int
HealthCheck HealthCheck
}
type ResourceOperation ¶
type ResourceProperties ¶
type ScheduleAction ¶
type ScheduleAction interface {
GetBaseScheduleAction() BaseScheduleAction
// WithEmptyPayloadAndId returns a copy of the ScheduleAction with empty payload and Id, which is used by ScheduleActionRecord to remove the payload and id before storing the record into database
WithEmptyPayloadAndId() ScheduleAction
// WithId returns a copy of the ScheduleAction with ID or generates a new ID if the ID is empty, which is used to identify the action and record in the database
WithId(id string) ScheduleAction
}
func UnmarshalScheduleAction ¶
func UnmarshalScheduleAction(b []byte) (action ScheduleAction, err error)
type ScheduleActionRecord ¶
type ScheduleActionRecord struct {
Id string
JobName string
Action ScheduleAction
Status ScheduleActionRecordStatus
ScheduledAt int64
Created int64
}
func (*ScheduleActionRecord) UnmarshalJSON ¶
func (scheduleActionRecord *ScheduleActionRecord) UnmarshalJSON(b []byte) error
type ScheduleActionRecordStatus ¶
type ScheduleActionRecordStatus string
ScheduleActionRecordStatus indicates the most recent success/failure of a given schedule action attempt or a missed record.
type ScheduleActionType ¶
type ScheduleActionType string
ScheduleActionType is used to identify the schedule action type, i.e., EDGEXMESSAGEBUS, REST, or DEVICECONTROL
type ScheduleDef ¶
type ScheduleDef interface {
GetBaseScheduleDef() BaseScheduleDef
}
type ScheduleDefType ¶
type ScheduleDefType string
ScheduleDefType is used to identify the schedule definition type, i.e., INTERVAL or CRON
type ScheduleJob ¶
type ScheduleJob struct {
DBTimestamp
Id string
Name string
Definition ScheduleDef
AutoTriggerMissedRecords bool
Actions []ScheduleAction
AdminState AdminState
Labels []string
Properties map[string]any
}
func (*ScheduleJob) UnmarshalJSON ¶
func (scheduleJob *ScheduleJob) UnmarshalJSON(b []byte) error
type Security ¶
type Security struct {
// SecretPath is the name of the path in secret provider to retrieve your secrets. Must be non-blank.
SecretPath string
// AuthMode indicates what to use when connecting to the broker.
// Options are "none", "cacert" , "usernamepassword", "clientcert".
// If a CA Cert exists in the SecretPath then it will be used for
// all modes except "none".
AuthMode string
// SkipCertVerify indicates if the server certificate verification should be skipped
SkipCertVerify bool
}
Security is a base struct contains the security related fields.
type SimpleReading ¶
type SimpleReading struct {
BaseReading `json:",inline"`
Value string
}
func (SimpleReading) GetBaseReading ¶
func (s SimpleReading) GetBaseReading() BaseReading
type StoredData ¶
type StoredData struct {
DBTimestamp
Value interface{} `json:"value,omitempty"`
}
type Subscription ¶
type Subscription struct {
DBTimestamp
Categories []string
Labels []string
Channels []Address
Description string
Id string
Receiver string
Name string
ResendLimit int
ResendInterval string
AdminState AdminState
}
func (*Subscription) UnmarshalJSON ¶
func (subscription *Subscription) UnmarshalJSON(b []byte) error
type Transmission ¶
type Transmission struct {
Created int64
Id string
Channel Address
NotificationId string
SubscriptionName string
Records []TransmissionRecord
ResendCount int
Status TransmissionStatus
}
func NewTransmission ¶
func NewTransmission(subscriptionName string, channel Address, notificationId string) Transmission
NewTransmission create transmission model with required fields
func (*Transmission) UnmarshalJSON ¶
func (trans *Transmission) UnmarshalJSON(b []byte) error
type TransmissionRecord ¶
type TransmissionRecord struct {
Status TransmissionStatus
Response string
Sent int64
}
type TransmissionStatus ¶
type TransmissionStatus string
TransmissionStatus indicates the most recent success/failure of a given transmission attempt.
type ZeroMQAddress ¶
type ZeroMQAddress struct {
BaseAddress
MessageBus
}
ZeroMQAddress is a ZeroMQ specific struct
func (ZeroMQAddress) GetBaseAddress ¶
func (a ZeroMQAddress) GetBaseAddress() BaseAddress
Source Files
¶
- address.go
- autoevent.go
- consts.go
- dbtimestamp.go
- device.go
- devicecommand.go
- deviceprofile.go
- deviceresource.go
- deviceservice.go
- discovereddevice.go
- event.go
- keydata.go
- kvs.go
- log_entry.go
- notification.go
- provisionwatcher.go
- reading.go
- registration.go
- resourceoperation.go
- resourceproperties.go
- scheduleactionrecord.go
- schedulejob.go
- subscription.go
- transmission.go
- transmissionrecord.go