datatransfers

package
v0.0.0-...-d0df74b Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenInfo

type AccessTokenInfo struct {
	Active   bool   `json:"active"`
	Subject  string `json:"sub"`
	ClientID string `json:"client_id"`
}

type ChatInsert

type ChatInsert struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Hash      string             `json:"hash" bson:"hash"`
	Chat      string             `json:"chat" bson:"chat"`
	Author    string             `json:"author" bson:"author"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
}

type ChatOutgoing

type ChatOutgoing struct {
	Author    string    `json:"author"`
	Chat      string    `json:"chat"`
	CreatedAt time.Time `json:"created_at"`
}

WS chat message

type Comment

type Comment struct {
	ID        primitive.ObjectID `json:"-" bson:"_id"`
	Hash      string             `json:"-" bson:"hash"`
	Content   string             `json:"content" bson:"content"`
	Author    UserItem           `json:"author" bson:"author"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
}

type CommentBody

type CommentBody struct {
	Hash    string `json:"hash"`
	Content string `json:"content"`
}

type CommentInsert

type CommentInsert struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Hash      string             `json:"hash" bson:"hash"`
	Content   string             `json:"content" bson:"content"`
	Author    string             `json:"author" bson:"author"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
}

type Like

type Like struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Hash      string             `json:"hash" bson:"hash"`
	Author    string             `json:"author" bson:"author"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
}

type LikeBody

type LikeBody struct {
	Hash string `json:"hash"`
	Like bool   `json:"like"`
}

type NotificationOutgoing

type NotificationOutgoing struct {
	Message   string    `json:"message"`
	Name      string    `json:"name"`
	Username  string    `json:"username"`
	Hash      string    `json:"hash"`
	CreatedAt time.Time `json:"created_at"`
}

WS notification message

type Response

type Response struct {
	Data  interface{} `json:"data"`
	Error string      `json:"error,omitempty"`
	Code  int         `json:"code"`
}

API response wrapper

type SubscribeBody

type SubscribeBody struct {
	AuthorUsername string `json:"author"`
	Subscribe      bool   `json:"subscribe"`
}

type Subscription

type Subscription struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	AuthorID  string             `json:"author" bson:"author"`
	UserID    string             `json:"user" bson:"user"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
}

type Token

type Token struct {
	ID        primitive.ObjectID `json:"_id" bson:"_id"`
	Invoker   primitive.ObjectID `json:"invoker" bson:"invoker"`
	Purpose   string             `json:"purpose" bson:"purpose"`
	Hash      string             `json:"hash" bson:"hash"`
	CreatedAt time.Time          `json:"created_at,omitempty" bson:"created_at"`
}

type User

type User struct {
	ID        string    `json:"id" bson:"_id"`
	Username  string    `json:"username" bson:"username"`
	Name      string    `json:"name" bson:"name"`
	CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at"`
}

type UserDetail

type UserDetail struct {
	ID          string `json:"id"`
	Username    string `json:"username"`
	Name        string `json:"name"`
	Subscribers int    `json:"subscribers" bson:"subscribers"`
	Views       int    `json:"views" bson:"views"`
	Uploads     int    `json:"uploads" bson:"uploads"`
}

type UserItem

type UserItem struct {
	ID          string `json:"-" bson:"_id"`
	Username    string `json:"username" bson:"username"`
	Name        string `json:"name" bson:"name"`
	Subscribers int    `json:"subscribers" bson:"subscribers"`
}

type UserRegister

type UserRegister struct {
	IDToken string `json:"id_token"`
}

type Video

type Video struct {
	ID          primitive.ObjectID `json:"-" bson:"_id"`
	Hash        string             `json:"hash" bson:"hash"` // used for querying
	Type        string             `json:"type" bson:"type"` // "live" or "vod"
	Title       string             `json:"title" bson:"title"`
	Author      UserItem           `json:"author" bson:"author"`
	Description string             `json:"description" bson:"description"`
	Tags        []string           `json:"tags" bson:"tags"`
	Views       int                `json:"views" bson:"views"`
	Duration    int64              `json:"duration,omitempty" bson:"duration"` // only for VODs
	IsLive      bool               `json:"is_live" bson:"is_live"`             // only for Live
	Unlisted    bool               `json:"unlisted" bson:"unlisted"`
	Pending     bool               `json:"pending" bson:"pending"`
	Resolutions int                `json:"resolutions" bson:"resolutions"` // 0:None, 1:180p, 2:360p, 3:480p, 4:720p, 5:1080p, only for VODs
	Likes       int                `json:"likes" bson:"likes"`
	Liked       bool               `json:"liked" bson:"-"`
	Subscribed  bool               `json:"subscribed" bson:"-"`
	Comments    []Comment          `json:"comments" bson:"-"`
	CreatedAt   time.Time          `json:"created_at" bson:"created_at"`
}

type VideoEdit

type VideoEdit struct {
	Hash        string
	Title       string
	Description string
	Tags        []string
	Unlisted    bool
}

type VideoEditForm

type VideoEditForm struct {
	Hash        string `form:"hash"`
	Title       string `form:"title"`
	Description string `form:"description"`
	Tags        string `form:"tags"`
	Unlisted    bool   `form:"unlisted"`
}

type VideoInsert

type VideoInsert struct {
	ID          primitive.ObjectID `bson:"_id"`
	Hash        string             `bson:"hash"` // used for querying
	Type        string             `bson:"type"` // "live" or "vod"
	Title       string             `bson:"title"`
	Author      string             `bson:"author"`
	Description string             `bson:"description"`
	Tags        []string           `bson:"tags"`
	Views       int                `json:"views" bson:"views"`
	IsLive      bool               `bson:"is_live"` // only for Live, always set to true for VODs
	Unlisted    bool               `bson:"unlisted"`
	Resolutions int                `bson:"resolutions"` // 0:None, 1:180p, 2:360p, 3:480p, 4:720p, 5:1080p, only for VODs
	CreatedAt   time.Time          `bson:"created_at"`
}

type VideoUpload

type VideoUpload struct {
	Title       string
	Description string
	Tags        []string
	Unlisted    bool
}

type VideoUploadForm

type VideoUploadForm struct {
	Title       string `form:"title"`
	Description string `form:"description"`
	Tags        string `form:"tags"`
	Unlisted    bool   `form:"unlisted"`
}

type WebSocketMessage

type WebSocketMessage struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
	Code int         `json:"code"`
}

WS message wrapper

Jump to

Keyboard shortcuts

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