v1

package
v0.0.0-...-2ef827d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Notifier_Connect_FullMethodName = "/core.notifier.v1.Notifier/Connect"
)

Variables

View Source
var (
	NotificationEventCode_name = map[int32]string{
		0: "NOTIFICATION_EVENT_CODE_INVALID_UNSPECIFIED",
		1: "NOTIFICATION_EVENT_CODE_DELIVERY_REQUESTED",
		2: "NOTIFICATION_EVENT_CODE_DELIVERED",
	}
	NotificationEventCode_value = map[string]int32{
		"NOTIFICATION_EVENT_CODE_INVALID_UNSPECIFIED": 0,
		"NOTIFICATION_EVENT_CODE_DELIVERY_REQUESTED":  1,
		"NOTIFICATION_EVENT_CODE_DELIVERED":           2,
	}
)

Enum value maps for NotificationEventCode.

View Source
var (
	NotificationType_name = map[int32]string{
		0: "NOTIFICATION_TYPE_INVALID_UNSPECIFIED",
		1: "NOTIFICATION_TYPE_HEARTBEAT",
	}
	NotificationType_value = map[string]int32{
		"NOTIFICATION_TYPE_INVALID_UNSPECIFIED": 0,
		"NOTIFICATION_TYPE_HEARTBEAT":           1,
	}
)

Enum value maps for NotificationType.

View Source
var File_core_notifier_v1_notifications_proto protoreflect.FileDescriptor
View Source
var File_core_notifier_v1_services_proto protoreflect.FileDescriptor
View Source
var Notifier_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "core.notifier.v1.Notifier",
	HandlerType: (*NotifierServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _Notifier_Connect_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "core/notifier/v1/services.proto",
}

Notifier_ServiceDesc is the grpc.ServiceDesc for Notifier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNotifierServer

func RegisterNotifierServer(s grpc.ServiceRegistrar, srv NotifierServer)

Types

type ConnectionRequest

type ConnectionRequest struct {
	ActorId string `protobuf:"bytes,1,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
	// `client_id` is generated by the client and if not present the request will be denied.
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

ConnectionRequest - is used for a client, to connect and receive `Notifications` from processed events in the system.

func (*ConnectionRequest) Descriptor deprecated

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

Deprecated: Use ConnectionRequest.ProtoReflect.Descriptor instead.

func (*ConnectionRequest) GetActorId

func (x *ConnectionRequest) GetActorId() string

func (*ConnectionRequest) GetClientId

func (x *ConnectionRequest) GetClientId() string

func (*ConnectionRequest) ProtoMessage

func (*ConnectionRequest) ProtoMessage()

func (*ConnectionRequest) ProtoReflect

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

func (*ConnectionRequest) Reset

func (x *ConnectionRequest) Reset()

func (*ConnectionRequest) String

func (x *ConnectionRequest) String() string

func (*ConnectionRequest) Validate

func (m *ConnectionRequest) Validate() error

Validate checks the field values on ConnectionRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ConnectionRequest) ValidateAll

func (m *ConnectionRequest) ValidateAll() error

ValidateAll checks the field values on ConnectionRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConnectionRequestMultiError, or nil if none found.

type ConnectionRequestMultiError

type ConnectionRequestMultiError []error

ConnectionRequestMultiError is an error wrapping multiple validation errors returned by ConnectionRequest.ValidateAll() if the designated constraints aren't met.

func (ConnectionRequestMultiError) AllErrors

func (m ConnectionRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConnectionRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ConnectionRequestValidationError

type ConnectionRequestValidationError struct {
	// contains filtered or unexported fields
}

ConnectionRequestValidationError is the validation error returned by ConnectionRequest.Validate if the designated constraints aren't met.

func (ConnectionRequestValidationError) Cause

Cause function returns cause value.

func (ConnectionRequestValidationError) Error

Error satisfies the builtin error interface

func (ConnectionRequestValidationError) ErrorName

ErrorName returns error name.

func (ConnectionRequestValidationError) Field

Field function returns field value.

func (ConnectionRequestValidationError) Key

Key function returns key value.

func (ConnectionRequestValidationError) Reason

Reason function returns reason value.

type Heartbeat

type Heartbeat struct {

	// users current session id
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// Time when the `UsersSession` will expire if another `Heartbeat` is not sent before.
	ExpirationDeadline int64 `protobuf:"varint,2,opt,name=expiration_deadline,json=expirationDeadline,proto3" json:"expiration_deadline,omitempty"`
	// client id
	ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// contains filtered or unexported fields
}

Heartbeat - A message sent on a consistent time interval maintaining the users session, and expiration deadline.

func (*Heartbeat) Descriptor deprecated

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

Deprecated: Use Heartbeat.ProtoReflect.Descriptor instead.

func (*Heartbeat) GetClientId

func (x *Heartbeat) GetClientId() string

func (*Heartbeat) GetExpirationDeadline

func (x *Heartbeat) GetExpirationDeadline() int64

func (*Heartbeat) GetSessionId

func (x *Heartbeat) GetSessionId() string

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) ProtoReflect

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

func (*Heartbeat) Reset

func (x *Heartbeat) Reset()

func (*Heartbeat) String

func (x *Heartbeat) String() string

func (*Heartbeat) Validate

func (m *Heartbeat) Validate() error

Validate checks the field values on Heartbeat with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Heartbeat) ValidateAll

func (m *Heartbeat) ValidateAll() error

ValidateAll checks the field values on Heartbeat with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HeartbeatMultiError, or nil if none found.

type HeartbeatMultiError

type HeartbeatMultiError []error

HeartbeatMultiError is an error wrapping multiple validation errors returned by Heartbeat.ValidateAll() if the designated constraints aren't met.

func (HeartbeatMultiError) AllErrors

func (m HeartbeatMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (HeartbeatMultiError) Error

func (m HeartbeatMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type HeartbeatValidationError

type HeartbeatValidationError struct {
	// contains filtered or unexported fields
}

HeartbeatValidationError is the validation error returned by Heartbeat.Validate if the designated constraints aren't met.

func (HeartbeatValidationError) Cause

func (e HeartbeatValidationError) Cause() error

Cause function returns cause value.

func (HeartbeatValidationError) Error

func (e HeartbeatValidationError) Error() string

Error satisfies the builtin error interface

func (HeartbeatValidationError) ErrorName

func (e HeartbeatValidationError) ErrorName() string

ErrorName returns error name.

func (HeartbeatValidationError) Field

func (e HeartbeatValidationError) Field() string

Field function returns field value.

func (HeartbeatValidationError) Key

Key function returns key value.

func (HeartbeatValidationError) Reason

func (e HeartbeatValidationError) Reason() string

Reason function returns reason value.

type Notification

type Notification struct {

	// notification type is the name of the type that is sent in the data value. This is recommended
	// given the `web-client` may want to check the message type and perform specific actions.
	NotificationType NotificationType `` /* 149-byte string literal not displayed */
	// Data for each notification will be a message found in this package that
	// is json encoded as a struct type. This main advantage to this is we will not need to
	// redeploy the server, and client when a new notification is added, the `struct` type
	// in javascript is an object
	Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// UUID providing traceability all the way through the system to client
	TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// contains filtered or unexported fields
}

A notification send to the web client

func (*Notification) Descriptor deprecated

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

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetData

func (x *Notification) GetData() string

func (*Notification) GetNotificationType

func (x *Notification) GetNotificationType() NotificationType

func (*Notification) GetTransactionId

func (x *Notification) GetTransactionId() string

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

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

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

func (*Notification) Validate

func (m *Notification) Validate() error

Validate checks the field values on Notification with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Notification) ValidateAll

func (m *Notification) ValidateAll() error

ValidateAll checks the field values on Notification with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NotificationMultiError, or nil if none found.

type NotificationDelivered

type NotificationDelivered struct {
	// contains filtered or unexported fields
}

func (*NotificationDelivered) Descriptor deprecated

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

Deprecated: Use NotificationDelivered.ProtoReflect.Descriptor instead.

func (*NotificationDelivered) ProtoMessage

func (*NotificationDelivered) ProtoMessage()

func (*NotificationDelivered) ProtoReflect

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

func (*NotificationDelivered) Reset

func (x *NotificationDelivered) Reset()

func (*NotificationDelivered) String

func (x *NotificationDelivered) String() string

func (*NotificationDelivered) Validate

func (m *NotificationDelivered) Validate() error

Validate checks the field values on NotificationDelivered with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*NotificationDelivered) ValidateAll

func (m *NotificationDelivered) ValidateAll() error

ValidateAll checks the field values on NotificationDelivered with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NotificationDeliveredMultiError, or nil if none found.

type NotificationDeliveredMultiError

type NotificationDeliveredMultiError []error

NotificationDeliveredMultiError is an error wrapping multiple validation errors returned by NotificationDelivered.ValidateAll() if the designated constraints aren't met.

func (NotificationDeliveredMultiError) AllErrors

func (m NotificationDeliveredMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NotificationDeliveredMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type NotificationDeliveredValidationError

type NotificationDeliveredValidationError struct {
	// contains filtered or unexported fields
}

NotificationDeliveredValidationError is the validation error returned by NotificationDelivered.Validate if the designated constraints aren't met.

func (NotificationDeliveredValidationError) Cause

Cause function returns cause value.

func (NotificationDeliveredValidationError) Error

Error satisfies the builtin error interface

func (NotificationDeliveredValidationError) ErrorName

ErrorName returns error name.

func (NotificationDeliveredValidationError) Field

Field function returns field value.

func (NotificationDeliveredValidationError) Key

Key function returns key value.

func (NotificationDeliveredValidationError) Reason

Reason function returns reason value.

type NotificationDeliveryRequested

type NotificationDeliveryRequested struct {

	// `actor_id` is the identifier of a actor, a message should be sent to (think phone number). For example, if it's a user connected to the notifier service with the web-client then `actor_id`
	// is equal to the `user_id` of the user.
	// Using the `actor_id` instead of a specific `user_id` field allows for many differnt types of client connections to the notifier and gives the system a common way
	// to send data to those connected clients whitout having to change the underlying datastructure when adding new clients.
	ActorId string `protobuf:"bytes,1,opt,name=actor_id,json=actorId,proto3" json:"actor_id,omitempty"`
	// optional, specify only if `unicast` to one client is desired. if empty, `multicast` to all clients associated with the `actor_id“ will be used.
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// notification is the data payload that will be sent the client.
	Notification *v1.Notification `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification,omitempty"`
	// contains filtered or unexported fields
}

NotificationDeliveryRequested is an event used to send a message to an actor connected the `notifier` service. `Multicast`, is the default delivery type and a `actor_id` is required. If `Unicast` is desired (i.e Sending a notification to only one client) Then a `client_id` should also be provided.

{
  "actor_id": "cffbbfa8-1a7e-4b64-af2e-345654b37aa7",
  "client_id": "07925e22-3eee-4931-aea9-19fc621fd825",
  "notification": "<NOTIFICATION_MESSAGE>"
}

func (*NotificationDeliveryRequested) Descriptor deprecated

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

Deprecated: Use NotificationDeliveryRequested.ProtoReflect.Descriptor instead.

func (*NotificationDeliveryRequested) GetActorId

func (x *NotificationDeliveryRequested) GetActorId() string

func (*NotificationDeliveryRequested) GetClientId

func (x *NotificationDeliveryRequested) GetClientId() string

func (*NotificationDeliveryRequested) GetNotification

func (x *NotificationDeliveryRequested) GetNotification() *v1.Notification

func (*NotificationDeliveryRequested) ProtoMessage

func (*NotificationDeliveryRequested) ProtoMessage()

func (*NotificationDeliveryRequested) ProtoReflect

func (*NotificationDeliveryRequested) Reset

func (x *NotificationDeliveryRequested) Reset()

func (*NotificationDeliveryRequested) String

func (*NotificationDeliveryRequested) Validate

func (m *NotificationDeliveryRequested) Validate() error

Validate checks the field values on NotificationDeliveryRequested with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*NotificationDeliveryRequested) ValidateAll

func (m *NotificationDeliveryRequested) ValidateAll() error

ValidateAll checks the field values on NotificationDeliveryRequested with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NotificationDeliveryRequestedMultiError, or nil if none found.

type NotificationDeliveryRequestedMultiError

type NotificationDeliveryRequestedMultiError []error

NotificationDeliveryRequestedMultiError is an error wrapping multiple validation errors returned by NotificationDeliveryRequested.ValidateAll() if the designated constraints aren't met.

func (NotificationDeliveryRequestedMultiError) AllErrors

AllErrors returns a list of validation violation errors.

func (NotificationDeliveryRequestedMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type NotificationDeliveryRequestedValidationError

type NotificationDeliveryRequestedValidationError struct {
	// contains filtered or unexported fields
}

NotificationDeliveryRequestedValidationError is the validation error returned by NotificationDeliveryRequested.Validate if the designated constraints aren't met.

func (NotificationDeliveryRequestedValidationError) Cause

Cause function returns cause value.

func (NotificationDeliveryRequestedValidationError) Error

Error satisfies the builtin error interface

func (NotificationDeliveryRequestedValidationError) ErrorName

ErrorName returns error name.

func (NotificationDeliveryRequestedValidationError) Field

Field function returns field value.

func (NotificationDeliveryRequestedValidationError) Key

Key function returns key value.

func (NotificationDeliveryRequestedValidationError) Reason

Reason function returns reason value.

type NotificationEventCode

type NotificationEventCode int32
const (
	NotificationEventCode_NOTIFICATION_EVENT_CODE_INVALID_UNSPECIFIED NotificationEventCode = 0
	NotificationEventCode_NOTIFICATION_EVENT_CODE_DELIVERY_REQUESTED  NotificationEventCode = 1
	NotificationEventCode_NOTIFICATION_EVENT_CODE_DELIVERED           NotificationEventCode = 2
)

func (NotificationEventCode) Descriptor

func (NotificationEventCode) Enum

func (NotificationEventCode) EnumDescriptor deprecated

func (NotificationEventCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use NotificationEventCode.Descriptor instead.

func (NotificationEventCode) Number

func (NotificationEventCode) String

func (x NotificationEventCode) String() string

func (NotificationEventCode) Type

type NotificationMultiError

type NotificationMultiError []error

NotificationMultiError is an error wrapping multiple validation errors returned by Notification.ValidateAll() if the designated constraints aren't met.

func (NotificationMultiError) AllErrors

func (m NotificationMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (NotificationMultiError) Error

func (m NotificationMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type NotificationType

type NotificationType int32

NotificationType - A code that communicates to a integrated client the message type that is being sent. TODO: check to see if you can add to this enum without having to redeploy the notifier service

const (
	NotificationType_NOTIFICATION_TYPE_INVALID_UNSPECIFIED NotificationType = 0
	NotificationType_NOTIFICATION_TYPE_HEARTBEAT           NotificationType = 1 // NOTE: add enum values here as needed
)

func (NotificationType) Descriptor

func (NotificationType) Enum

func (NotificationType) EnumDescriptor deprecated

func (NotificationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use NotificationType.Descriptor instead.

func (NotificationType) Number

func (NotificationType) String

func (x NotificationType) String() string

func (NotificationType) Type

type NotificationValidationError

type NotificationValidationError struct {
	// contains filtered or unexported fields
}

NotificationValidationError is the validation error returned by Notification.Validate if the designated constraints aren't met.

func (NotificationValidationError) Cause

Cause function returns cause value.

func (NotificationValidationError) Error

Error satisfies the builtin error interface

func (NotificationValidationError) ErrorName

func (e NotificationValidationError) ErrorName() string

ErrorName returns error name.

func (NotificationValidationError) Field

Field function returns field value.

func (NotificationValidationError) Key

Key function returns key value.

func (NotificationValidationError) Reason

Reason function returns reason value.

type NotifierClient

type NotifierClient interface {
	// Connect a web-client
	Connect(ctx context.Context, in *ConnectionRequest, opts ...grpc.CallOption) (Notifier_ConnectClient, error)
}

NotifierClient is the client API for Notifier service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewNotifierClient

func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient

type NotifierServer

type NotifierServer interface {
	// Connect a web-client
	Connect(*ConnectionRequest, Notifier_ConnectServer) error
}

NotifierServer is the server API for Notifier service. All implementations should embed UnimplementedNotifierServer for forward compatibility

type Notifier_ConnectClient

type Notifier_ConnectClient interface {
	Recv() (*Notification, error)
	grpc.ClientStream
}

type Notifier_ConnectServer

type Notifier_ConnectServer interface {
	Send(*Notification) error
	grpc.ServerStream
}

type UnimplementedNotifierServer

type UnimplementedNotifierServer struct {
}

UnimplementedNotifierServer should be embedded to have forward compatible implementations.

func (UnimplementedNotifierServer) Connect

type UnsafeNotifierServer

type UnsafeNotifierServer interface {
	// contains filtered or unexported methods
}

UnsafeNotifierServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotifierServer will result in compilation errors.

Jump to

Keyboard shortcuts

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