storage

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterPlaylistName  = "master.m3u8"
	PlaylistExt         = ".m3u8"
	PlaylistContentType = "application/x-mpegURL"
	FragmentContentType = "video/mp4"
)
View Source
const (
	OpDelete = iota
	OpGetFragment
	OpPut
)

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *zap.SugaredLogger)

Types

type DummyStorage

type DummyStorage struct {
	LocalStorage
	Ops []StorageOp
}

func Dummy

func Dummy() *DummyStorage

func (*DummyStorage) Delete

func (s *DummyStorage) Delete(sdHash string) error

func (*DummyStorage) GetFragment

func (s *DummyStorage) GetFragment(sdHash, name string) (StreamFragment, error)

func (*DummyStorage) Put

func (s *DummyStorage) Put(lstream *LocalStream) (*RemoteStream, error)

type LocalDriver

type LocalDriver interface {
	New(sdHash string) *LocalStream
	Open(sdHash string) (*LocalStream, error)
	Delete(sdHash string) error
}

type LocalStorage

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

func Local

func Local(path string) LocalStorage

func (LocalStorage) Delete

func (s LocalStorage) Delete(sdHash string) error

func (LocalStorage) New

func (s LocalStorage) New(sdHash string) *LocalStream

func (LocalStorage) Open

func (s LocalStorage) Open(sdHash string) (*LocalStream, error)

type LocalStream

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

func (LocalStream) Checksum

func (s LocalStream) Checksum() string

func (LocalStream) Dive

func (s LocalStream) Dive(loader StreamFileLoader, processor StreamFileProcessor) error

Dive processes Local HLS stream, calling `loader` to load and `processor` for each master/child playlists and all the files they reference. `processor` with filename as second argument.

func (LocalStream) FullPath

func (s LocalStream) FullPath() string

func (LocalStream) LastPath

func (s LocalStream) LastPath() string

func (*LocalStream) ReadMeta

func (s *LocalStream) ReadMeta() error

func (LocalStream) Size

func (s LocalStream) Size() int64

type NullDriver

type NullDriver struct{}

func (NullDriver) Delete

func (d NullDriver) Delete(sdHash string) error

func (NullDriver) GetFragment

func (d NullDriver) GetFragment(s, n string) (StreamFragment, error)

func (NullDriver) Put

func (d NullDriver) Put(stream *LocalStream) (*RemoteStream, error)

type RemoteDriver

type RemoteDriver interface {
	Put(stream *LocalStream) (*RemoteStream, error)
	Delete(sdHash string) error
	GetFragment(sdHash, name string) (StreamFragment, error)
}

type RemoteStream

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

func (RemoteStream) URL

func (s RemoteStream) URL() string

type S3Configuration

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

func S3Configure

func S3Configure() *S3Configuration

func S3ConfigureWasabi

func S3ConfigureWasabi() *S3Configuration

func S3ConfigureWasabiEU

func S3ConfigureWasabiEU() *S3Configuration

func (*S3Configuration) Bucket

func (c *S3Configuration) Bucket(b string) *S3Configuration

Bucket ...

func (*S3Configuration) Credentials

func (c *S3Configuration) Credentials(accessKey, secretKey string) *S3Configuration

Credentials set access key and secret key for accessing S3 bucket.

func (*S3Configuration) DisableSSL

func (c *S3Configuration) DisableSSL() *S3Configuration

DisableSSL ...

func (*S3Configuration) Endpoint

func (c *S3Configuration) Endpoint(e string) *S3Configuration

Endpoint ...

func (*S3Configuration) Region

func (c *S3Configuration) Region(r string) *S3Configuration

Region ...

type S3Driver

type S3Driver struct {
	*S3Configuration
	// contains filtered or unexported fields
}

func InitS3Driver

func InitS3Driver(cfg *S3Configuration) (*S3Driver, error)

func (*S3Driver) Delete

func (s *S3Driver) Delete(sdHash string) error

func (*S3Driver) Get

func (s *S3Driver) Get(sdHash string) (*LocalStream, error)

func (*S3Driver) GetFragment

func (s *S3Driver) GetFragment(sdHash, name string) (StreamFragment, error)

func (*S3Driver) Put

func (s *S3Driver) Put(lstream *LocalStream) (*RemoteStream, error)

type StorageOp

type StorageOp struct {
	Op     int
	SDHash string
}

type StreamFileLoader

type StreamFileLoader func(rootPath ...string) ([]byte, error)

type StreamFileProcessor

type StreamFileProcessor func(data []byte, name string) error

type StreamFragment

type StreamFragment interface {
	io.ReadCloser
}

Jump to

Keyboard shortcuts

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