Documentation ¶
Index ¶
- Variables
- type Handlers
- func (h *Handlers) CreateSound(ctx context.Context, user session.User, pSound prospectSound, ...) (*models.Sound, error)
- func (h *Handlers) PostSound(c *gin.Context)
- func (h *Handlers) ProcessSound(userID, instrumentID, soundUUID, extension string, soundID int64) error
- func (h *Handlers) ProcessSoundNoFK(userID, instrumentID, soundUUID, extension string, soundID int64) error
- func (h *Handlers) Retrieve(c *gin.Context)
- func (h *Handlers) Routes(rg *gin.RouterGroup)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInstrumentNotFound = errors.New("instrument was not found in the database")
ErrInstrumentNotFound is an error thrown when an instrument was not found in the database
View Source
var ErrUnexpectedRowsAffectedCount = errors.New("unexpected rows affected count")
ErrUnexpectedRowsAffectedCount is an error thrown when updating a sound and rows affected count is not expected
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers defines a handler for sound
func NewHandlers ¶
NewHandlers creates a new handler for sound
func (*Handlers) CreateSound ¶
func (h *Handlers) CreateSound(ctx context.Context, user session.User, pSound prospectSound, strategy soundProcessingStrategy) (*models.Sound, error)
CreateSound creates a sound with a validated prospect audio.
func (*Handlers) ProcessSound ¶
func (h *Handlers) ProcessSound(userID, instrumentID, soundUUID, extension string, soundID int64) error
ProcessSound finds a sound file and reads it to extract the frequencies with the intensity and saves it to the frequency table
func (*Handlers) ProcessSoundNoFK ¶
func (h *Handlers) ProcessSoundNoFK(userID, instrumentID, soundUUID, extension string, soundID int64) error
ProcessSoundNoFK does the same that ProcessSound but disables the foreign key for faster insertion
func (*Handlers) Routes ¶
func (h *Handlers) Routes(rg *gin.RouterGroup)
Routes initializes the routes for the audio handlers
Click to show internal directories.
Click to hide internal directories.