Documentation
¶
Index ¶
- func CORSMiddleware(origin string) gin.HandlerFunc
- func Logger(logger *logging.Logger) gin.HandlerFunc
- func Routes(config *settings.Settings, service *bittorrent.Service, origin string) *gin.Engine
- type ErrorResponse
- type FileHash
- type FileInfoResponse
- type MessageResponse
- type NewTorrentResponse
- type TorrentInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware(origin string) gin.HandlerFunc
func Logger ¶ added in v0.0.7
func Logger(logger *logging.Logger) gin.HandlerFunc
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error" example:"Houston, we have a problem!"`
}
func NewErrorResponse ¶
func NewErrorResponse(err interface{}) *ErrorResponse
type FileInfoResponse ¶
type FileInfoResponse struct { *bittorrent.FileInfo Status *bittorrent.FileStatus `json:"status,omitempty"` }
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message" example:"done"`
}
func NewMessageResponse ¶
func NewMessageResponse(format string, a ...interface{}) *MessageResponse
type NewTorrentResponse ¶
type NewTorrentResponse struct {
InfoHash string `json:"info_hash" example:"000102030405060708090a0b0c0d0e0f10111213"`
}
type TorrentInfoResponse ¶
type TorrentInfoResponse struct { *bittorrent.TorrentInfo Status *bittorrent.TorrentStatus `json:"status,omitempty"` }
Click to show internal directories.
Click to hide internal directories.