Documentation ¶
Index ¶
- type Authentication
- type AuthenticationService
- func (a *AuthenticationService) AddByteDownloaded(sessionID string, size uint) error
- func (a *AuthenticationService) Authenticate(username, password string) (string, error)
- func (a *AuthenticationService) CheckAuthentication(sessionID string) error
- func (a *AuthenticationService) FindBySessionID(sessionID string) (*Authentication, error)
- func (a *AuthenticationService) GetByteDownloaded(sessionID string) (uint, error)
- func (a *AuthenticationService) ListAllUsage(limit, offset uint) ([]*Usage, error)
- func (a *AuthenticationService) NewAuthentication(username, password string) error
- type DownloadJob
- type DownloaderService
- type FileBasedStorageService
- func (f *FileBasedStorageService) Contain(name string) (bool, error)
- func (f *FileBasedStorageService) Create(name string) error
- func (f *FileBasedStorageService) Read(name string) ([]byte, error)
- func (f *FileBasedStorageService) Rename(from string, to string) error
- func (f *FileBasedStorageService) Write(name string, body []byte) error
- type FileBlobStorageService
- func (f *FileBlobStorageService) Contain(name string) (bool, error)
- func (f *FileBlobStorageService) Create(name string) error
- func (f *FileBlobStorageService) Read(name string) ([]byte, error)
- func (f *FileBlobStorageService) Rename(from string, to string) error
- func (f *FileBlobStorageService) Write(name string, body []byte) error
- type IAuthStorage
- type IFileStorage
- type InMemoryAuthentication
- func (i *InMemoryAuthentication) FindBySessionID(sessionID string) (*Authentication, error)
- func (i *InMemoryAuthentication) FindByUsername(username string) (*Authentication, error)
- func (i *InMemoryAuthentication) Insert(auth *Authentication) error
- func (i *InMemoryAuthentication) List(limit uint, offset uint) ([]*Authentication, error)
- func (i *InMemoryAuthentication) Update(auth *Authentication) error
- type RedisAuthentication
- func (i *RedisAuthentication) FindBySessionID(sessionID string) (*Authentication, error)
- func (i *RedisAuthentication) FindByUsername(username string) (*Authentication, error)
- func (i *RedisAuthentication) Insert(auth *Authentication) error
- func (i *RedisAuthentication) List(limit uint, offset uint) ([]*Authentication, error)
- func (i *RedisAuthentication) Update(auth *Authentication) error
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type AuthenticationService ¶
type AuthenticationService struct {
// contains filtered or unexported fields
}
func NewAuthenticationService ¶
func NewAuthenticationService(storage IAuthStorage) *AuthenticationService
func (*AuthenticationService) AddByteDownloaded ¶
func (a *AuthenticationService) AddByteDownloaded(sessionID string, size uint) error
func (*AuthenticationService) Authenticate ¶
func (a *AuthenticationService) Authenticate(username, password string) (string, error)
func (*AuthenticationService) CheckAuthentication ¶
func (a *AuthenticationService) CheckAuthentication(sessionID string) error
func (*AuthenticationService) FindBySessionID ¶
func (a *AuthenticationService) FindBySessionID(sessionID string) (*Authentication, error)
func (*AuthenticationService) GetByteDownloaded ¶
func (a *AuthenticationService) GetByteDownloaded(sessionID string) (uint, error)
func (*AuthenticationService) ListAllUsage ¶
func (a *AuthenticationService) ListAllUsage(limit, offset uint) ([]*Usage, error)
func (*AuthenticationService) NewAuthentication ¶
func (a *AuthenticationService) NewAuthentication(username, password string) error
type DownloadJob ¶
type DownloaderService ¶
type DownloaderService struct {
// contains filtered or unexported fields
}
func NewDownloaderService ¶
func NewDownloaderService(storage IFileStorage) *DownloaderService
func (*DownloaderService) Download ¶
func (d *DownloaderService) Download(link string) ([]byte, error)
func (*DownloaderService) GetVideoQuality ¶
func (d *DownloaderService) GetVideoQuality(link string) ([]string, error)
type FileBasedStorageService ¶
type FileBasedStorageService struct {
// contains filtered or unexported fields
}
func NewFileStorageService ¶
func NewFileStorageService(baseDir string) *FileBasedStorageService
func (*FileBasedStorageService) Contain ¶
func (f *FileBasedStorageService) Contain(name string) (bool, error)
func (*FileBasedStorageService) Create ¶
func (f *FileBasedStorageService) Create(name string) error
func (*FileBasedStorageService) Read ¶
func (f *FileBasedStorageService) Read(name string) ([]byte, error)
type FileBlobStorageService ¶
type FileBlobStorageService struct {
// contains filtered or unexported fields
}
func NewFileBlobStorageService ¶
func NewFileBlobStorageService(baseDir, accountName, accountKey string) *FileBlobStorageService
func (*FileBlobStorageService) Contain ¶
func (f *FileBlobStorageService) Contain(name string) (bool, error)
func (*FileBlobStorageService) Create ¶
func (f *FileBlobStorageService) Create(name string) error
func (*FileBlobStorageService) Read ¶
func (f *FileBlobStorageService) Read(name string) ([]byte, error)
type IAuthStorage ¶
type IAuthStorage interface { Insert(auth *Authentication) error Update(auth *Authentication) error FindBySessionID(sessionID string) (*Authentication, error) FindByUsername(username string) (*Authentication, error) List(limit uint, offset uint) ([]*Authentication, error) }
type IFileStorage ¶
type InMemoryAuthentication ¶
type InMemoryAuthentication struct {
// contains filtered or unexported fields
}
func NewInMemoryAuthentication ¶
func NewInMemoryAuthentication() *InMemoryAuthentication
func (*InMemoryAuthentication) FindBySessionID ¶
func (i *InMemoryAuthentication) FindBySessionID(sessionID string) (*Authentication, error)
func (*InMemoryAuthentication) FindByUsername ¶
func (i *InMemoryAuthentication) FindByUsername(username string) (*Authentication, error)
func (*InMemoryAuthentication) Insert ¶
func (i *InMemoryAuthentication) Insert(auth *Authentication) error
func (*InMemoryAuthentication) List ¶
func (i *InMemoryAuthentication) List(limit uint, offset uint) ([]*Authentication, error)
func (*InMemoryAuthentication) Update ¶
func (i *InMemoryAuthentication) Update(auth *Authentication) error
type RedisAuthentication ¶
type RedisAuthentication struct {
// contains filtered or unexported fields
}
func NewRedisAuthentication ¶
func NewRedisAuthentication(option *redis.Options) *RedisAuthentication
func (*RedisAuthentication) FindBySessionID ¶
func (i *RedisAuthentication) FindBySessionID(sessionID string) (*Authentication, error)
func (*RedisAuthentication) FindByUsername ¶
func (i *RedisAuthentication) FindByUsername(username string) (*Authentication, error)
func (*RedisAuthentication) Insert ¶
func (i *RedisAuthentication) Insert(auth *Authentication) error
func (*RedisAuthentication) List ¶
func (i *RedisAuthentication) List(limit uint, offset uint) ([]*Authentication, error)
func (*RedisAuthentication) Update ¶
func (i *RedisAuthentication) Update(auth *Authentication) error
Click to show internal directories.
Click to hide internal directories.