server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsMiddleware added in v0.2.0

func CorsMiddleware(next http.Handler) http.Handler

func InternalErrorRedacter

func InternalErrorRedacter(next http.Handler) http.Handler

InternalErrorRedacter is a middleware that will redact internal error messages. It will replace the response body with a generic message and an id and log the original message.

Types

type Config

type Config struct {
	// Addr is the host:port the server will listen on
	Addr string

	// AllowRawBody allows to upload files using raw body data instead of multipart form data
	// Eg. This is what is used when uploading files using curl
	AllowRawBody bool

	// DefaultAuthPlugin is the name of the default auth plugin to use if the provider does not specify one
	DefaultAuthPlugin string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(serverCfg Config, plugins []authPlugin.Plugin) (*Server, error)

NewServer creates a new server instance No providers are registered by default, they must be registered using the RegisterProvider method

func (*Server) ProviderIds

func (s *Server) ProviderIds() []string

func (*Server) RegisterProvider

func (s *Server) RegisterProvider(p provider.Provider) error

func (*Server) RemoveProvider

func (s *Server) RemoveProvider(id string)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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