api

package
v0.0.0-...-ad90b1c Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorMissingClientToken = errors.New("missing client token")
	ErrorInvalidClientToken = errors.New("invalid client token")
	ErrorInternal           = errors.New("internal error")
)

Functions

This section is empty.

Types

type Api

type Api struct {
	Config Config
	// contains filtered or unexported fields
}

func NewApi

func NewApi(r *registry.Registry, tokenManager *auth.TokenStore, conf Config) (*Api, error)

func (*Api) AuthMiddleware

func (a *Api) AuthMiddleware(next http.Handler) http.Handler

func (*Api) HandleFilesystem

func (a *Api) HandleFilesystem(rw http.ResponseWriter, r *http.Request)

func (*Api) JsonMiddleware

func (a *Api) JsonMiddleware(next http.Handler) http.Handler

func (*Api) NotifyShutdown

func (a *Api) NotifyShutdown() <-chan struct{}

func (*Api) Router

func (a *Api) Router() http.Handler

func (*Api) Run

func (a *Api) Run()

func (*Api) Shutdown

func (a *Api) Shutdown()

type Config

type Config struct {
	Address   string
	MaxSizeMb int32
	BlockSize int64
	PageSize  int64

	AuthMethods map[string]auth.Authenticator
}

Jump to

Keyboard shortcuts

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