api

package
v0.0.0-...-5d1ecd3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BodyParseError = "BODY PARSE ERROR"
View Source
var DeleteAudioError = "DELETE AUDIO ERROR"
View Source
var FileReadError = "FILE READ ERROR"
View Source
var FileUploadError = "FILE UPLOAD ERROR"
View Source
var FileWriteError = "FILE WRITE ERROR"
View Source
var HLSError = "HLS ERROR"
View Source
var IDParseError = "ID PARSE ERROR"
View Source
var InternalServerError = "INTERNAL SERVER ERROR"
View Source
var NotFoundError = "NOT FOUND ERROR"
View Source
var ParseFormError = "PARSE FORM ERROR"
View Source
var QueryStringError = "QUERY STRING ERROR"
View Source
var ServiceError = "SERVICE ERROR"
View Source
var ValidationError = "VALIDATION ERROR"

Functions

func NewAPIRouter

func NewAPIRouter(r *mux.Router, api API)

func NewAuthRouter

func NewAuthRouter(r *mux.Router, api API)

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewApi

func NewApi(svc service.Service, m FileManager) API

func (API) AddAudio

func (a API) AddAudio(w http.ResponseWriter, r *http.Request)

func (API) DeleteAudioByID

func (a API) DeleteAudioByID(w http.ResponseWriter, r *http.Request)

func (API) GetAudioByID

func (a API) GetAudioByID(w http.ResponseWriter, r *http.Request)

func (API) GetAudioList

func (a API) GetAudioList(w http.ResponseWriter, r *http.Request)

func (API) SignUp

func (a API) SignUp(w http.ResponseWriter, r *http.Request)

func (API) UpdateAudioByID

func (a API) UpdateAudioByID(w http.ResponseWriter, r *http.Request)

type AddAudioRequest

type AddAudioRequest struct {
	Author string `json:"author"`
	Title  string `json:"title"`
}

type AddAudioResponse

type AddAudioResponse struct {
	ID     string `json:"id"`
	Author string `json:"author"`
	Title  string `json:"title"`
}

type DeleteAudioByIDRequest

type DeleteAudioByIDRequest struct {
	ID string
}

type DeleteAudioByIDResponse

type DeleteAudioByIDResponse struct {
}

type ErrorResponse

type ErrorResponse struct {
	Type  string `json:"type"`
	Error string `json:"error"`
}

type FileManager

type FileManager struct {
	// contains filtered or unexported fields
}

func NewFileManager

func NewFileManager(base string) FileManager

func (FileManager) Delete

func (m FileManager) Delete(w http.ResponseWriter, id string) error

func (FileManager) Upload

func (m FileManager) Upload(w http.ResponseWriter, r *http.Request, id string) error

type GetAudioByIDRequest

type GetAudioByIDRequest struct {
	ID string
}

type GetAudioByIDResponse

type GetAudioByIDResponse AddAudioResponse

type GetAudioListResponse

type GetAudioListResponse struct {
	Audio []model.Audio `json:"audio"`
}

type SignUpRequest

type SignUpRequest struct {
	Email    string `json:"email"`
	Name     string `json:"name"`
	Password string `json:"password"`
}

type SignUpResponse

type SignUpResponse struct{}

type UpdateAudioByIDRequest

type UpdateAudioByIDRequest struct {
	ID     string
	Author string `json:"author"`
	Title  string `json:"title"`
}

type UpdateAudioByIDResponse

type UpdateAudioByIDResponse AddAudioResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL