defs

package
v0.0.0-...-bc1b0ef Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorRequestBodyParseFailed = ErrResponse{HttpSC: 400, Error: Err{Error: "Request body is not correct", ErrorCode: "001"}}
	ErrorNotAuthUser            = ErrResponse{HttpSC: 401, Error: Err{Error: "User authentication failed.", ErrorCode: "002"}}
	ErrorDBError                = ErrResponse{HttpSC: 500, Error: Err{Error: "DB ops failed", ErrorCode: "003"}}
	ErrorInternalFaults         = ErrResponse{HttpSC: 500, Error: Err{Error: "Internal service error", ErrorCode: "004"}}
)

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id      string `json:"id"`
	VideoId string `json:"video_id"`
	Author  string `json:"author"`
	Content string `json:"content"`
}

type Comments

type Comments struct {
	Comments []*Comment `json:"comments"`
}

type Err

type Err struct {
	Error     string `json:"error"`
	ErrorCode string `json:"error_code"`
}

type ErrResponse

type ErrResponse struct {
	HttpSC int
	Error  Err
}

type NewComment

type NewComment struct {
	AuthorId int    `json:"author_id"`
	Content  string `json:"content"`
}

type NewVideo

type NewVideo struct {
	AuthorId int    `json:"author_id"`
	Name     string `json:"name"`
}

type SignedIn

type SignedIn struct {
	Success   bool   `json:"success"`
	SessionId string `json:"session_id"`
}

type SignedUp

type SignedUp struct {
	Success   bool   `json:"success"`
	SessionId string `json:"session_id"`
}

response

type SimpleSession

type SimpleSession struct {
	Username string //login name
	TTL      int64
}

type User

type User struct {
	Id        int
	LoginName string
	Pwd       string
}

Data model

type UserCredential

type UserCredential struct {
	Username string `json:"user_name"`
	Pwd      string `json:"pwd"`
}

reqeusts

type UserInfo

type UserInfo struct {
	Id int `json:"id"`
}

type UserSession

type UserSession struct {
	Username  string `json:"user_name"`
	SessionId string `json:"session_id"`
}

type VideoInfo

type VideoInfo struct {
	Id           string `json:"id"`
	AuthorId     int    `json:"author_id"`
	Name         string `json:"name"`
	DisplayCtime string `json:"display_ctime"`
}

type VideosInfo

type VideosInfo struct {
	Videos []*VideoInfo `json:"videos"`
}

Jump to

Keyboard shortcuts

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