router

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.7.0

func New(config Config) (http.Handler, error)

func PolicyMiddleware added in v0.7.0

func PolicyMiddleware(policySvc policy.Service) func(next http.Handler) http.Handler

func S3Middleware added in v0.7.0

func S3Middleware() func(next http.Handler) http.Handler

func SwiftMiddleware added in v0.7.0

func SwiftMiddleware() func(next http.Handler) http.Handler

Types

type Config added in v0.7.0

type Config struct {
	Storages          map[dom.StorageType]StorageProxy
	LogMiddleware     func(next http.Handler) http.Handler
	TraceMiddleware   func(next http.Handler) http.Handler
	MetricsMiddleware func(next http.Handler) http.Handler
	PolicyMiddleware  func(next http.Handler) http.Handler
}

func (*Config) Validate added in v0.7.0

func (c *Config) Validate() error

type Router

type Router interface {
	Route(r *http.Request) (resp *http.Response, task []tasks.ReplicationTask, storage string, isApiErr bool, err error)
}

func NewS3Router added in v0.7.0

func NewS3Router(
	clients objstore.Clients,
	versionSvc meta.VersionService,
	uploadSvc *storage.UploadSvc,
	limit ratelimit.RPM) Router

func NewSwiftRouter added in v0.7.0

func NewSwiftRouter(
	conf map[string]*SwiftStorage,
	limit ratelimit.RPM) Router

type StorageProxy added in v0.7.0

type StorageProxy struct {
	Router             Router
	Replicator         replication.Service
	AuthMiddleware     func(next http.Handler) http.Handler
	ReqParseMiddleware func(next http.Handler) http.Handler
}

type SwiftStorage added in v0.7.0

type SwiftStorage struct {
	StorageURL string `yaml:"storageURL"`
}

func (*SwiftStorage) HasUser added in v0.7.0

func (s *SwiftStorage) HasUser(user string) bool

func (*SwiftStorage) UserList added in v0.7.0

func (s *SwiftStorage) UserList() []string

func (*SwiftStorage) Validate added in v0.7.0

func (s *SwiftStorage) Validate() error

Jump to

Keyboard shortcuts

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