models

package
v0.0.0-...-a23a89c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUrl

func CreateUrl(url string, size int64, t pbHelper.MediaType, userId int64) error

func ExistsUrl

func ExistsUrl(url string) bool

func GetUserUploadSizeIn24

func GetUserUploadSizeIn24(userId int64) (int64, error)

func SetUrlOwner

func SetUrlOwner(url string, owner MediaOwner) error

func SetUrlState

func SetUrlState(url string, s MediaState)

Types

type MediaOwner

type MediaOwner uint8
const (
	None MediaOwner = iota
	PhotoMedia
	VideoMedia
	MusicMedia
	ProfilePhoto
	ChannelPhoto
	VideoThumbnail
	PlaylistThumbnail
)

type MediaState

type MediaState uint8
const (
	Pinned MediaState = iota
	Ready
	Removed
)

type UrlEntry

type UrlEntry struct {
	Id        string             `bson:"_id,omitempty"`
	Url       string             `bson:"url"`
	Size      int64              `bson:"size"` /// byte
	Type      pbHelper.MediaType `bson:"media_type"`
	State     MediaState         `bson:"media_state"`
	Owner     MediaOwner         `bson:"media_owner"`
	UserId    int64              `bson:"user_id"`
	CreatedAt time.Time          `bson:"created_at"`
}

func GetUrl

func GetUrl(url string) *UrlEntry

Jump to

Keyboard shortcuts

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