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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMessagePB

func GetMessagePB(messageDB *Message) (*messaging.Message, error)

GetMessagePB creates proto message from message model

func NewMessagingServer

func NewMessagingServer(ctx context.Context, opt *Options) (messaging.MessagingServer, error)

NewMessagingServer is factory for creating MessagingServer APIs

Types

type Message

type Message struct {
	UserID      uint   `gorm:"index;not null"`
	Title       string `gorm:"type:varchar(256);not null"`
	Message     string `gorm:"type:varchar(2048);not null"`
	Link        string `gorm:"type:varchar(512);not null"`
	Seen        bool   `gorm:"type:tinyint(1);not null;default:0"`
	Type        int8   `gorm:"type:tinyint(1);not null;default:0"`
	SendMethods []byte `gorm:"type:json;not null"`
	Details     []byte `gorm:"type:json;null"`
	gorm.Model
}

Message model

func GetMessageDB

func GetMessageDB(messagePB *messaging.Message) (*Message, error)

GetMessageDB creates message model from proto message

func (*Message) TableName

func (*Message) TableName() string

TableName returns the name of the table

type Options

type Options struct {
	SQLDBWrites      *gorm.DB
	SQLDBReads       *gorm.DB
	Logger           grpclog.LoggerV2
	EmailSender      string
	EmailClient      emailing.EmailingClient
	CallClient       call.CallAPIClient
	PushClient       pusher.PushMessagingClient
	SMSClient        sms.SMSAPIClient
	SubscriberClient subscriber.SubscriberAPIClient
	PaginationHasher *hashids.HashID
	AuthAPI          auth.API
}

Options contains the parameters passed while calling NewMessagingServer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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