db

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MigrationsFS embed.FS

Functions

This section is empty.

Types

type AddChannelParams

type AddChannelParams struct {
	URL      string
	ClaimID  string
	Priority ChannelPriority
}

type AddVideoParams

type AddVideoParams struct {
	TID      string
	SDHash   string
	URL      string
	Channel  string
	Storage  string
	Path     string
	Size     int64
	Checksum sql.NullString
	Manifest pqtype.NullRawMessage
}

type Channel

type Channel struct {
	ID        int32
	CreatedAt time.Time
	URL       string
	ClaimID   string
	Priority  ChannelPriority
}

type ChannelPriority

type ChannelPriority string
const (
	ChannelPriorityHigh     ChannelPriority = "high"
	ChannelPriorityNormal   ChannelPriority = "normal"
	ChannelPriorityLow      ChannelPriority = "low"
	ChannelPriorityDisabled ChannelPriority = "disabled"
)

func (*ChannelPriority) Scan

func (e *ChannelPriority) Scan(src interface{}) error

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetAllVideosForStorageLimitParams added in v0.17.1

type GetAllVideosForStorageLimitParams struct {
	Storage string
	Limit   int32
	Offset  int32
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddChannel

func (q *Queries) AddChannel(ctx context.Context, arg AddChannelParams) (Channel, error)

func (*Queries) AddVideo

func (q *Queries) AddVideo(ctx context.Context, arg AddVideoParams) (Video, error)

func (*Queries) DeleteVideo

func (q *Queries) DeleteVideo(ctx context.Context, tid string) error

func (*Queries) GetAllChannels

func (q *Queries) GetAllChannels(ctx context.Context) ([]Channel, error)

func (*Queries) GetAllVideos

func (q *Queries) GetAllVideos(ctx context.Context) ([]Video, error)

func (*Queries) GetAllVideosForStorage

func (q *Queries) GetAllVideosForStorage(ctx context.Context, storage string) ([]Video, error)

func (*Queries) GetAllVideosForStorageLimit added in v0.17.1

func (q *Queries) GetAllVideosForStorageLimit(ctx context.Context, arg GetAllVideosForStorageLimitParams) ([]Video, error)

func (*Queries) GetChannel

func (q *Queries) GetChannel(ctx context.Context, claimID string) (Channel, error)

func (*Queries) GetVideo

func (q *Queries) GetVideo(ctx context.Context, sdHash string) (Video, error)

func (*Queries) RecordVideoAccess

func (q *Queries) RecordVideoAccess(ctx context.Context, sdHash string) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Video

type Video struct {
	ID          int32
	CreatedAt   time.Time
	UpdatedAt   sql.NullTime
	AccessedAt  time.Time
	AccessCount sql.NullInt32
	TID         string
	URL         string
	SDHash      string
	Channel     string
	Storage     string
	Path        string
	Size        int64
	Checksum    sql.NullString
	Manifest    pqtype.NullRawMessage
}

Jump to

Keyboard shortcuts

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