api

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

func Routes

func Routes(config *settings.Settings, service *bittorrent.Service, origin string) *gin.Engine

Routes defines all the routes of the server

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error" example:"Houston, we have a problem!"`
}

func NewErrorResponse

func NewErrorResponse(err interface{}) *ErrorResponse

type FileHash

type FileHash struct {
	Hash string `json:"hash"`
}

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"`
}

Jump to

Keyboard shortcuts

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