subscriber

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSubscriberPB

func GetSubscriberPB(subscriberDB *Subscriber, userPB *account.Account) (*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
	JWTSigningKey []byte
}

Options are parameters passed while calling NewSubscriberAPIServer

type Subscriber

type Subscriber struct {
	ID        uint   `gorm:"primary_key"`
	Channels  []byte `gorm:"type:json"`
	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