subscriber

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSubscriberPB

func GetSubscriberPB(userPB *account.Account, channels []string) (*subscriber.Subscriber, error)

GetSubscriberPB creates a proto message from subscriber model

func NewSubscriberAPIServer

func NewSubscriberAPIServer(
	ctx context.Context, opt *Options,
) (subscriber.SubscriberAPIServer, error)

NewSubscriberAPIServer factory creates a subscriber API server

Types

type Options

type Options struct {
	SQLDB         *gorm.DB
	Logger        grpclog.LoggerV2
	ChannelClient channel.ChannelAPIClient
	AccountClient account.AccountAPIClient
	AuthAPI       auth.API
}

Options are parameters passed while calling NewSubscriberAPIServer

type Subscriber

type Subscriber struct {
	ID        uint   `gorm:"primaryKey;autoIncrement"`
	UserID    string `gorm:"index;type:varchar(20);not null"`
	Channel   string `gorm:"index;type:varchar(50);not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

Subscriber is model for subscribers

func (*Subscriber) TableName

func (*Subscriber) TableName() string

TableName returns the name of the table

Jump to

Keyboard shortcuts

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