Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanIDsProvider ¶
type CleanIDsProvider struct { SessionProvider *SessionProvider // contains filtered or unexported fields }
CleanIDsProvider returns old IDs to remove from system
func NewCleanIDsProvider ¶
func NewCleanIDsProvider(sessionProvider *SessionProvider, expireDuration time.Duration) (*CleanIDsProvider, error)
NewCleanIDsProvider creates CleanIDsProvider instances
func (*CleanIDsProvider) Get ¶
func (p *CleanIDsProvider) Get() ([]string, error)
Get return expired IDs
type CleanRecord ¶
type CleanRecord struct { SessionProvider *SessionProvider Table string }
CleanRecord deletes mongo table record
func NewCleanRecords ¶
func NewCleanRecords(sessionProvider *SessionProvider) ([]*CleanRecord, error)
NewCleanRecords creates CleanRecord instances
func (*CleanRecord) Clean ¶
func (fs *CleanRecord) Clean(ID string) error
Clean deletes record from table by ID
type EmailRetriever ¶
type EmailRetriever struct {
SessionProvider *SessionProvider
}
EmailRetriever returns email by transcription ID
func NewEmailRetriever ¶
func NewEmailRetriever(sessionProvider *SessionProvider) (*EmailRetriever, error)
NewEmailRetriever creates EmailRetriever instance
type FileNameProvider ¶
type FileNameProvider struct {
SessionProvider *SessionProvider
}
FileNameProvider returns file name by transcription ID
func NewFileNameProvider ¶
func NewFileNameProvider(sessionProvider *SessionProvider) (*FileNameProvider, error)
NewFileNameProvider creates FileNameProvider instance
type Locker ¶
type Locker struct {
SessionProvider *SessionProvider
}
Locker acquires lock in db
func NewLocker ¶
func NewLocker(sessionProvider *SessionProvider) (*Locker, error)
NewLocker creates Locker instance
type RequestSaver ¶
type RequestSaver struct {
SessionProvider *SessionProvider
}
RequestSaver saves process request to mongo db
func NewRequestSaver ¶
func NewRequestSaver(sessionProvider *SessionProvider) (*RequestSaver, error)
NewRequestSaver creates RequestSaver instance
func (*RequestSaver) Save ¶
func (ss *RequestSaver) Save(data *persistence.Request) error
Save saves resquest to DB
type ResultSaver ¶
type ResultSaver struct {
SessionProvider *SessionProvider
}
ResultSaver saves process status to mongo db
func NewResultSaver ¶
func NewResultSaver(sessionProvider *SessionProvider) (*ResultSaver, error)
NewResultSaver creates ResultSaver instance
type SessionProvider ¶
type SessionProvider struct { URL string // contains filtered or unexported fields }
SessionProvider connects and provides session for mongo DB
func NewSessionProvider ¶
func NewSessionProvider() (*SessionProvider, error)
NewSessionProvider creates Mongo session provider
func (*SessionProvider) Healthy ¶
func (sp *SessionProvider) Healthy() error
Healthy checks if mongo DB is up
func (*SessionProvider) NewSession ¶
func (sp *SessionProvider) NewSession() (mgo.Session, error)
NewSession creates mongo session
type StatusProvider ¶
type StatusProvider struct {
SessionProvider *SessionProvider
}
StatusProvider provides transcription status from mongo db
func NewStatusProvider ¶
func NewStatusProvider(sessionProvider *SessionProvider) (*StatusProvider, error)
NewStatusProvider creates StatusProvider instance
func (StatusProvider) Get ¶
func (fs StatusProvider) Get(id string) (*api.TranscriptionResult, error)
Get retrieves status from DB
type StatusSaver ¶
type StatusSaver struct { SessionProvider *SessionProvider // contains filtered or unexported fields }
StatusSaver saves process status to mongo db
func NewStatusSaver ¶
func NewStatusSaver(sessionProvider *SessionProvider) (*StatusSaver, error)
NewStatusSaver creates StatusSaver instance
func (*StatusSaver) Save ¶
func (ss *StatusSaver) Save(ID string, st status.Status) error
Save saves status to DB
type WorkSaver ¶
type WorkSaver struct {
SessionProvider *SessionProvider
}
WorkSaver saves process work data to mongo db
func NewWorkSaver ¶
func NewWorkSaver(sessionProvider *SessionProvider) (*WorkSaver, error)
NewWorkSaver creates WorkSaver instance