Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(r *teapot.Router, h RouteHandlers)
RegisterRoutes mounts all DirIO REST API endpoints under /.dirio/api/v1/. Caller is responsible for wrapping r in auth middleware before calling this. When h is a stub (nil api), handlers return 200 OK (used by CLI route listing).
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements RouteHandlers by delegating to consoleapi.API. When api is nil (e.g. CLI route listing) all handlers return 200 OK stubs.
func New ¶
func New(api consoleapi.API, adminKeys policy.AdminKeyChecker) *Handler
New creates a Handler. api and adminKeys must both be non-nil for production use; pass nil for both when registering stub routes (CLI route listing).
func (*Handler) HandleGetBucketOwner ¶
HandleGetBucketOwner handles GET /.dirio/api/v1/buckets/{bucket}/owner
func (*Handler) HandleGetEffectivePermissions ¶
HandleGetEffectivePermissions handles GET /.dirio/api/v1/buckets/{bucket}/permissions/{accessKey}
func (*Handler) HandleGetObjectOwner ¶
HandleGetObjectOwner handles GET /.dirio/api/v1/buckets/{bucket}/objects/{key:.*}
func (*Handler) HandleSimulate ¶
HandleSimulate handles POST /.dirio/api/v1/simulate
func (*Handler) HandleTransferBucketOwner ¶
HandleTransferBucketOwner handles PUT /.dirio/api/v1/buckets/{bucket}/owner
type RouteHandlers ¶
type RouteHandlers interface {
HandleGetBucketOwner() http.Handler
HandleTransferBucketOwner() http.Handler
HandleGetObjectOwner() http.Handler
HandleSimulate() http.Handler
HandleGetEffectivePermissions() http.Handler
}
RouteHandlers defines the HTTP handler surface for the DirIO REST API (/.dirio/api/v1/).