messaging

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package messaging is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageType_name = map[int32]string{
		0: "ALL",
		1: "PROMOTIONAL",
		2: "REMINDER",
		3: "WARNING",
		4: "ALERT",
		5: "INFO",
	}
	MessageType_value = map[string]int32{
		"ALL":         0,
		"PROMOTIONAL": 1,
		"REMINDER":    2,
		"WARNING":     3,
		"ALERT":       4,
		"INFO":        5,
	}
)

Enum value maps for MessageType.

View Source
var (
	SendMethod_name = map[int32]string{
		0: "SEND_METHOD_UNSPECIFIED",
		1: "EMAIL",
		2: "SMSV2",
		3: "CALL",
		4: "PUSH",
	}
	SendMethod_value = map[string]int32{
		"SEND_METHOD_UNSPECIFIED": 0,
		"EMAIL":                   1,
		"SMSV2":                   2,
		"CALL":                    3,
		"PUSH":                    4,
	}
)

Enum value maps for SendMethod.

View Source
var File_messaging_proto protoreflect.FileDescriptor

Functions

func RegisterMessagingHandler

func RegisterMessagingHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMessagingHandler registers the http handlers for service Messaging to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMessagingHandlerClient

func RegisterMessagingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MessagingClient) error

RegisterMessagingHandlerClient registers the http handlers for service Messaging to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MessagingClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MessagingClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MessagingClient" to call the correct interceptors.

func RegisterMessagingHandlerFromEndpoint

func RegisterMessagingHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMessagingHandlerFromEndpoint is same as RegisterMessagingHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMessagingHandlerServer

func RegisterMessagingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MessagingServer) error

RegisterMessagingHandlerServer registers the http handlers for service Messaging to "mux". UnaryRPC :call MessagingServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMessagingHandlerFromEndpoint instead.

func RegisterMessagingServer

func RegisterMessagingServer(s grpc.ServiceRegistrar, srv MessagingServer)

Types

type BroadCastMessageRequest

type BroadCastMessageRequest struct {
	Channels        []string              `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"`
	Message         *Message              `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	SmsAuth         *sms.SMSAuth          `protobuf:"bytes,3,opt,name=sms_auth,json=smsAuth,proto3" json:"sms_auth,omitempty"`
	Sender          *emailing.EmailSender `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"`
	FetchSmsAuth    bool                  `protobuf:"varint,5,opt,name=fetch_sms_auth,json=fetchSmsAuth,proto3" json:"fetch_sms_auth,omitempty"`
	SmsCredentialId string                `protobuf:"bytes,6,opt,name=sms_credential_id,json=smsCredentialId,proto3" json:"sms_credential_id,omitempty"`
	// contains filtered or unexported fields
}

func (*BroadCastMessageRequest) Descriptor deprecated

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

Deprecated: Use BroadCastMessageRequest.ProtoReflect.Descriptor instead.

func (*BroadCastMessageRequest) GetChannels

func (x *BroadCastMessageRequest) GetChannels() []string

func (*BroadCastMessageRequest) GetFetchSmsAuth

func (x *BroadCastMessageRequest) GetFetchSmsAuth() bool

func (*BroadCastMessageRequest) GetMessage

func (x *BroadCastMessageRequest) GetMessage() *Message

func (*BroadCastMessageRequest) GetSender

func (*BroadCastMessageRequest) GetSmsAuth

func (x *BroadCastMessageRequest) GetSmsAuth() *sms.SMSAuth

func (*BroadCastMessageRequest) GetSmsCredentialId

func (x *BroadCastMessageRequest) GetSmsCredentialId() string

func (*BroadCastMessageRequest) ProtoMessage

func (*BroadCastMessageRequest) ProtoMessage()

func (*BroadCastMessageRequest) ProtoReflect

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

func (*BroadCastMessageRequest) Reset

func (x *BroadCastMessageRequest) Reset()

func (*BroadCastMessageRequest) String

func (x *BroadCastMessageRequest) String() string

type ListMessagesFilter

type ListMessagesFilter struct {
	UserId      string        `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	TypeFilters []MessageType `` /* 131-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ListMessagesFilter) Descriptor deprecated

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

Deprecated: Use ListMessagesFilter.ProtoReflect.Descriptor instead.

func (*ListMessagesFilter) GetTypeFilters

func (x *ListMessagesFilter) GetTypeFilters() []MessageType

func (*ListMessagesFilter) GetUserId

func (x *ListMessagesFilter) GetUserId() string

func (*ListMessagesFilter) ProtoMessage

func (*ListMessagesFilter) ProtoMessage()

func (*ListMessagesFilter) ProtoReflect

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

func (*ListMessagesFilter) Reset

func (x *ListMessagesFilter) Reset()

func (*ListMessagesFilter) String

func (x *ListMessagesFilter) String() string

type ListMessagesRequest

type ListMessagesRequest struct {
	PageToken string              `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32               `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Filter    *ListMessagesFilter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*ListMessagesRequest) Descriptor deprecated

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

Deprecated: Use ListMessagesRequest.ProtoReflect.Descriptor instead.

func (*ListMessagesRequest) GetFilter

func (x *ListMessagesRequest) GetFilter() *ListMessagesFilter

func (*ListMessagesRequest) GetPageSize

func (x *ListMessagesRequest) GetPageSize() int32

func (*ListMessagesRequest) GetPageToken

func (x *ListMessagesRequest) GetPageToken() string

func (*ListMessagesRequest) ProtoMessage

func (*ListMessagesRequest) ProtoMessage()

func (*ListMessagesRequest) ProtoReflect

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

func (*ListMessagesRequest) Reset

func (x *ListMessagesRequest) Reset()

func (*ListMessagesRequest) String

func (x *ListMessagesRequest) String() string

type Message

type Message struct {
	MessageId         string            `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	UserId            string            `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Title             string            `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	Data              string            `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	EmailData         string            `protobuf:"bytes,5,opt,name=email_data,json=emailData,proto3" json:"email_data,omitempty"`
	Link              string            `protobuf:"bytes,6,opt,name=link,proto3" json:"link,omitempty"`
	CreateTimeSeconds int64             `protobuf:"varint,7,opt,name=create_time_seconds,json=createTimeSeconds,proto3" json:"create_time_seconds,omitempty"`
	Seen              bool              `protobuf:"varint,8,opt,name=seen,proto3" json:"seen,omitempty"`
	Save              bool              `protobuf:"varint,9,opt,name=save,proto3" json:"save,omitempty"`
	Type              MessageType       `protobuf:"varint,10,opt,name=type,proto3,enum=gidyon.apis.MessageType" json:"type,omitempty"`
	SendMethods       []SendMethod      `` /* 131-byte string literal not displayed */
	Details           map[string]string `` /* 156-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCreateTimeSeconds

func (x *Message) GetCreateTimeSeconds() int64

func (*Message) GetData

func (x *Message) GetData() string

func (*Message) GetDetails

func (x *Message) GetDetails() map[string]string

func (*Message) GetEmailData

func (x *Message) GetEmailData() string
func (x *Message) GetLink() string

func (*Message) GetMessageId

func (x *Message) GetMessageId() string

func (*Message) GetSave

func (x *Message) GetSave() bool

func (*Message) GetSeen

func (x *Message) GetSeen() bool

func (*Message) GetSendMethods

func (x *Message) GetSendMethods() []SendMethod

func (*Message) GetTitle

func (x *Message) GetTitle() string

func (*Message) GetType

func (x *Message) GetType() MessageType

func (*Message) GetUserId

func (x *Message) GetUserId() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type MessageRequest

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

func (*MessageRequest) Descriptor deprecated

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

Deprecated: Use MessageRequest.ProtoReflect.Descriptor instead.

func (*MessageRequest) GetUserId

func (x *MessageRequest) GetUserId() string

func (*MessageRequest) ProtoMessage

func (*MessageRequest) ProtoMessage()

func (*MessageRequest) ProtoReflect

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

func (*MessageRequest) Reset

func (x *MessageRequest) Reset()

func (*MessageRequest) String

func (x *MessageRequest) String() string

type MessageType

type MessageType int32

MessageType

const (
	MessageType_ALL         MessageType = 0
	MessageType_PROMOTIONAL MessageType = 1
	MessageType_REMINDER    MessageType = 2
	MessageType_WARNING     MessageType = 3
	MessageType_ALERT       MessageType = 4
	MessageType_INFO        MessageType = 5
)

func (MessageType) Descriptor

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor deprecated

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

Deprecated: Use MessageType.Descriptor instead.

func (MessageType) Number

func (x MessageType) Number() protoreflect.EnumNumber

func (MessageType) String

func (x MessageType) String() string

func (MessageType) Type

type Messages

type Messages struct {
	Messages        []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	NextPageToken   string     `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	CollectionCount int64      `protobuf:"varint,3,opt,name=collection_count,json=collectionCount,proto3" json:"collection_count,omitempty"`
	// contains filtered or unexported fields
}

func (*Messages) Descriptor deprecated

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

Deprecated: Use Messages.ProtoReflect.Descriptor instead.

func (*Messages) GetCollectionCount

func (x *Messages) GetCollectionCount() int64

func (*Messages) GetMessages

func (x *Messages) GetMessages() []*Message

func (*Messages) GetNextPageToken

func (x *Messages) GetNextPageToken() string

func (*Messages) ProtoMessage

func (*Messages) ProtoMessage()

func (*Messages) ProtoReflect

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

func (*Messages) Reset

func (x *Messages) Reset()

func (*Messages) String

func (x *Messages) String() string

type MessagingClient

type MessagingClient interface {
	// Broadcasts a message
	BroadCastMessage(ctx context.Context, in *BroadCastMessageRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Sends message to a single destination
	SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error)
	// Retrieves a collection of messages
	ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...grpc.CallOption) (*Messages, error)
	// Updates unread messages statuses to read
	ReadAll(ctx context.Context, in *MessageRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Fetches count of new messages
	GetNewMessagesCount(ctx context.Context, in *MessageRequest, opts ...grpc.CallOption) (*NewMessagesCount, error)
}

MessagingClient is the client API for Messaging 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 NewMessagingClient

func NewMessagingClient(cc grpc.ClientConnInterface) MessagingClient

type MessagingServer

type MessagingServer interface {
	// Broadcasts a message
	BroadCastMessage(context.Context, *BroadCastMessageRequest) (*empty.Empty, error)
	// Sends message to a single destination
	SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
	// Retrieves a collection of messages
	ListMessages(context.Context, *ListMessagesRequest) (*Messages, error)
	// Updates unread messages statuses to read
	ReadAll(context.Context, *MessageRequest) (*empty.Empty, error)
	// Fetches count of new messages
	GetNewMessagesCount(context.Context, *MessageRequest) (*NewMessagesCount, error)
	// contains filtered or unexported methods
}

MessagingServer is the server API for Messaging service. All implementations must embed UnimplementedMessagingServer for forward compatibility

type NewMessagesCount

type NewMessagesCount struct {
	Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*NewMessagesCount) Descriptor deprecated

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

Deprecated: Use NewMessagesCount.ProtoReflect.Descriptor instead.

func (*NewMessagesCount) GetCount

func (x *NewMessagesCount) GetCount() int32

func (*NewMessagesCount) ProtoMessage

func (*NewMessagesCount) ProtoMessage()

func (*NewMessagesCount) ProtoReflect

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

func (*NewMessagesCount) Reset

func (x *NewMessagesCount) Reset()

func (*NewMessagesCount) String

func (x *NewMessagesCount) String() string

type SendMessageRequest

type SendMessageRequest struct {
	Message         *Message              `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	SmsAuth         *sms.SMSAuth          `protobuf:"bytes,2,opt,name=sms_auth,json=smsAuth,proto3" json:"sms_auth,omitempty"`
	Sender          *emailing.EmailSender `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"`
	FetchSmsAuth    bool                  `protobuf:"varint,5,opt,name=fetch_sms_auth,json=fetchSmsAuth,proto3" json:"fetch_sms_auth,omitempty"`
	SmsCredentialId string                `protobuf:"bytes,6,opt,name=sms_credential_id,json=smsCredentialId,proto3" json:"sms_credential_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SendMessageRequest) Descriptor deprecated

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

Deprecated: Use SendMessageRequest.ProtoReflect.Descriptor instead.

func (*SendMessageRequest) GetFetchSmsAuth

func (x *SendMessageRequest) GetFetchSmsAuth() bool

func (*SendMessageRequest) GetMessage

func (x *SendMessageRequest) GetMessage() *Message

func (*SendMessageRequest) GetSender

func (x *SendMessageRequest) GetSender() *emailing.EmailSender

func (*SendMessageRequest) GetSmsAuth

func (x *SendMessageRequest) GetSmsAuth() *sms.SMSAuth

func (*SendMessageRequest) GetSmsCredentialId

func (x *SendMessageRequest) GetSmsCredentialId() string

func (*SendMessageRequest) ProtoMessage

func (*SendMessageRequest) ProtoMessage()

func (*SendMessageRequest) ProtoReflect

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

func (*SendMessageRequest) Reset

func (x *SendMessageRequest) Reset()

func (*SendMessageRequest) String

func (x *SendMessageRequest) String() string

type SendMessageResponse

type SendMessageResponse struct {
	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// contains filtered or unexported fields
}

func (*SendMessageResponse) Descriptor deprecated

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

Deprecated: Use SendMessageResponse.ProtoReflect.Descriptor instead.

func (*SendMessageResponse) GetMessageId

func (x *SendMessageResponse) GetMessageId() string

func (*SendMessageResponse) ProtoMessage

func (*SendMessageResponse) ProtoMessage()

func (*SendMessageResponse) ProtoReflect

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

func (*SendMessageResponse) Reset

func (x *SendMessageResponse) Reset()

func (*SendMessageResponse) String

func (x *SendMessageResponse) String() string

type SendMethod

type SendMethod int32

SendMethod

const (
	SendMethod_SEND_METHOD_UNSPECIFIED SendMethod = 0
	SendMethod_EMAIL                   SendMethod = 1
	SendMethod_SMSV2                   SendMethod = 2
	SendMethod_CALL                    SendMethod = 3
	SendMethod_PUSH                    SendMethod = 4
)

func (SendMethod) Descriptor

func (SendMethod) Descriptor() protoreflect.EnumDescriptor

func (SendMethod) Enum

func (x SendMethod) Enum() *SendMethod

func (SendMethod) EnumDescriptor deprecated

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

Deprecated: Use SendMethod.Descriptor instead.

func (SendMethod) Number

func (x SendMethod) Number() protoreflect.EnumNumber

func (SendMethod) String

func (x SendMethod) String() string

func (SendMethod) Type

type UnimplementedMessagingServer

type UnimplementedMessagingServer struct {
}

UnimplementedMessagingServer must be embedded to have forward compatible implementations.

func (UnimplementedMessagingServer) BroadCastMessage

func (UnimplementedMessagingServer) GetNewMessagesCount

func (UnimplementedMessagingServer) ListMessages

func (UnimplementedMessagingServer) ReadAll

func (UnimplementedMessagingServer) SendMessage

type UnsafeMessagingServer

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

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

Directories

Path Synopsis
Package call is a reverse proxy.
Package call is a reverse proxy.
Package emailing is a reverse proxy.
Package emailing is a reverse proxy.
Package pusher is a reverse proxy.
Package pusher is a reverse proxy.
Package sms is a reverse proxy.
Package sms is a reverse proxy.

Jump to

Keyboard shortcuts

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