Documentation ¶
Index ¶
- Variables
- type AudioEncoder
- type FFmpegEncoder
- type FileStorage
- type FileSystemStorage
- func (s *FileSystemStorage) DeleteFile(name string) error
- func (s *FileSystemStorage) GetFile(name string) (io.ReadCloser, error)
- func (s *FileSystemStorage) Init() error
- func (s *FileSystemStorage) SaveFile(name string, content io.Reader) error
- func (s *FileSystemStorage) ServeFile(w http.ResponseWriter, r *http.Request)
- type IndexHandler
- type SubmitHandler
- type TOSHandler
- type UpdateHandler
- type VoiceClip
- type VoiceClipDB
- func (db *VoiceClipDB) Close() error
- func (db *VoiceClipDB) Create() error
- func (db *VoiceClipDB) DeleteVoiceClip(id int64) error
- func (db *VoiceClipDB) GetClipTags(clipID int64) ([]string, error)
- func (db *VoiceClipDB) GetRecentVoiceClips(limit int) ([]*VoiceClip, error)
- func (db *VoiceClipDB) GetTopAgencies(limit int) ([]string, error)
- func (db *VoiceClipDB) GetTopTags(limit int) ([]string, error)
- func (db *VoiceClipDB) GetTopVTubers(limit int) ([]string, error)
- func (db *VoiceClipDB) GetUnapprovedVoiceClips(maxAge time.Duration) ([]*VoiceClip, error)
- func (db *VoiceClipDB) GetVoiceClip(id int64) (*VoiceClip, error)
- func (db *VoiceClipDB) GetVoiceClipsByAgency(agency string) ([]*VoiceClip, error)
- func (db *VoiceClipDB) GetVoiceClipsByTag(tag string) ([]*VoiceClip, error)
- func (db *VoiceClipDB) GetVoiceClipsByVTuber(vtuberName string) ([]*VoiceClip, error)
- func (db *VoiceClipDB) InsertVoiceClip(clip *VoiceClip) error
- func (db *VoiceClipDB) SearchClips(query sql.NullString, vtuber sql.NullString, agency sql.NullString, ...) ([]*VoiceClip, error)
- func (db *VoiceClipDB) UpdateVoiceClip(clip *VoiceClip) error
- type VoiceClipRepository
- type VoiceClipService
- func (s *VoiceClipService) CreateVoiceClip(clip *VoiceClip, inAudio io.Reader) error
- func (s *VoiceClipService) DeleteVoiceClip(id int64) error
- func (s *VoiceClipService) FileTypes() []string
- func (s *VoiceClipService) GetClipTags(id int64) ([]string, error)
- func (s *VoiceClipService) GetRecentVoiceClips(limit int) ([]*VoiceClip, error)
- func (s *VoiceClipService) GetTopAgencies(limit int) ([]string, error)
- func (s *VoiceClipService) GetTopTags(limit int) ([]string, error)
- func (s *VoiceClipService) GetTopVTubers(limit int) ([]string, error)
- func (s *VoiceClipService) GetUnapprovedVoiceClips(age time.Duration) ([]*VoiceClip, error)
- func (s *VoiceClipService) GetVoiceClip(id int64) (vc *VoiceClip, err error)
- func (s *VoiceClipService) GetVoiceClipAudio(id int64) (audio io.ReadCloser, err error)
- func (s *VoiceClipService) GetVoiceClipsByAgency(agencyName string) ([]*VoiceClip, error)
- func (s *VoiceClipService) GetVoiceClipsByTag(tag string) ([]*VoiceClip, error)
- func (s *VoiceClipService) GetVoiceClipsByVTuber(vtuberName string) ([]*VoiceClip, error)
- func (s *VoiceClipService) SearchClips(query, vtuber, agency, tag sql.NullString, limit int) ([]*VoiceClip, error)
- func (s *VoiceClipService) UpdateVoiceClip(clip *VoiceClip) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultCodec = "libopus" DefaultFormat = "ogg" )
Functions ¶
This section is empty.
Types ¶
type AudioEncoder ¶
type FFmpegEncoder ¶
type FFmpegEncoder struct { Format string Codec string BitRate string // contains filtered or unexported fields }
func NewOpusCafEncoder ¶
func NewOpusCafEncoder() *FFmpegEncoder
func NewOpusOggEncoder ¶
func NewOpusOggEncoder() *FFmpegEncoder
func (*FFmpegEncoder) Encode ¶
func (e *FFmpegEncoder) Encode(r io.Reader) (out io.ReadCloser, err error)
func (*FFmpegEncoder) Extension ¶
func (e *FFmpegEncoder) Extension() string
type FileStorage ¶
type FileSystemStorage ¶
type FileSystemStorage struct {
// contains filtered or unexported fields
}
func NewFileSystemStorage ¶
func NewFileSystemStorage(root string) *FileSystemStorage
func (*FileSystemStorage) DeleteFile ¶
func (s *FileSystemStorage) DeleteFile(name string) error
func (*FileSystemStorage) GetFile ¶
func (s *FileSystemStorage) GetFile(name string) (io.ReadCloser, error)
func (*FileSystemStorage) Init ¶
func (s *FileSystemStorage) Init() error
func (*FileSystemStorage) SaveFile ¶
func (s *FileSystemStorage) SaveFile(name string, content io.Reader) error
func (*FileSystemStorage) ServeFile ¶
func (s *FileSystemStorage) ServeFile(w http.ResponseWriter, r *http.Request)
type IndexHandler ¶
type IndexHandler struct {
// contains filtered or unexported fields
}
func NewIndexHandler ¶
func NewIndexHandler(vc *VoiceClipService) *IndexHandler
func (*IndexHandler) ServeHTTP ¶
func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SubmitHandler ¶
type SubmitHandler struct {
// contains filtered or unexported fields
}
func NewSubmitHandler ¶
func NewSubmitHandler(vc *VoiceClipService) *SubmitHandler
func (*SubmitHandler) ServeHTTP ¶
func (h *SubmitHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TOSHandler ¶
type TOSHandler struct{}
func NewTOSHandler ¶
func NewTOSHandler() *TOSHandler
func (*TOSHandler) ServeHTTP ¶
func (h *TOSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UpdateHandler ¶
type UpdateHandler struct {
// contains filtered or unexported fields
}
func NewUpdateHandler ¶
func NewUpdateHandler(vc *VoiceClipService) *UpdateHandler
func (*UpdateHandler) ServeHTTP ¶
func (h *UpdateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type VoiceClipDB ¶
func NewVoiceClipDB ¶
func NewVoiceClipDB(db *sql.DB) *VoiceClipDB
func (*VoiceClipDB) Close ¶
func (db *VoiceClipDB) Close() error
func (*VoiceClipDB) Create ¶
func (db *VoiceClipDB) Create() error
func (*VoiceClipDB) DeleteVoiceClip ¶
func (db *VoiceClipDB) DeleteVoiceClip(id int64) error
func (*VoiceClipDB) GetClipTags ¶
func (db *VoiceClipDB) GetClipTags(clipID int64) ([]string, error)
func (*VoiceClipDB) GetRecentVoiceClips ¶
func (db *VoiceClipDB) GetRecentVoiceClips(limit int) ([]*VoiceClip, error)
func (*VoiceClipDB) GetTopAgencies ¶
func (db *VoiceClipDB) GetTopAgencies(limit int) ([]string, error)
func (*VoiceClipDB) GetTopTags ¶
func (db *VoiceClipDB) GetTopTags(limit int) ([]string, error)
func (*VoiceClipDB) GetTopVTubers ¶
func (db *VoiceClipDB) GetTopVTubers(limit int) ([]string, error)
func (*VoiceClipDB) GetUnapprovedVoiceClips ¶
func (db *VoiceClipDB) GetUnapprovedVoiceClips(maxAge time.Duration) ([]*VoiceClip, error)
func (*VoiceClipDB) GetVoiceClip ¶
func (db *VoiceClipDB) GetVoiceClip(id int64) (*VoiceClip, error)
func (*VoiceClipDB) GetVoiceClipsByAgency ¶
func (db *VoiceClipDB) GetVoiceClipsByAgency(agency string) ([]*VoiceClip, error)
func (*VoiceClipDB) GetVoiceClipsByTag ¶
func (db *VoiceClipDB) GetVoiceClipsByTag(tag string) ([]*VoiceClip, error)
func (*VoiceClipDB) GetVoiceClipsByVTuber ¶
func (db *VoiceClipDB) GetVoiceClipsByVTuber(vtuberName string) ([]*VoiceClip, error)
func (*VoiceClipDB) InsertVoiceClip ¶
func (db *VoiceClipDB) InsertVoiceClip(clip *VoiceClip) error
func (*VoiceClipDB) SearchClips ¶
func (db *VoiceClipDB) SearchClips( query sql.NullString, vtuber sql.NullString, agency sql.NullString, tag sql.NullString, limit int, ) ([]*VoiceClip, error)
func (*VoiceClipDB) UpdateVoiceClip ¶
func (db *VoiceClipDB) UpdateVoiceClip(clip *VoiceClip) error
type VoiceClipRepository ¶
type VoiceClipRepository interface { InsertVoiceClip(vc *VoiceClip) error UpdateVoiceClip(vc *VoiceClip) error DeleteVoiceClip(id int64) error GetRecentVoiceClips(limit int) ([]*VoiceClip, error) GetClipTags(id int64) ([]string, error) GetVoiceClip(id int64) (*VoiceClip, error) GetVoiceClipsByVTuber(vtuberName string) ([]*VoiceClip, error) GetVoiceClipsByAgency(agencyName string) ([]*VoiceClip, error) GetVoiceClipsByTag(tag string) ([]*VoiceClip, error) GetUnapprovedVoiceClips(age time.Duration) ([]*VoiceClip, error) GetTopAgencies(limit int) ([]string, error) GetTopVTubers(limit int) ([]string, error) GetTopTags(limit int) ([]string, error) SearchClips(query, vtuber, agency, tag sql.NullString, limit int) ([]*VoiceClip, error) }
type VoiceClipService ¶
type VoiceClipService struct {
// contains filtered or unexported fields
}
func NewVoiceClipService ¶
func NewVoiceClipService(db VoiceClipRepository, audioStorage FileStorage, encoders []AudioEncoder) *VoiceClipService
func (*VoiceClipService) CreateVoiceClip ¶
func (s *VoiceClipService) CreateVoiceClip(clip *VoiceClip, inAudio io.Reader) error
func (*VoiceClipService) DeleteVoiceClip ¶
func (s *VoiceClipService) DeleteVoiceClip(id int64) error
func (*VoiceClipService) FileTypes ¶
func (s *VoiceClipService) FileTypes() []string
func (*VoiceClipService) GetClipTags ¶
func (s *VoiceClipService) GetClipTags(id int64) ([]string, error)
func (*VoiceClipService) GetRecentVoiceClips ¶
func (s *VoiceClipService) GetRecentVoiceClips(limit int) ([]*VoiceClip, error)
func (*VoiceClipService) GetTopAgencies ¶
func (s *VoiceClipService) GetTopAgencies(limit int) ([]string, error)
func (*VoiceClipService) GetTopTags ¶
func (s *VoiceClipService) GetTopTags(limit int) ([]string, error)
func (*VoiceClipService) GetTopVTubers ¶
func (s *VoiceClipService) GetTopVTubers(limit int) ([]string, error)
func (*VoiceClipService) GetUnapprovedVoiceClips ¶
func (s *VoiceClipService) GetUnapprovedVoiceClips(age time.Duration) ([]*VoiceClip, error)
func (*VoiceClipService) GetVoiceClip ¶
func (s *VoiceClipService) GetVoiceClip(id int64) (vc *VoiceClip, err error)
func (*VoiceClipService) GetVoiceClipAudio ¶
func (s *VoiceClipService) GetVoiceClipAudio(id int64) (audio io.ReadCloser, err error)
func (*VoiceClipService) GetVoiceClipsByAgency ¶
func (s *VoiceClipService) GetVoiceClipsByAgency(agencyName string) ([]*VoiceClip, error)
func (*VoiceClipService) GetVoiceClipsByTag ¶
func (s *VoiceClipService) GetVoiceClipsByTag(tag string) ([]*VoiceClip, error)
func (*VoiceClipService) GetVoiceClipsByVTuber ¶
func (s *VoiceClipService) GetVoiceClipsByVTuber(vtuberName string) ([]*VoiceClip, error)
func (*VoiceClipService) SearchClips ¶
func (s *VoiceClipService) SearchClips(query, vtuber, agency, tag sql.NullString, limit int) ([]*VoiceClip, error)
func (*VoiceClipService) UpdateVoiceClip ¶
func (s *VoiceClipService) UpdateVoiceClip(clip *VoiceClip) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.