db

package
v0.0.0-...-9bdafd8 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CreateVideo

func CreateVideo(ctx context.Context, videos []*Video) error

func Init

func Init()

Init init DB

Types

type Video

type Video struct {
	gorm.Model
	AuthorID  int64
	PublishAt int64
	PlayURL   string
	CoverURL  string
	Title     string
}

func QueryVideBeforeTime

func QueryVideBeforeTime(ctx context.Context, time int64) ([]*Video, error)

func QueryVideoByAuthorID

func QueryVideoByAuthorID(ctx context.Context, authorID int64) ([]*Video, error)

func QueryVideoByID

func QueryVideoByID(ctx context.Context, videoID int64) ([]*Video, error)

func (*Video) TableName

func (u *Video) TableName() string

Jump to

Keyboard shortcuts

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