Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidXForwardedFor = errors.New("Failed to parse IP from X-Forwarded-For header")
ErrInvalidXForwardedFor occurs if the X-Forwarded-For header is trusted but invalid
Functions ¶
This section is empty.
Types ¶
type ReplaceableHandler ¶
func (*ReplaceableHandler) ServeHTTP ¶
func (m *ReplaceableHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type RunContext ¶
func NewRunContext ¶
func NewRunContext(parentRouter *http.ServeMux, configPath string) *RunContext
func (*RunContext) Run ¶
func (runCtx *RunContext) Run()
type UploadServer ¶
type UploadServer struct {
DBConn *db.DatabaseConnection
Router *gin.Engine
// contains filtered or unexported fields
}
UploadServer is a simple configurable service for file sharing. Compatible with TUS upload clients.
func (*UploadServer) GetStartedChan ¶
func (serv *UploadServer) GetStartedChan() chan struct{}
GetStartedChan returns a channel that will close when the server startup is complete
func (*UploadServer) Run ¶
func (serv *UploadServer) Run(replaceableHandler *ReplaceableHandler) error
Run starts the UploadServer
func (*UploadServer) Shutdown ¶
func (serv *UploadServer) Shutdown()
Shutdown gracefully terminates the UploadServer instance. The HTTP listen socket will close immediately, causing the .Run() call to return. The call to .Shutdown() will block until all outstanding requests have been served and other resources like database connections and timers have been closed and stopped.
Click to show internal directories.
Click to hide internal directories.