events

package
v2.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OwnerIdKey   = "ownerId"
	EventTypeKey = "eventType"
)
View Source
const (
	Plgd            = "plgd"
	PlgdOwners      = Plgd + ".owners"
	PlgdOwnersOwner = PlgdOwners + ".{" + OwnerIdKey + "}"
)
View Source
const (
	Registrations                     = "registrations"
	PlgdOwnersOwnerRegistrations      = PlgdOwnersOwner + "." + Registrations
	PlgdOwnersOwnerRegistrationsEvent = PlgdOwnersOwnerRegistrations + ".{" + EventTypeKey + "}"
)
View Source
const (
	DevicesRegisteredEvent   = "devicesregistered"
	DevicesUnregisteredEvent = "devicesunregistered"
)

Variables

View Source
var File_identity_store_pb_events_proto protoreflect.FileDescriptor

Functions

func GetDevicesRegisteredSubject

func GetDevicesRegisteredSubject(owner string) string

func GetDevicesUnregisteredSubject

func GetDevicesUnregisteredSubject(owner string) string

func GetRegistrationSubject

func GetRegistrationSubject(owner string) string

func OwnerToUUID

func OwnerToUUID(owner string) string

func ToSubject

func ToSubject(template string, opts ...func(values map[string]string)) string

func WithEventType

func WithEventType(eventType string) func(values map[string]string)

func WithOwner

func WithOwner(owner string) func(values map[string]string)

Types

type AuditContext

type AuditContext struct {
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

provides who register/unregister the device

func (*AuditContext) Descriptor deprecated

func (*AuditContext) Descriptor() ([]byte, []int)

Deprecated: Use AuditContext.ProtoReflect.Descriptor instead.

func (*AuditContext) GetUserId

func (x *AuditContext) GetUserId() string

func (*AuditContext) ProtoMessage

func (*AuditContext) ProtoMessage()

func (*AuditContext) ProtoReflect

func (x *AuditContext) ProtoReflect() protoreflect.Message

func (*AuditContext) Reset

func (x *AuditContext) Reset()

func (*AuditContext) String

func (x *AuditContext) String() string

type DevicesRegistered

type DevicesRegistered struct {
	Owner         string         `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`                                      // new owner of devices.
	DeviceIds     []string       `protobuf:"bytes,2,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`             // list of device ids added to owner.
	Timestamp     int64          `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`                             // unix timestamp in nanoseconds of creation event.
	AuditContext  *AuditContext  `protobuf:"bytes,4,opt,name=audit_context,json=auditContext,proto3" json:"audit_context,omitempty"`    // provides who register/unregister the device
	EventMetadata *EventMetadata `protobuf:"bytes,5,opt,name=event_metadata,json=eventMetadata,proto3" json:"event_metadata,omitempty"` // provides metadata of event
	// Open telemetry data propagated to asynchronous events
	OpenTelemetryCarrier map[string]string `` /* 213-byte string literal not displayed */
	// contains filtered or unexported fields
}

devices was registered to owner.

func (*DevicesRegistered) Descriptor deprecated

func (*DevicesRegistered) Descriptor() ([]byte, []int)

Deprecated: Use DevicesRegistered.ProtoReflect.Descriptor instead.

func (*DevicesRegistered) GetAuditContext

func (x *DevicesRegistered) GetAuditContext() *AuditContext

func (*DevicesRegistered) GetDeviceIds

func (x *DevicesRegistered) GetDeviceIds() []string

func (*DevicesRegistered) GetEventMetadata added in v2.9.0

func (x *DevicesRegistered) GetEventMetadata() *EventMetadata

func (*DevicesRegistered) GetOpenTelemetryCarrier added in v2.4.0

func (x *DevicesRegistered) GetOpenTelemetryCarrier() map[string]string

func (*DevicesRegistered) GetOwner

func (x *DevicesRegistered) GetOwner() string

func (*DevicesRegistered) GetTimestamp

func (x *DevicesRegistered) GetTimestamp() int64

func (*DevicesRegistered) ProtoMessage

func (*DevicesRegistered) ProtoMessage()

func (*DevicesRegistered) ProtoReflect

func (x *DevicesRegistered) ProtoReflect() protoreflect.Message

func (*DevicesRegistered) Reset

func (x *DevicesRegistered) Reset()

func (*DevicesRegistered) String

func (x *DevicesRegistered) String() string

type DevicesUnregistered

type DevicesUnregistered struct {
	Owner         string         `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`                                      // owner, which lose devices.
	DeviceIds     []string       `protobuf:"bytes,2,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`             // list of device ids deleted from owner.
	Timestamp     int64          `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`                             // unix timestamp in nanoseconds of creation event.
	AuditContext  *AuditContext  `protobuf:"bytes,4,opt,name=audit_context,json=auditContext,proto3" json:"audit_context,omitempty"`    // provides who register/unregister the device
	EventMetadata *EventMetadata `protobuf:"bytes,5,opt,name=event_metadata,json=eventMetadata,proto3" json:"event_metadata,omitempty"` // provides metadata of event
	// Open telemetry data propagated to asynchronous events
	OpenTelemetryCarrier map[string]string `` /* 213-byte string literal not displayed */
	// contains filtered or unexported fields
}

devices was deregistered from owner.

func (*DevicesUnregistered) Descriptor deprecated

func (*DevicesUnregistered) Descriptor() ([]byte, []int)

Deprecated: Use DevicesUnregistered.ProtoReflect.Descriptor instead.

func (*DevicesUnregistered) GetAuditContext

func (x *DevicesUnregistered) GetAuditContext() *AuditContext

func (*DevicesUnregistered) GetDeviceIds

func (x *DevicesUnregistered) GetDeviceIds() []string

func (*DevicesUnregistered) GetEventMetadata added in v2.9.0

func (x *DevicesUnregistered) GetEventMetadata() *EventMetadata

func (*DevicesUnregistered) GetOpenTelemetryCarrier added in v2.4.0

func (x *DevicesUnregistered) GetOpenTelemetryCarrier() map[string]string

func (*DevicesUnregistered) GetOwner

func (x *DevicesUnregistered) GetOwner() string

func (*DevicesUnregistered) GetTimestamp

func (x *DevicesUnregistered) GetTimestamp() int64

func (*DevicesUnregistered) ProtoMessage

func (*DevicesUnregistered) ProtoMessage()

func (*DevicesUnregistered) ProtoReflect

func (x *DevicesUnregistered) ProtoReflect() protoreflect.Message

func (*DevicesUnregistered) Reset

func (x *DevicesUnregistered) Reset()

func (*DevicesUnregistered) String

func (x *DevicesUnregistered) String() string

type Event

type Event struct {

	// Types that are assignable to Type:
	//
	//	*Event_DevicesRegistered
	//	*Event_DevicesUnregistered
	Type isEvent_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

nats: owners.{owner}.>

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetDevicesRegistered

func (x *Event) GetDevicesRegistered() *DevicesRegistered

func (*Event) GetDevicesUnregistered

func (x *Event) GetDevicesUnregistered() *DevicesUnregistered

func (*Event) GetType

func (m *Event) GetType() isEvent_Type

func (*Event) Marshal

func (e *Event) Marshal() ([]byte, error)

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

func (*Event) Unmarshal

func (e *Event) Unmarshal(b []byte) error

type EventMetadata added in v2.9.0

type EventMetadata struct {
	HubId string `protobuf:"bytes,1,opt,name=hub_id,json=hubId,proto3" json:"hub_id,omitempty"` // the hub which sent the event
	// contains filtered or unexported fields
}

func (*EventMetadata) Descriptor deprecated added in v2.9.0

func (*EventMetadata) Descriptor() ([]byte, []int)

Deprecated: Use EventMetadata.ProtoReflect.Descriptor instead.

func (*EventMetadata) GetHubId added in v2.9.0

func (x *EventMetadata) GetHubId() string

func (*EventMetadata) ProtoMessage added in v2.9.0

func (*EventMetadata) ProtoMessage()

func (*EventMetadata) ProtoReflect added in v2.9.0

func (x *EventMetadata) ProtoReflect() protoreflect.Message

func (*EventMetadata) Reset added in v2.9.0

func (x *EventMetadata) Reset()

func (*EventMetadata) String added in v2.9.0

func (x *EventMetadata) String() string

type Event_DevicesRegistered

type Event_DevicesRegistered struct {
	// nats: owners.{owner}.registered
	DevicesRegistered *DevicesRegistered `protobuf:"bytes,1,opt,name=devices_registered,json=devicesRegistered,proto3,oneof"`
}

type Event_DevicesUnregistered

type Event_DevicesUnregistered struct {
	// nats: owners.{owner}.unregistered
	DevicesUnregistered *DevicesUnregistered `protobuf:"bytes,2,opt,name=devices_unregistered,json=devicesUnregistered,proto3,oneof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL