Documentation
¶
Index ¶
- Variables
- func HandleValidationError(err error) (StatusCode, *ErrorResponse)
- func New(inputStore db.InputStore, nh service.NotificationHandler, ...) *gin.Engine
- type AudioProfileData
- type Error
- type ErrorDetail
- type ErrorResponse
- type IngestAuthData
- type InputController
- type InputData
- type NotificationController
- type OriginController
- type OriginData
- type StatusCode
- type SuccessResponse
- type VideoProfileData
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func HandleValidationError ¶
func HandleValidationError(err error) (StatusCode, *ErrorResponse)
HandleValidationError validate and handle errors of structs that has `validator/v10` rules
func New ¶
func New(inputStore db.InputStore, nh service.NotificationHandler, oh service.OriginHandler) *gin.Engine
Types ¶
type AudioProfileData ¶
type Error ¶
type Error struct { Message string `json:"message"` Details []ErrorDetail `json:"details,omitempty"` }
type ErrorDetail ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error `json:"error"`
}
type IngestAuthData ¶
type InputController ¶
type InputController struct {
// contains filtered or unexported fields
}
func NewInputController ¶
func NewInputController(inputHandler service.InputHandler) *InputController
func (*InputController) Authenticate ¶
func (c *InputController) Authenticate(ctx *gin.Context)
func (*InputController) CreateInput ¶
func (c *InputController) CreateInput(ctx *gin.Context)
@Summary Create an input @Description Create an input ready to be ingested @Accept json @Produce json @Param input body api.InputData true "Input data" @Success 201 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid input data" @Failure 500 {object} api.ErrorResponse "Internal server error" @Router /inputs [post]
func (*InputController) DeleteInput ¶
func (c *InputController) DeleteInput(ctx *gin.Context)
@Summary Delete input @Description Delete input by ID @Produce json @Param id path string true "Input ID" @Success 200 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid UUID format" @Failure 500 {object} api.ErrorResponse "Internal server error" @Router /inputs/{id} [delete]
func (*InputController) GetInput ¶
func (c *InputController) GetInput(ctx *gin.Context)
@Summary Get input @Description Get input information by ID @Produce json @Param id path string true "Input ID" @Success 200 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid UUID format" @Failure 500 {object} api.ErrorResponse "Internal server error" @Router /inputs/{id} [get]
type InputData ¶
type InputData struct { ID uuid.UUID `json:"id" swaggerignore:"true"` Name string `json:"name" validate:"required"` Format string `json:"format" validate:"required"` AudioProfiles []AudioProfileData `json:"audio_profiles"` VideoProfiles []VideoProfileData `json:"video_profiles"` }
type NotificationController ¶
type NotificationController struct {
// contains filtered or unexported fields
}
func NewNotificationController ¶
func NewNotificationController(nh service.NotificationHandler) *NotificationController
func (*NotificationController) EnqueuePackaging ¶
func (n *NotificationController) EnqueuePackaging(ctx *gin.Context)
@Summary Enqueue packacing job @Description Enqueue packaging job using input URL, format and ID @Produce json @Param id query string true "Input ID" @Success 201 {object} api.SuccessResponse @Failure 400 {object} api.ErrorResponse "Invalid UUID format" @Failure 500 {object} api.ErrorResponse "Internal server error" @Router /notifications/package [post]
type OriginController ¶
type OriginController struct {
// contains filtered or unexported fields
}
func NewOriginController ¶
func NewOriginController(oh service.OriginHandler) *OriginController
func (*OriginController) GetOrigin ¶
func (o *OriginController) GetOrigin(ctx *gin.Context)
func (*OriginController) UpdateOrigin ¶
func (o *OriginController) UpdateOrigin(ctx *gin.Context)
type OriginData ¶
type OriginData struct { ID uuid.UUID `json:"id" validate:"required"` Address string `json:"address" validate:"required"` }
func FromOrigin ¶
func FromOrigin(origin service.Origin) OriginData
func (*OriginData) ToOrigin ¶
func (o *OriginData) ToOrigin() service.Origin
type StatusCode ¶
type StatusCode int
type SuccessResponse ¶
type SuccessResponse struct { Message string `json:"message,omitempty"` Data interface{} `json:"data"` }