database

package
v0.0.0-...-491130e Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Types

type Comment

type Comment struct {
	CommentId  int    `json:"comment_id"`
	UserId     int    `json:"user_id"`
	Username   string `json:"username"`
	VideoId    int    `json:"video_id"`
	Content    string `json:"content"`
	CreateTime string `json:"create_time"`
}

func GetComments

func GetComments(videoId int) ([]Comment, error)

func (*Comment) Add

func (c *Comment) Add() error

type User

type User struct {
	UserId          int    `json:"user_id"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	ConfirmPassword string `json:"confirm_password"`
}

func (*User) Add

func (u *User) Add() error

func (*User) Delete

func (u *User) Delete() error

func (*User) GetByUsername

func (u *User) GetByUsername() (*User, error)

type Video

type Video struct {
	VideoId    int    `json:"video_id"`
	AuthorId   int    `json:"author_id"`
	Name       string `json:"name"`
	CategoryId int    `json:"category_id"`
	CreateTime string `json:"create_time"`
}

func GetVideoById

func GetVideoById(videoId int) (*Video, error)

func (*Video) Add

func (v *Video) Add() error

func (*Video) Delete

func (v *Video) Delete() error

func (*Video) GetByAuthorId

func (v *Video) GetByAuthorId() ([]Video, error)

Jump to

Keyboard shortcuts

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