storage

package
v0.0.0-...-024adaa Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnString

type ConnString struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
}

type ContextKey

type ContextKey int
const ContextKeyDB ContextKey = iota + 1

type DB

type DB interface {
	GetVideosByCaption(ctx context.Context, prefix string) ([]*FoundVideo, error)
	Close()
}

func NewDB

func NewDB(connStr *ConnString) (DB, error)

type FoundVideo

type FoundVideo struct {
	Caption  string `json:"caption"`
	URI      string `json:"uri"`
	Location string `json:"location"`
}

type Video

type Video struct {
	ID          int       `gorm:"column:id"`
	UserID      int       `gorm:"column:user_id"`
	Location    string    `gorm:"column:location"`
	URI         string    `gorm:"column:uri"`
	RES         string    `gorm:"column:res"`
	Caption     string    `gorm:"column:caption"`
	Description string    `gorm:"column:description"`
	CreatedAt   time.Time `gorm:"column:created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at"`
}

Jump to

Keyboard shortcuts

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