Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 Config ¶
type Config struct { Server struct { ListenAddress string BasePath string CorsOrigins []string TrustedReverseProxyRanges []ipnet } Storage struct { Path string ShardLayers int MaximumUploadSize datasize.ByteSize } Database struct { Type string Path string } Expiration struct { MaxAge duration IdentifiedMaxAge duration CheckInterval duration } JwtSecretsByIssuer map[string]string Loggers []LoggerConfig }
func (*Config) DoPostLoadLogging ¶
type LoggerConfig ¶
type LoggerConfig struct { Level logLevel Format logFormat Output logOutput }
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 UnknownIssuerError ¶
type UnknownIssuerError struct {
Issuer string
}
UnknownIssuerError occurs when a file creation request includes an EXTJWT with an issuer that is not present in the config
func (UnknownIssuerError) Error ¶
func (e UnknownIssuerError) Error() string
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.