db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPlaybackReportParams

type AddPlaybackReportParams struct {
	AssetID   pgtype.UUID `json:"asset_id"`
	Code      string      `json:"code"`
	Ip        string      `json:"ip"`
	Country   string      `json:"country"`
	UserAgent string      `json:"user_agent"`
	Plays     bool        `json:"plays"`
	Results   []byte      `json:"results"`
}

type ApplyLibraryDefaultsParams

type ApplyLibraryDefaultsParams struct {
	Apply []string    `json:"apply"`
	ID    pgtype.UUID `json:"id"`
}

type Asset

type Asset struct {
	ID               pgtype.UUID        `json:"id"`
	TenantID         pgtype.UUID        `json:"tenant_id"`
	UploadID         pgtype.UUID        `json:"upload_id"`
	Status           string             `json:"status"`
	ErrorCode        pgtype.Text        `json:"error_code"`
	Passthrough      pgtype.Text        `json:"passthrough"`
	SourceKey        string             `json:"source_key"`
	Probe            []byte             `json:"probe"`
	DurationSeconds  pgtype.Float8      `json:"duration_seconds"`
	Width            pgtype.Int4        `json:"width"`
	Height           pgtype.Int4        `json:"height"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	Plan             []byte             `json:"plan"`
	EncryptionKey    []byte             `json:"encryption_key"`
	EncryptionIv     []byte             `json:"encryption_iv"`
	SourceDeletedAt  pgtype.Timestamptz `json:"source_deleted_at"`
	InputUrl         pgtype.Text        `json:"input_url"`
	Download         pgtype.Text        `json:"download"`
	Captions         []byte             `json:"captions"`
	LibraryID        pgtype.UUID        `json:"library_id"`
	FolderID         pgtype.UUID        `json:"folder_id"`
	Title            string             `json:"title"`
	DeletedAt        pgtype.Timestamptz `json:"deleted_at"`
	Description      string             `json:"description"`
	Tags             []string           `json:"tags"`
	Metadata         []byte             `json:"metadata"`
	Chapters         []byte             `json:"chapters"`
	PlaybackPolicy   string             `json:"playback_policy"`
	PosterTime       pgtype.Float8      `json:"poster_time"`
	PosterUploadedAt pgtype.Timestamptz `json:"poster_uploaded_at"`
	Timeline         []byte             `json:"timeline"`
}

type AssetPresetRow

type AssetPresetRow struct {
	PresetTemplate string      `json:"preset_template"`
	Heights        []int32     `json:"heights"`
	Quality        pgtype.Text `json:"quality"`
}

type CountAssetsParams

type CountAssetsParams struct {
	Status     string      `json:"status"`
	Pattern    string      `json:"pattern"`
	Tag        string      `json:"tag"`
	Meta       []byte      `json:"meta"`
	LibraryID  pgtype.UUID `json:"library_id"`
	FolderMode string      `json:"folder_mode"`
	FolderID   pgtype.UUID `json:"folder_id"`
	Trashed    bool        `json:"trashed"`
	Policy     string      `json:"policy"`
}

type CreateAssetParams

type CreateAssetParams struct {
	ID             pgtype.UUID `json:"id"`
	UploadID       pgtype.UUID `json:"upload_id"`
	Status         string      `json:"status"`
	Passthrough    pgtype.Text `json:"passthrough"`
	SourceKey      string      `json:"source_key"`
	InputUrl       pgtype.Text `json:"input_url"`
	LibraryID      pgtype.UUID `json:"library_id"`
	FolderID       pgtype.UUID `json:"folder_id"`
	Title          string      `json:"title"`
	PlaybackPolicy string      `json:"playback_policy"`
}

type CreateAssetRow

type CreateAssetRow struct {
	ID              pgtype.UUID        `json:"id"`
	Status          string             `json:"status"`
	ErrorCode       pgtype.Text        `json:"error_code"`
	Passthrough     pgtype.Text        `json:"passthrough"`
	DurationSeconds pgtype.Float8      `json:"duration_seconds"`
	Width           pgtype.Int4        `json:"width"`
	Height          pgtype.Int4        `json:"height"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type CreateCaptionParams

type CreateCaptionParams struct {
	Language string      `json:"language"`
	Name     string      `json:"name"`
	AssetID  pgtype.UUID `json:"asset_id"`
	Max      int32       `json:"max"`
}

type CreateCaptionRow

type CreateCaptionRow struct {
	ID        pgtype.UUID        `json:"id"`
	TenantID  pgtype.UUID        `json:"tenant_id"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Language  string             `json:"language"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CreateFolderParams

type CreateFolderParams struct {
	LibraryID pgtype.UUID `json:"library_id"`
	ParentID  pgtype.UUID `json:"parent_id"`
	Name      string      `json:"name"`
}

type CreateJobParams

type CreateJobParams struct {
	AssetID pgtype.UUID `json:"asset_id"`
	Type    string      `json:"type"`
}

type CreateLibraryParams

type CreateLibraryParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type CreatePresetParams

type CreatePresetParams struct {
	LibraryID   pgtype.UUID `json:"library_id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Heights     []int32     `json:"heights"`
	Quality     string      `json:"quality"`
}

type CreateSigningKeyRow

type CreateSigningKeyRow struct {
	ID        pgtype.UUID        `json:"id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CreateUploadRow

type CreateUploadRow struct {
	ID        pgtype.UUID        `json:"id"`
	Status    string             `json:"status"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteCaptionParams

type DeleteCaptionParams struct {
	ID      string      `json:"id"`
	AssetID pgtype.UUID `json:"asset_id"`
}

type ExpiredUploadsRow

type ExpiredUploadsRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	UploadID pgtype.UUID `json:"upload_id"`
	AssetID  pgtype.UUID `json:"asset_id"`
}

type FailAssetIfUnplayableParams

type FailAssetIfUnplayableParams struct {
	ErrorCode pgtype.Text `json:"error_code"`
	ID        pgtype.UUID `json:"id"`
}

type FinishAssetDownloadParams

type FinishAssetDownloadParams struct {
	Download pgtype.Text `json:"download"`
	ID       pgtype.UUID `json:"id"`
}

type FinishJobParams

type FinishJobParams struct {
	Status    string      `json:"status"`
	ErrorCode pgtype.Text `json:"error_code"`
	ID        pgtype.UUID `json:"id"`
}

type GetAssetTechnicalRow

type GetAssetTechnicalRow struct {
	Probe           []byte             `json:"probe"`
	Plan            []byte             `json:"plan"`
	EncryptionIv    []byte             `json:"encryption_iv"`
	SourceDeletedAt pgtype.Timestamptz `json:"source_deleted_at"`
}

type GetAssetWorkRow

type GetAssetWorkRow struct {
	SourceKey       string        `json:"source_key"`
	Plan            []byte        `json:"plan"`
	DurationSeconds pgtype.Float8 `json:"duration_seconds"`
	EncryptionKey   []byte        `json:"encryption_key"`
	EncryptionIv    []byte        `json:"encryption_iv"`
}

type GetFolderRow

type GetFolderRow struct {
	ID        pgtype.UUID `json:"id"`
	LibraryID pgtype.UUID `json:"library_id"`
	ParentID  pgtype.UUID `json:"parent_id"`
	Name      string      `json:"name"`
}

type GetJobRow

type GetJobRow struct {
	ID        pgtype.UUID        `json:"id"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Type      string             `json:"type"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type GetPlaybackReportRow

type GetPlaybackReportRow struct {
	Code      string             `json:"code"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Title     string             `json:"title"`
	Ip        string             `json:"ip"`
	Country   string             `json:"country"`
	UserAgent string             `json:"user_agent"`
	Plays     bool               `json:"plays"`
	Results   []byte             `json:"results"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type GetPresetRow

type GetPresetRow struct {
	ID          pgtype.UUID `json:"id"`
	LibraryID   pgtype.UUID `json:"library_id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Heights     []int32     `json:"heights"`
	Quality     string      `json:"quality"`
}

type GetVideoDefaultsRow

type GetVideoDefaultsRow struct {
	Player                []byte   `json:"player"`
	PresetTemplate        string   `json:"preset_template"`
	Mp4Downloads          bool     `json:"mp4_downloads"`
	AllowedDomains        []string `json:"allowed_domains"`
	BlockedDomains        []string `json:"blocked_domains"`
	CountryMode           string   `json:"country_mode"`
	Countries             []string `json:"countries"`
	DefaultPlaybackPolicy string   `json:"default_playback_policy"`
}

type GetVideoDeliveryRow

type GetVideoDeliveryRow struct {
	Mode              string      `json:"mode"`
	CustomUrl         pgtype.Text `json:"custom_url"`
	Provider          string      `json:"provider"`
	CdnDistributionID pgtype.UUID `json:"cdn_distribution_id"`
}

type HasCaptionParams

type HasCaptionParams struct {
	AssetID pgtype.UUID `json:"asset_id"`
	ID      string      `json:"id"`
}

type LatestSigningKeyRow

type LatestSigningKeyRow struct {
	ID     pgtype.UUID `json:"id"`
	Secret []byte      `json:"secret"`
}

type LibraryDefaultsRow

type LibraryDefaultsRow struct {
	DefaultPlaybackPolicy string `json:"default_playback_policy"`
	Mp4Downloads          bool   `json:"mp4_downloads"`
}

type ListAssetJobsRow

type ListAssetJobsRow struct {
	ID        pgtype.UUID        `json:"id"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Type      string             `json:"type"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type ListAssetsOldestParams

type ListAssetsOldestParams struct {
	Status     string             `json:"status"`
	Pattern    string             `json:"pattern"`
	Tag        string             `json:"tag"`
	Meta       []byte             `json:"meta"`
	LibraryID  pgtype.UUID        `json:"library_id"`
	FolderMode string             `json:"folder_mode"`
	FolderID   pgtype.UUID        `json:"folder_id"`
	Trashed    bool               `json:"trashed"`
	Policy     string             `json:"policy"`
	AfterAt    pgtype.Timestamptz `json:"after_at"`
	AfterID    pgtype.UUID        `json:"after_id"`
	Lim        int32              `json:"lim"`
}

type ListAssetsParams

type ListAssetsParams struct {
	Status     string             `json:"status"`
	Pattern    string             `json:"pattern"`
	Tag        string             `json:"tag"`
	Meta       []byte             `json:"meta"`
	LibraryID  pgtype.UUID        `json:"library_id"`
	FolderMode string             `json:"folder_mode"`
	FolderID   pgtype.UUID        `json:"folder_id"`
	Trashed    bool               `json:"trashed"`
	Policy     string             `json:"policy"`
	AfterAt    pgtype.Timestamptz `json:"after_at"`
	AfterID    pgtype.UUID        `json:"after_id"`
	Lim        int32              `json:"lim"`
}

type ListCaptionsRow

type ListCaptionsRow struct {
	ID        pgtype.UUID        `json:"id"`
	TenantID  pgtype.UUID        `json:"tenant_id"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Language  string             `json:"language"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListFoldersRow

type ListFoldersRow struct {
	ID        pgtype.UUID        `json:"id"`
	LibraryID pgtype.UUID        `json:"library_id"`
	ParentID  pgtype.UUID        `json:"parent_id"`
	Name      string             `json:"name"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Videos    int32              `json:"videos"`
}

type ListLibrariesPageParams

type ListLibrariesPageParams struct {
	Pattern string             `json:"pattern"`
	AfterAt pgtype.Timestamptz `json:"after_at"`
	AfterID pgtype.UUID        `json:"after_id"`
	Lim     int32              `json:"lim"`
}

type ListLibrariesPageRow

type ListLibrariesPageRow struct {
	ID                    pgtype.UUID        `json:"id"`
	Name                  string             `json:"name"`
	Description           string             `json:"description"`
	IsDefault             bool               `json:"is_default"`
	DefaultPlaybackPolicy string             `json:"default_playback_policy"`
	PresetTemplate        string             `json:"preset_template"`
	PresetID              pgtype.UUID        `json:"preset_id"`
	Mp4Downloads          bool               `json:"mp4_downloads"`
	AllowedDomains        []string           `json:"allowed_domains"`
	BlockedDomains        []string           `json:"blocked_domains"`
	CountryMode           string             `json:"country_mode"`
	Countries             []string           `json:"countries"`
	Player                []byte             `json:"player"`
	Inherits              []string           `json:"inherits"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
	Videos                int32              `json:"videos"`
	Trashed               int32              `json:"trashed"`
	Minutes               float64            `json:"minutes"`
	StorageBytes          int64              `json:"storage_bytes"`
	ReadyVideos           int32              `json:"ready_videos"`
	ProcessingVideos      int32              `json:"processing_videos"`
	ErroredVideos         int32              `json:"errored_videos"`
}

type ListLibrariesRow

type ListLibrariesRow struct {
	ID                    pgtype.UUID        `json:"id"`
	Name                  string             `json:"name"`
	Description           string             `json:"description"`
	IsDefault             bool               `json:"is_default"`
	DefaultPlaybackPolicy string             `json:"default_playback_policy"`
	PresetTemplate        string             `json:"preset_template"`
	PresetID              pgtype.UUID        `json:"preset_id"`
	Mp4Downloads          bool               `json:"mp4_downloads"`
	AllowedDomains        []string           `json:"allowed_domains"`
	BlockedDomains        []string           `json:"blocked_domains"`
	CountryMode           string             `json:"country_mode"`
	Countries             []string           `json:"countries"`
	Player                []byte             `json:"player"`
	Inherits              []string           `json:"inherits"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
	Videos                int32              `json:"videos"`
	Trashed               int32              `json:"trashed"`
	Minutes               float64            `json:"minutes"`
	StorageBytes          int64              `json:"storage_bytes"`
	ReadyVideos           int32              `json:"ready_videos"`
	ProcessingVideos      int32              `json:"processing_videos"`
	ErroredVideos         int32              `json:"errored_videos"`
}

type ListPlaybackReportsParams

type ListPlaybackReportsParams struct {
	AssetID   pgtype.UUID        `json:"asset_id"`
	AfterAt   pgtype.Timestamptz `json:"after_at"`
	AfterCode pgtype.Text        `json:"after_code"`
	Lim       int32              `json:"lim"`
}

type ListPlaybackReportsRow

type ListPlaybackReportsRow struct {
	Code      string             `json:"code"`
	Ip        string             `json:"ip"`
	Country   string             `json:"country"`
	UserAgent string             `json:"user_agent"`
	Plays     bool               `json:"plays"`
	Results   []byte             `json:"results"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListPresetsRow

type ListPresetsRow struct {
	ID          pgtype.UUID        `json:"id"`
	LibraryID   pgtype.UUID        `json:"library_id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Heights     []int32            `json:"heights"`
	Quality     string             `json:"quality"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type ListSigningKeysParams

type ListSigningKeysParams struct {
	Pattern string             `json:"pattern"`
	AfterAt pgtype.Timestamptz `json:"after_at"`
	AfterID pgtype.UUID        `json:"after_id"`
	Lim     int32              `json:"lim"`
}

type ListSigningKeysRow

type ListSigningKeysRow struct {
	ID        pgtype.UUID        `json:"id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type LockUploadRow

type LockUploadRow struct {
	ID        pgtype.UUID        `json:"id"`
	AssetID   pgtype.UUID        `json:"asset_id"`
	Status    string             `json:"status"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type MoveAssetsParams

type MoveAssetsParams struct {
	LibraryID pgtype.UUID   `json:"library_id"`
	FolderID  pgtype.UUID   `json:"folder_id"`
	Ids       []pgtype.UUID `json:"ids"`
}

type MoveFolderParams

type MoveFolderParams struct {
	ParentID pgtype.UUID `json:"parent_id"`
	ID       pgtype.UUID `json:"id"`
}

type NoticeFailedVideosRow

type NoticeFailedVideosRow struct {
	N      int64              `json:"n"`
	Latest pgtype.Timestamptz `json:"latest"`
}

type PlaybackAssetRow

type PlaybackAssetRow struct {
	Status           string             `json:"status"`
	EncryptionKey    []byte             `json:"encryption_key"`
	Plan             []byte             `json:"plan"`
	DurationSeconds  pgtype.Float8      `json:"duration_seconds"`
	Download         pgtype.Text        `json:"download"`
	Passthrough      pgtype.Text        `json:"passthrough"`
	PosterTime       pgtype.Float8      `json:"poster_time"`
	PosterUploadedAt pgtype.Timestamptz `json:"poster_uploaded_at"`
}

type PlayerLibraryRow

type PlayerLibraryRow struct {
	ID             pgtype.UUID `json:"id"`
	Name           string      `json:"name"`
	AllowedDomains []string    `json:"allowed_domains"`
	BlockedDomains []string    `json:"blocked_domains"`
	CountryMode    string      `json:"country_mode"`
	Countries      []string    `json:"countries"`
	Player         []byte      `json:"player"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddPlaybackReport

func (q *Queries) AddPlaybackReport(ctx context.Context, arg AddPlaybackReportParams) error

func (*Queries) ApplyLibraryDefaults

func (q *Queries) ApplyLibraryDefaults(ctx context.Context, arg ApplyLibraryDefaultsParams) (int64, error)

Copies the workspace defaults of the groups in apply into the library and makes it follow them.

func (*Queries) AssetPreset

func (q *Queries) AssetPreset(ctx context.Context, id pgtype.UUID) (AssetPresetRow, error)

The preset a video is encoded with: the library's custom one, else its template (heights and quality null).

func (*Queries) CompleteUpload

func (q *Queries) CompleteUpload(ctx context.Context, assetID pgtype.UUID) (pgtype.UUID, error)

func (*Queries) CountAssets

func (q *Queries) CountAssets(ctx context.Context, arg CountAssetsParams) (int64, error)

func (*Queries) CountLibraries

func (q *Queries) CountLibraries(ctx context.Context, pattern string) (int64, error)

func (*Queries) CountPlaybackReports

func (q *Queries) CountPlaybackReports(ctx context.Context, assetID pgtype.UUID) (int64, error)

func (*Queries) CountSigningKeys

func (q *Queries) CountSigningKeys(ctx context.Context, pattern string) (int64, error)

func (*Queries) CreateAsset

func (q *Queries) CreateAsset(ctx context.Context, arg CreateAssetParams) (CreateAssetRow, error)

func (*Queries) CreateCaption

func (q *Queries) CreateCaption(ctx context.Context, arg CreateCaptionParams) (CreateCaptionRow, error)

Captions live on the video (assets.captions); these read and change that list in one statement each. Adds a track unless the video already has max; no row means it's full.

func (*Queries) CreateFolder

func (q *Queries) CreateFolder(ctx context.Context, arg CreateFolderParams) (pgtype.UUID, error)

func (*Queries) CreateJob

func (q *Queries) CreateJob(ctx context.Context, arg CreateJobParams) (pgtype.UUID, error)

func (*Queries) CreateLibrary

func (q *Queries) CreateLibrary(ctx context.Context, arg CreateLibraryParams) (pgtype.UUID, error)

func (*Queries) CreatePreset

func (q *Queries) CreatePreset(ctx context.Context, arg CreatePresetParams) (pgtype.UUID, error)

func (*Queries) CreateSigningKey

func (q *Queries) CreateSigningKey(ctx context.Context, secret []byte) (CreateSigningKeyRow, error)

func (*Queries) CreateUpload

func (q *Queries) CreateUpload(ctx context.Context) (CreateUploadRow, error)

func (*Queries) DeleteAsset

func (q *Queries) DeleteAsset(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) DeleteCaption

func (q *Queries) DeleteCaption(ctx context.Context, arg DeleteCaptionParams) (int64, error)

func (*Queries) DeleteFolder

func (q *Queries) DeleteFolder(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) DeleteLibrary

func (q *Queries) DeleteLibrary(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) DeletePreset

func (q *Queries) DeletePreset(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) DeleteSigningKey

func (q *Queries) DeleteSigningKey(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) EnsureDefaultLibrary

func (q *Queries) EnsureDefaultLibrary(ctx context.Context) (pgtype.UUID, error)

The default library ("Main") exists for every workspace; this makes it for one made after the migration.

func (*Queries) EnsureVideoDefaults

func (q *Queries) EnsureVideoDefaults(ctx context.Context) error

func (*Queries) ExpirePlaybackReports

func (q *Queries) ExpirePlaybackReports(ctx context.Context) (int64, error)

func (*Queries) ExpireUpload

func (q *Queries) ExpireUpload(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) ExpiredUploads

func (q *Queries) ExpiredUploads(ctx context.Context, maxRows int32) ([]ExpiredUploadsRow, error)

func (*Queries) FailAssetIfUnplayable

func (q *Queries) FailAssetIfUnplayable(ctx context.Context, arg FailAssetIfUnplayableParams) (int64, error)

A failure errors the asset only while nothing is playable; a ready asset keeps playing.

func (*Queries) FinishAssetDownload

func (q *Queries) FinishAssetDownload(ctx context.Context, arg FinishAssetDownloadParams) (int64, error)

A finished download lands only if it's still wanted: turning it off meanwhile leaves nothing to mark.

func (*Queries) FinishJob

func (q *Queries) FinishJob(ctx context.Context, arg FinishJobParams) (int64, error)

func (*Queries) FolderSubtree

func (q *Queries) FolderSubtree(ctx context.Context, id pgtype.UUID) ([]pgtype.UUID, error)

A folder and everything under it.

func (*Queries) GetAsset

func (q *Queries) GetAsset(ctx context.Context, id pgtype.UUID) (Asset, error)

func (*Queries) GetAssetTechnical

func (q *Queries) GetAssetTechnical(ctx context.Context, id pgtype.UUID) (GetAssetTechnicalRow, error)

func (*Queries) GetAssetWork

func (q *Queries) GetAssetWork(ctx context.Context, id pgtype.UUID) (GetAssetWorkRow, error)

func (*Queries) GetFolder

func (q *Queries) GetFolder(ctx context.Context, id pgtype.UUID) (GetFolderRow, error)

func (*Queries) GetJob

func (q *Queries) GetJob(ctx context.Context, id pgtype.UUID) (GetJobRow, error)

func (*Queries) GetPlaybackReport

func (q *Queries) GetPlaybackReport(ctx context.Context, code string) (GetPlaybackReportRow, error)

func (*Queries) GetPreset

func (q *Queries) GetPreset(ctx context.Context, id pgtype.UUID) (GetPresetRow, error)

func (*Queries) GetSigningSecret

func (q *Queries) GetSigningSecret(ctx context.Context, id pgtype.UUID) ([]byte, error)

func (*Queries) GetVideoDefaults

func (q *Queries) GetVideoDefaults(ctx context.Context) (GetVideoDefaultsRow, error)

func (*Queries) GetVideoDelivery

func (q *Queries) GetVideoDelivery(ctx context.Context) (GetVideoDeliveryRow, error)

func (*Queries) HasCaption

func (q *Queries) HasCaption(ctx context.Context, arg HasCaptionParams) (bool, error)

func (*Queries) IngestJobID

func (q *Queries) IngestJobID(ctx context.Context, assetID pgtype.UUID) (pgtype.UUID, error)

func (*Queries) LatestSigningKey

func (q *Queries) LatestSigningKey(ctx context.Context) (LatestSigningKeyRow, error)

func (*Queries) LibraryAssetCount

func (q *Queries) LibraryAssetCount(ctx context.Context, id pgtype.UUID) (int32, error)

func (*Queries) LibraryDefaults

func (q *Queries) LibraryDefaults(ctx context.Context, id pgtype.UUID) (LibraryDefaultsRow, error)

func (*Queries) ListAssetJobs

func (q *Queries) ListAssetJobs(ctx context.Context, assetID pgtype.UUID) ([]ListAssetJobsRow, error)

func (*Queries) ListAssets

func (q *Queries) ListAssets(ctx context.Context, arg ListAssetsParams) ([]Asset, error)

Searches the title, reference and id; status ” means any, or a comma-separated list of states. folder_mode: any (the whole library), root (Home only) or folder (that folder). trashed picks the trash instead of the live videos. Newest first, continuing after the (after_at, after_id) row: cursor pages stay right while videos are added.

func (*Queries) ListAssetsOldest

func (q *Queries) ListAssetsOldest(ctx context.Context, arg ListAssetsOldestParams) ([]Asset, error)

The same, oldest first (the cursor continues after the (after_at, after_id) row going forward).

func (*Queries) ListCaptions

func (q *Queries) ListCaptions(ctx context.Context, assetID pgtype.UUID) ([]ListCaptionsRow, error)

func (*Queries) ListFolders

func (q *Queries) ListFolders(ctx context.Context, libraryID pgtype.UUID) ([]ListFoldersRow, error)

func (*Queries) ListLibraries

func (q *Queries) ListLibraries(ctx context.Context, id pgtype.UUID) ([]ListLibrariesRow, error)

func (*Queries) ListLibrariesPage

func (q *Queries) ListLibrariesPage(ctx context.Context, arg ListLibrariesPageParams) ([]ListLibrariesPageRow, error)

The console's list: searches the name and description, newest first, continuing after the (after_at, after_id) row.

func (*Queries) ListPlaybackReports

func (q *Queries) ListPlaybackReports(ctx context.Context, arg ListPlaybackReportsParams) ([]ListPlaybackReportsRow, error)

func (*Queries) ListPresets

func (q *Queries) ListPresets(ctx context.Context, libraryID pgtype.UUID) ([]ListPresetsRow, error)

func (*Queries) ListSigningKeys

func (q *Queries) ListSigningKeys(ctx context.Context, arg ListSigningKeysParams) ([]ListSigningKeysRow, error)

func (*Queries) LockAsset

func (q *Queries) LockAsset(ctx context.Context, id pgtype.UUID) (string, error)

func (*Queries) LockUpload

func (q *Queries) LockUpload(ctx context.Context, id pgtype.UUID) (LockUploadRow, error)

func (*Queries) MarkAssetComplete

func (q *Queries) MarkAssetComplete(ctx context.Context, id pgtype.UUID) (int64, error)

Straight to complete also became playable now; an earlier playable time stays.

func (*Queries) MarkAssetReady

func (q *Queries) MarkAssetReady(ctx context.Context, id pgtype.UUID) (int64, error)

func (*Queries) MarkSourceDeleted

func (q *Queries) MarkSourceDeleted(ctx context.Context, id pgtype.UUID) error

func (*Queries) MoveAssets

func (q *Queries) MoveAssets(ctx context.Context, arg MoveAssetsParams) (int64, error)

func (*Queries) MoveFolder

func (q *Queries) MoveFolder(ctx context.Context, arg MoveFolderParams) (int64, error)

func (*Queries) NoticeFailedVideos

func (q *Queries) NoticeFailedVideos(ctx context.Context) (NoticeFailedVideosRow, error)

func (*Queries) PendingEncodeMinutes

func (q *Queries) PendingEncodeMinutes(ctx context.Context, excludeAsset pgtype.UUID) (float64, error)

Videos accepted but not finished: their minutes count once encoded.

func (*Queries) PlaybackAsset

func (q *Queries) PlaybackAsset(ctx context.Context, id pgtype.UUID) (PlaybackAssetRow, error)

func (*Queries) PlayerLibrary

func (q *Queries) PlayerLibrary(ctx context.Context, id pgtype.UUID) (PlayerLibraryRow, error)

What the player needs: the video's library settings, looked up through its asset.

func (*Queries) PresetInUse

func (q *Queries) PresetInUse(ctx context.Context, id pgtype.UUID) (bool, error)

func (*Queries) PropagateVideoDefaults

func (q *Queries) PropagateVideoDefaults(ctx context.Context) error

Pushes the defaults into every library, group by group, where the library follows that group.

func (*Queries) RecentPlaybackReport

func (q *Queries) RecentPlaybackReport(ctx context.Context, arg RecentPlaybackReportParams) (bool, error)

func (*Queries) RenameFolder

func (q *Queries) RenameFolder(ctx context.Context, arg RenameFolderParams) (int64, error)

func (*Queries) RequeueIngestJob

func (q *Queries) RequeueIngestJob(ctx context.Context, assetID pgtype.UUID) (int64, error)

func (*Queries) RestoreAssets

func (q *Queries) RestoreAssets(ctx context.Context, ids []pgtype.UUID) (int64, error)

func (*Queries) RetryAsset

func (q *Queries) RetryAsset(ctx context.Context, id pgtype.UUID) (pgtype.UUID, error)

A failed video whose original is still kept goes back to processing; no row otherwise.

func (*Queries) SetAssetChapters

func (q *Queries) SetAssetChapters(ctx context.Context, arg SetAssetChaptersParams) error

func (*Queries) SetAssetDetails

func (q *Queries) SetAssetDetails(ctx context.Context, arg SetAssetDetailsParams) error

func (*Queries) SetAssetDownload

func (q *Queries) SetAssetDownload(ctx context.Context, arg SetAssetDownloadParams) (int64, error)

func (*Queries) SetAssetPlan

func (q *Queries) SetAssetPlan(ctx context.Context, arg SetAssetPlanParams) error

func (*Queries) SetAssetProbe

func (q *Queries) SetAssetProbe(ctx context.Context, arg SetAssetProbeParams) error

func (*Queries) SetAssetTitle

func (q *Queries) SetAssetTitle(ctx context.Context, arg SetAssetTitleParams) (int64, error)

func (*Queries) SetLibraryPlayer

func (q *Queries) SetLibraryPlayer(ctx context.Context, arg SetLibraryPlayerParams) (int64, error)

func (*Queries) SetLibraryPreset

func (q *Queries) SetLibraryPreset(ctx context.Context, arg SetLibraryPresetParams) (int64, error)

func (*Queries) SetPlaybackPolicy

func (q *Queries) SetPlaybackPolicy(ctx context.Context, arg SetPlaybackPolicyParams) error

func (*Queries) SetPosterFrame

func (q *Queries) SetPosterFrame(ctx context.Context, arg SetPosterFrameParams) (pgtype.UUID, error)

A frame as the cover (NULL: the default frame); any uploaded picture stops being used.

func (*Queries) SetPosterUploaded

func (q *Queries) SetPosterUploaded(ctx context.Context, id pgtype.UUID) (pgtype.Timestamptz, error)

func (*Queries) SetVideoDelivery

func (q *Queries) SetVideoDelivery(ctx context.Context, arg SetVideoDeliveryParams) error

func (*Queries) SourcesDueForDeletion

func (q *Queries) SourcesDueForDeletion(ctx context.Context, maxRows int32) ([]SourcesDueForDeletionRow, error)

func (*Queries) StartAssetIfWaiting

func (q *Queries) StartAssetIfWaiting(ctx context.Context, id pgtype.UUID) (pgtype.UUID, error)

func (*Queries) StartJob

func (q *Queries) StartJob(ctx context.Context, id pgtype.UUID) (int64, error)

Each transition happens once, so its webhook fires once however many times a job retries.

func (*Queries) StartTimeline

func (q *Queries) StartTimeline(ctx context.Context, id pgtype.UUID) error

Processing (re)starts: a fresh timeline, so a retry never shows the last attempt's stages.

func (*Queries) StoredMinutes

func (q *Queries) StoredMinutes(ctx context.Context) ([]StoredMinutesRow, error)

func (*Queries) TrashAssets

func (q *Queries) TrashAssets(ctx context.Context, ids []pgtype.UUID) (int64, error)

func (*Queries) TrashAssetsInFolders

func (q *Queries) TrashAssetsInFolders(ctx context.Context, folderIds []pgtype.UUID) (int64, error)

func (*Queries) TrashedDue

func (q *Queries) TrashedDue(ctx context.Context, days int32) ([]TrashedDueRow, error)

func (*Queries) UpdateLibrary

func (q *Queries) UpdateLibrary(ctx context.Context, arg UpdateLibraryParams) (pgtype.UUID, error)

Null leaves a setting as it is.

func (*Queries) UpdatePreset

func (q *Queries) UpdatePreset(ctx context.Context, arg UpdatePresetParams) (int64, error)

Null leaves a field as it is.

func (*Queries) UpdateVideoDefaults

func (q *Queries) UpdateVideoDefaults(ctx context.Context, arg UpdateVideoDefaultsParams) error

Null leaves a default as it is.

func (*Queries) UploadBegin

func (q *Queries) UploadBegin(ctx context.Context, arg UploadBeginParams) (UploadBeginRow, error)

func (*Queries) UploadState

func (q *Queries) UploadState(ctx context.Context, id pgtype.UUID) (UploadStateRow, error)

store_id and size are empty until the first piece arrives.

func (*Queries) VideoLookup

func (q *Queries) VideoLookup(ctx context.Context, arg VideoLookupParams) (VideoLookupRow, error)

func (*Queries) VideoStats

func (q *Queries) VideoStats(ctx context.Context) (VideoStatsRow, error)

func (*Queries) WithTx

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

type RecentPlaybackReportParams

type RecentPlaybackReportParams struct {
	AssetID pgtype.UUID `json:"asset_id"`
	Ip      string      `json:"ip"`
}

type RenameFolderParams

type RenameFolderParams struct {
	Name string      `json:"name"`
	ID   pgtype.UUID `json:"id"`
}

type SetAssetChaptersParams

type SetAssetChaptersParams struct {
	Chapters []byte      `json:"chapters"`
	ID       pgtype.UUID `json:"id"`
}

type SetAssetDetailsParams

type SetAssetDetailsParams struct {
	Description pgtype.Text `json:"description"`
	Tags        []string    `json:"tags"`
	Metadata    []byte      `json:"metadata"`
	ID          pgtype.UUID `json:"id"`
}

type SetAssetDownloadParams

type SetAssetDownloadParams struct {
	Download pgtype.Text `json:"download"`
	ID       pgtype.UUID `json:"id"`
}

type SetAssetPlanParams

type SetAssetPlanParams struct {
	Plan          []byte      `json:"plan"`
	EncryptionKey []byte      `json:"encryption_key"`
	EncryptionIv  []byte      `json:"encryption_iv"`
	ID            pgtype.UUID `json:"id"`
}

type SetAssetProbeParams

type SetAssetProbeParams struct {
	Probe           []byte        `json:"probe"`
	DurationSeconds pgtype.Float8 `json:"duration_seconds"`
	Width           pgtype.Int4   `json:"width"`
	Height          pgtype.Int4   `json:"height"`
	ID              pgtype.UUID   `json:"id"`
}

type SetAssetTitleParams

type SetAssetTitleParams struct {
	Title string      `json:"title"`
	ID    pgtype.UUID `json:"id"`
}

type SetLibraryPlayerParams

type SetLibraryPlayerParams struct {
	Player []byte      `json:"player"`
	ID     pgtype.UUID `json:"id"`
}

type SetLibraryPresetParams

type SetLibraryPresetParams struct {
	PresetTemplate string      `json:"preset_template"`
	PresetID       pgtype.UUID `json:"preset_id"`
	ID             pgtype.UUID `json:"id"`
}

type SetPlaybackPolicyParams

type SetPlaybackPolicyParams struct {
	Policy string      `json:"policy"`
	ID     pgtype.UUID `json:"id"`
}

type SetPosterFrameParams

type SetPosterFrameParams struct {
	PosterTime pgtype.Float8 `json:"poster_time"`
	ID         pgtype.UUID   `json:"id"`
}

type SetVideoDeliveryParams

type SetVideoDeliveryParams struct {
	Mode              string      `json:"mode"`
	CustomUrl         pgtype.Text `json:"custom_url"`
	Provider          string      `json:"provider"`
	CdnDistributionID pgtype.UUID `json:"cdn_distribution_id"`
}

type SourcesDueForDeletionRow

type SourcesDueForDeletionRow struct {
	TenantID  pgtype.UUID `json:"tenant_id"`
	AssetID   pgtype.UUID `json:"asset_id"`
	SourceKey string      `json:"source_key"`
}

type StoredMinutesRow

type StoredMinutesRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	Minutes  float64     `json:"minutes"`
}

type TrashedDueRow

type TrashedDueRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	AssetID  pgtype.UUID `json:"asset_id"`
}

type UpdateLibraryParams

type UpdateLibraryParams struct {
	Name                  pgtype.Text `json:"name"`
	Description           pgtype.Text `json:"description"`
	DefaultPlaybackPolicy pgtype.Text `json:"default_playback_policy"`
	Mp4Downloads          pgtype.Bool `json:"mp4_downloads"`
	AllowedDomains        []string    `json:"allowed_domains"`
	BlockedDomains        []string    `json:"blocked_domains"`
	CountryMode           pgtype.Text `json:"country_mode"`
	Countries             []string    `json:"countries"`
	Drop                  []string    `json:"drop"`
	ID                    pgtype.UUID `json:"id"`
}

type UpdatePresetParams

type UpdatePresetParams struct {
	Name        pgtype.Text `json:"name"`
	Description pgtype.Text `json:"description"`
	Heights     []int32     `json:"heights"`
	Quality     pgtype.Text `json:"quality"`
	ID          pgtype.UUID `json:"id"`
}

type UpdateVideoDefaultsParams

type UpdateVideoDefaultsParams struct {
	Player                []byte      `json:"player"`
	PresetTemplate        pgtype.Text `json:"preset_template"`
	Mp4Downloads          pgtype.Bool `json:"mp4_downloads"`
	AllowedDomains        []string    `json:"allowed_domains"`
	BlockedDomains        []string    `json:"blocked_domains"`
	CountryMode           pgtype.Text `json:"country_mode"`
	Countries             []string    `json:"countries"`
	DefaultPlaybackPolicy pgtype.Text `json:"default_playback_policy"`
}

type UploadBeginParams

type UploadBeginParams struct {
	ID      pgtype.UUID `json:"id"`
	StoreID string      `json:"store_id"`
	Size    int64       `json:"size"`
}

type UploadBeginRow

type UploadBeginRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	AssetID  pgtype.UUID `json:"asset_id"`
}

type UploadStateRow

type UploadStateRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	AssetID  pgtype.UUID `json:"asset_id"`
	Status   string      `json:"status"`
	StoreID  string      `json:"store_id"`
	Size     int64       `json:"size"`
}

type VideoLookupParams

type VideoLookupParams struct {
	LibraryID pgtype.UUID `json:"library_id"`
	VideoID   pgtype.UUID `json:"video_id"`
}

type VideoLookupRow

type VideoLookupRow struct {
	TenantID pgtype.UUID `json:"tenant_id"`
	Policy   string      `json:"policy"`
}

type VideoStatsRow

type VideoStatsRow struct {
	Total      int64   `json:"total"`
	Playable   int64   `json:"playable"`
	Processing int64   `json:"processing"`
	Failed     int64   `json:"failed"`
	Minutes    float64 `json:"minutes"`
}

Jump to

Keyboard shortcuts

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