channel

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannelPB

func GetChannelPB(channelDB *Channel) (*channel.Channel, error)

GetChannelPB gets the proto message equivalence from a channel model

func NewChannelAPIServer

func NewChannelAPIServer(
	ctx context.Context, opt *Options,
) (channel.ChannelAPIServer, error)

NewChannelAPIServer is factory for creating channel APIs

Types

type Channel

type Channel struct {
	Title       string `gorm:"index;type:varchar(50);unique;not null"`
	Label       string `gorm:"index;type:varchar(50)"`
	Description string `gorm:"type:text(500);not null"`
	OwnerID     string `gorm:"type:varchar(50);not null"`
	Subscribers int32  `gorm:"type:int(10);not null"`
	gorm.Model
}

Channel is a bulk channel

func GetChannelDB

func GetChannelDB(channelPB *channel.Channel) (*Channel, error)

GetChannelDB gets the database model of a channel proto message

func (*Channel) TableName

func (*Channel) TableName() string

TableName returns the table name of the channel

type Options

type Options struct {
	SQLDBWrites      *gorm.DB
	SQLDBReads       *gorm.DB
	Logger           grpclog.LoggerV2
	PaginationHasher *hashids.HashID
	AuthAPI          auth.API
}

Options contains parameters required while creating a channel API server

Jump to

Keyboard shortcuts

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