events

package
v2.3.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

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

Variables

View Source
var File_github_com_plgd_dev_hub_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
	// 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) 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
	// 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) 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 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