models

package
v0.0.0-...-f51a5db Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATTERN     string = "^(([0-9]+):)?([0-9]+):([0-9]+)$"
	REPLACEMENT string = "0${2}h${3}m${4}s"
	ZERO        string = "00:00:00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	ID        uint      `json:"id" gorm:"primary_key"`
	VideoID   uint      `json:"video_id" gorm:"index:idx_video"`
	Type      uint      `json:"type" gorm:"index:idx_type"`
	Title     string    `json:"title"`
	Notes     string    `json:"notes"`
	Start     TimeStamp `json:"start"`
	End       TimeStamp `json:"end"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	// Associations
	Video *Video `json:"video" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type DataAccessInterface

type DataAccessInterface interface {
	Association(string) *gorm.Association
	AutoMigrate(...interface{}) error
	Create(interface{}) *gorm.DB
	Delete(interface{}, ...interface{}) *gorm.DB
	First(interface{}, ...interface{}) *gorm.DB
	Find(interface{}, ...interface{}) *gorm.DB
	Joins(string, ...interface{}) *gorm.DB
	Model(interface{}) *gorm.DB
	Preload(string, ...interface{}) *gorm.DB
	Scan(interface{}) *gorm.DB
	Select(interface{}, ...interface{}) *gorm.DB
	Updates(interface{}) *gorm.DB
	Where(interface{}, ...interface{}) *gorm.DB
}

type MockedDataAccessInterface

type MockedDataAccessInterface interface {
	gorm.DB
	DataAccessInterface
}

type TimeStamp

type TimeStamp int64

func (*TimeStamp) MarshalJSON

func (timestamp *TimeStamp) MarshalJSON() ([]byte, error)

func (*TimeStamp) UnmarshalJSON

func (timestamp *TimeStamp) UnmarshalJSON(bytes []byte) error

type User

type User struct {
	ID        uint      `json:"id" gorm:"primary_key"`
	Nickname  string    `json:"nickname" gorm:"unique"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*User) String

func (user *User) String() string

type Video

type Video struct {
	ID          uint      `json:"id" gorm:"primary_key"`
	UserID      uint      `json:"user_id" gorm:"index:idx_user;index:unq_user_video,unique"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Link        string    `json:"link" gorm:"index:unq_user_video,unique"`
	Duration    TimeStamp `json:"duration"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" gorm:"autoUpdateTime:milli"`

	// Associations
	Annotations []Annotation `json:"annotations" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

Jump to

Keyboard shortcuts

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