Documentation ¶
Index ¶
- Constants
- Variables
- func Metadata(store kv.Store) ([]namespace.Metadata, int, error)
- func RegisterRoutes(r *queryhttp.EndpointRegistry, client clusterclient.Client, ...) error
- type AddHandler
- type DeleteHandler
- type GetHandler
- type Handler
- type ReadyHandler
- type SchemaHandler
- type SchemaResetHandler
- type UpdateHandler
Constants ¶
const ( // M3DBServiceName is the service name for M3DB. M3DBServiceName = "m3db" // ServicesPathName is the services part of the API path. ServicesPathName = "services" // M3DBNodeNamespacesKey is the KV key that holds namespaces. M3DBNodeNamespacesKey = "m3db.node.namespaces" // NamespacePathName is the namespace part of the API path. NamespacePathName = "namespace" // SchemaPathName is the schema part of the API path. SchemaPathName = "schema" )
const ( // DeleteHTTPMethod is the HTTP method used with this resource. DeleteHTTPMethod = http.MethodDelete )
Variables ¶
var ( // M3DBAddURL is the url for the M3DB namespace add handler. M3DBAddURL = path.Join(route.Prefix, M3DBServiceNamespacePathName) // AddHTTPMethod is the HTTP method used with this resource. AddHTTPMethod = http.MethodPost )
var ( // M3DBServiceNamespacePathName is the M3DB service namespace API path. M3DBServiceNamespacePathName = path.Join(ServicesPathName, M3DBServiceName, NamespacePathName) // M3DBServiceSchemaPathName is the M3DB service schema API path. M3DBServiceSchemaPathName = path.Join(ServicesPathName, M3DBServiceName, SchemaPathName) )
var ( // M3DBGetURL is the url for the namespace get handler (with the GET method). M3DBGetURL = path.Join(route.Prefix, M3DBServiceNamespacePathName) // GetHTTPMethod is the HTTP method used with this resource. GetHTTPMethod = http.MethodGet )
var ( // M3DBReadyURL is the url for the M3DB namespace mark_ready handler. M3DBReadyURL = path.Join(route.Prefix, M3DBServiceNamespacePathName, "ready") // ReadyHTTPMethod is the HTTP method used with this resource. ReadyHTTPMethod = http.MethodPost )
var ( // M3DBSchemaURL is the url for the M3DB schema handler. M3DBSchemaURL = path.Join(route.Prefix, M3DBServiceSchemaPathName) // SchemaDeployHTTPMethod is the HTTP method used to append to this resource. SchemaDeployHTTPMethod = http.MethodPost )
var ( // M3DBUpdateURL is the url for the M3DB namespace update handler. M3DBUpdateURL = path.Join(route.Prefix, M3DBServiceNamespacePathName) // UpdateHTTPMethod is the HTTP method used with this resource. UpdateHTTPMethod = http.MethodPut )
var ( // M3DBDeleteURL is the url for the M3DB namespace delete handler. M3DBDeleteURL = path.Join( route.Prefix, M3DBServiceNamespacePathName, fmt.Sprintf("{%s}", namespaceIDVar), ) )
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes( r *queryhttp.EndpointRegistry, client clusterclient.Client, clusters m3.Clusters, defaults []handleroptions.ServiceOptionsDefault, instrumentOpts instrument.Options, namespaceValidator options.NamespaceValidator, ) error
RegisterRoutes registers the namespace routes.
Types ¶
type AddHandler ¶
type AddHandler struct { Handler // contains filtered or unexported fields }
AddHandler is the handler for namespace adds.
func NewAddHandler ¶
func NewAddHandler( client clusterclient.Client, instrumentOpts instrument.Options, validator options.NamespaceValidator, ) *AddHandler
NewAddHandler returns a new instance of AddHandler.
func (*AddHandler) Add ¶
func (h *AddHandler) Add( addReq *admin.NamespaceAddRequest, opts handleroptions.ServiceOptions, ) (nsproto.Registry, error)
Add adds a namespace.
func (*AddHandler) ServeHTTP ¶
func (h *AddHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type DeleteHandler ¶
type DeleteHandler Handler
DeleteHandler is the handler for namespace deletes.
func NewDeleteHandler ¶
func NewDeleteHandler( client clusterclient.Client, instrumentOpts instrument.Options, ) *DeleteHandler
NewDeleteHandler returns a new instance of DeleteHandler.
func (*DeleteHandler) Delete ¶
func (h *DeleteHandler) Delete(id string, opts handleroptions.ServiceOptions) error
Delete deletes a namespace.
func (*DeleteHandler) ServeHTTP ¶
func (h *DeleteHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type GetHandler ¶
type GetHandler Handler
GetHandler is the handler for namespace gets.
func NewGetHandler ¶
func NewGetHandler( client clusterclient.Client, instrumentOpts instrument.Options, ) *GetHandler
NewGetHandler returns a new instance of GetHandler.
func (*GetHandler) Get ¶
func (h *GetHandler) Get(opts handleroptions.ServiceOptions) (nsproto.Registry, error)
Get gets the namespaces.
func (*GetHandler) ServeHTTP ¶
func (h *GetHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler represents a generic handler for namespace endpoints.
type ReadyHandler ¶ added in v1.0.0
type ReadyHandler Handler
ReadyHandler is the handler for marking namespaces ready.
func NewReadyHandler ¶ added in v1.0.0
func NewReadyHandler( client clusterclient.Client, clusters m3.Clusters, instrumentOpts instrument.Options, ) *ReadyHandler
NewReadyHandler returns a new instance of ReadyHandler.
func (*ReadyHandler) ServeHTTP ¶ added in v1.0.0
func (h *ReadyHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type SchemaHandler ¶ added in v0.9.5
type SchemaHandler Handler
SchemaHandler is the handler for namespace schema upserts.
func NewSchemaHandler ¶ added in v0.9.5
func NewSchemaHandler( client clusterclient.Client, instrumentOpts instrument.Options, ) *SchemaHandler
NewSchemaHandler returns a new instance of SchemaHandler.
func (*SchemaHandler) Add ¶ added in v0.9.5
func (h *SchemaHandler) Add( addReq *admin.NamespaceSchemaAddRequest, opts handleroptions.ServiceOptions, ) (admin.NamespaceSchemaAddResponse, error)
Add adds schema to an existing namespace.
func (*SchemaHandler) ServeHTTP ¶ added in v0.9.5
func (h *SchemaHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type SchemaResetHandler ¶ added in v0.9.6
type SchemaResetHandler Handler
SchemaResetHandler is the handler for namespace schema reset.
func NewSchemaResetHandler ¶ added in v0.9.6
func NewSchemaResetHandler( client clusterclient.Client, instrumentOpts instrument.Options, ) *SchemaResetHandler
NewSchemaResetHandler returns a new instance of SchemaHandler.
func (*SchemaResetHandler) Reset ¶ added in v0.9.6
func (h *SchemaResetHandler) Reset( addReq *admin.NamespaceSchemaResetRequest, opts handleroptions.ServiceOptions, ) (*admin.NamespaceSchemaResetResponse, error)
Reset resets schema for an existing namespace.
func (*SchemaResetHandler) ServeHTTP ¶ added in v0.9.6
func (h *SchemaResetHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
type UpdateHandler ¶ added in v0.15.1
type UpdateHandler Handler
UpdateHandler is the handler for namespace updates.
func NewUpdateHandler ¶ added in v0.15.1
func NewUpdateHandler( client clusterclient.Client, instrumentOpts instrument.Options, ) *UpdateHandler
NewUpdateHandler returns a new instance of UpdateHandler.
func (*UpdateHandler) ServeHTTP ¶ added in v0.15.1
func (h *UpdateHandler) ServeHTTP( svc handleroptions.ServiceNameAndDefaults, w http.ResponseWriter, r *http.Request, )
func (*UpdateHandler) Update ¶ added in v0.15.1
func (h *UpdateHandler) Update( updateReq *admin.NamespaceUpdateRequest, opts handleroptions.ServiceOptions, ) (nsproto.Registry, error)
Update updates a namespace.