server

package
v0.0.0-...-33f6f7a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 26 Imported by: 1

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

type ReplaceableHandler struct {
	Handler http.Handler
}

func (*ReplaceableHandler) ServeHTTP

func (m *ReplaceableHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type RunContext

type RunContext struct {
	ShutdownPromise sync.WaitGroup
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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