Documentation
¶
Index ¶
- Variables
- func FurloughVideos(lib *Library, maxSize uint64) (uint64, uint64, error)
- func RetireVideos(lib *Library, maxSize uint64) (uint64, uint64, error)
- func SetLogger(l *zap.SugaredLogger)
- func SpawnLibraryCleaning(lib *Library) chan<- interface{}
- func SpawnS3uploader(lib *Library) chan<- interface{}
- func StringToSize(s string) uint64
- type AddParams
- type Config
- type DBTX
- type Library
- func (q Library) Add(params AddParams) (*Video, error)
- func (q Library) Furlough(v *Video) error
- func (q Library) Get(sdHash string) (*Video, error)
- func (q Library) ListLocal() ([]*Video, error)
- func (q Library) ListLocalOnly() ([]*Video, error)
- func (q Library) ListRemoteOnly() ([]*Video, error)
- func (q Library) New(sdHash string) *storage.LocalStream
- func (q Library) Retire(v *Video) error
- func (q Library) UpdateRemotePath(sdHash, url string) error
- type Queries
- func (q *Queries) Add(ctx context.Context, arg AddParams) (*Video, error)
- func (q *Queries) Delete(ctx context.Context, sdHash string) error
- func (q *Queries) Get(ctx context.Context, sdHash string) (*Video, error)
- func (q *Queries) ListLocal(ctx context.Context) ([]*Video, error)
- func (q *Queries) ListLocalOnly(ctx context.Context) ([]*Video, error)
- func (q *Queries) ListRemoteOnly(ctx context.Context) ([]*Video, error)
- func (q *Queries) UpdatePath(ctx context.Context, sdHash, path string) error
- func (q *Queries) UpdateRemotePath(ctx context.Context, sdHash, url string) error
- type Video
- type VideoLibrary
Constants ¶
This section is empty.
Variables ¶
View Source
var InitialMigration = `` /* 561-byte string literal not displayed */
Functions ¶
func FurloughVideos ¶ added in v0.5.0
FurloughVideos deletes older videos locally, leaving them only on S3, keeping total size of local videos at maxSize.
func RetireVideos ¶ added in v0.5.0
RetireVideos deletes older videos from S3, keeping total size of remote videos at maxSize.
func SetLogger ¶
func SetLogger(l *zap.SugaredLogger)
func SpawnLibraryCleaning ¶ added in v0.5.0
func SpawnLibraryCleaning(lib *Library) chan<- interface{}
func SpawnS3uploader ¶ added in v0.10.11
func SpawnS3uploader(lib *Library) chan<- interface{}
func StringToSize ¶ added in v0.5.0
Types ¶
type Config ¶ added in v0.5.0
type Config struct {
// contains filtered or unexported fields
}
func (*Config) LocalStorage ¶ added in v0.5.0
func (c *Config) LocalStorage(s storage.LocalDriver) *Config
LocalStorage is a local storage driver for accessing videos on disk.
func (*Config) MaxLocalSize ¶ added in v0.5.0
func (*Config) MaxRemoteSize ¶ added in v0.5.0
func (*Config) RemoteStorage ¶ added in v0.5.0
func (c *Config) RemoteStorage(s storage.RemoteDriver) *Config
LocalStorage is a remote (S3) storage driver for accessing remote videos.
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 BeginTx(context.Context, *sql.TxOptions) (*sql.Tx, error) }
type Library ¶
type Library struct { *Config // contains filtered or unexported fields }
Library contains methods for accessing videos database.
func NewLibrary ¶
func (Library) ListLocalOnly ¶ added in v0.5.0
func (Library) ListRemoteOnly ¶ added in v0.5.0
func (Library) UpdateRemotePath ¶ added in v0.5.0
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ListLocalOnly ¶ added in v0.5.0
func (*Queries) ListRemoteOnly ¶ added in v0.5.0
func (*Queries) UpdatePath ¶ added in v0.5.0
type Video ¶
type Video struct { SDHash string CreatedAt string URL string Path string RemotePath string Type string Channel string LastAccessed sql.NullTime AccessCount int64 Size int64 Checksum string }
func (Video) GetLocation ¶ added in v0.5.0
GetLocation returns a video location suitable for using in HTTP redirect response. Bool in return value signifies if it's a remote location (S3) or local (relative HTTP path).
Click to show internal directories.
Click to hide internal directories.