Documentation ¶
Index ¶
- Constants
- Variables
- func GetServerAddress() string
- func Index(ctx *fasthttp.RequestCtx)
- func Json(object interface{}, ctx *fasthttp.RequestCtx)
- func LogRequestMiddleware(h fasthttp.RequestHandler) fasthttp.RequestHandler
- type AllocateUploadSlotRequest
- type GenericResponse
- type GetUploadSlotResponse
- type Info
- type UploadSlot
- type WebApi
- func (api *WebApi) AllocateUploadSlot(ctx *fasthttp.RequestCtx)
- func (api *WebApi) DisposeStaleUploadSlots()
- func (api *WebApi) ReadUploadSlot(ctx *fasthttp.RequestCtx)
- func (api *WebApi) Run()
- func (api *WebApi) Upload(ctx *fasthttp.RequestCtx)
- func (api *WebApi) UploadSlotInfo(ctx *fasthttp.RequestCtx)
- type WebsocketMotd
Constants ¶
View Source
const WsBufferSize = 4096
Variables ¶
View Source
var Mutexes sync.Map
View Source
var Secret = []byte(getApiSecret())
View Source
var WorkDir = getWorkDir()
Functions ¶
func Index ¶
func Index(ctx *fasthttp.RequestCtx)
func Json ¶
func Json(object interface{}, ctx *fasthttp.RequestCtx)
func LogRequestMiddleware ¶
func LogRequestMiddleware(h fasthttp.RequestHandler) fasthttp.RequestHandler
Types ¶
type AllocateUploadSlotRequest ¶
type AllocateUploadSlotRequest struct { Token string `json:"token"` MaxSize int64 `json:"max_size"` FileName string `json:"file_name"` ToDisposeDate int64 `json:"to_dispose_date"` UploadHook string `json:"upload_hook"` }
func (*AllocateUploadSlotRequest) IsValid ¶
func (req *AllocateUploadSlotRequest) IsValid() bool
type GenericResponse ¶
type GetUploadSlotResponse ¶
type GetUploadSlotResponse struct {
UploadSlot `json:"upload_slot"`
}
type UploadSlot ¶
type WebApi ¶
type WebApi struct { MotdMessage *websocket.PreparedMessage Cron *cron.Cron // contains filtered or unexported fields }
func (*WebApi) AllocateUploadSlot ¶
func (api *WebApi) AllocateUploadSlot(ctx *fasthttp.RequestCtx)
func (*WebApi) DisposeStaleUploadSlots ¶
func (api *WebApi) DisposeStaleUploadSlots()
func (*WebApi) ReadUploadSlot ¶
func (api *WebApi) ReadUploadSlot(ctx *fasthttp.RequestCtx)
func (*WebApi) Upload ¶
func (api *WebApi) Upload(ctx *fasthttp.RequestCtx)
func (*WebApi) UploadSlotInfo ¶
func (api *WebApi) UploadSlotInfo(ctx *fasthttp.RequestCtx)
type WebsocketMotd ¶
Click to show internal directories.
Click to hide internal directories.