namespace

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (

	// DeleteHTTPMethod is the HTTP method used with this resource.
	DeleteHTTPMethod = http.MethodDelete
)

Variables

View Source
var (
	// DeprecatedM3DBAddURL is the old url for the namespace add handler, maintained
	// for backwards compatibility.
	DeprecatedM3DBAddURL = path.Join(handler.RoutePrefixV1, NamespacePathName)

	// M3DBAddURL is the url for the M3DB namespace add handler.
	M3DBAddURL = path.Join(handler.RoutePrefixV1, M3DBServiceNamespacePathName)

	// AddHTTPMethod is the HTTP method used with this resource.
	AddHTTPMethod = http.MethodPost
)
View Source
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)
)
View Source
var (
	// DeprecatedM3DBDeleteURL is the deprecated url for the M3DB namespace delete handler.
	// Maintained for backwards compatibility.
	DeprecatedM3DBDeleteURL = fmt.Sprintf("%s/namespace/{%s}", handler.RoutePrefixV1, namespaceIDVar)

	// M3DBDeleteURL is the url for the M3DB namespace delete handler.
	M3DBDeleteURL = path.Join(
		handler.RoutePrefixV1,
		M3DBServiceNamespacePathName,
		fmt.Sprintf("{%s}", namespaceIDVar),
	)
)
View Source
var (
	// DeprecatedM3DBGetURL is the deprecated url for the namespace get handler (with the GET method).
	// Maintained for backwards compatibility.
	DeprecatedM3DBGetURL = path.Join(handler.RoutePrefixV1, NamespacePathName)

	// M3DBGetURL is the url for the namespace get handler (with the GET method).
	M3DBGetURL = path.Join(handler.RoutePrefixV1, M3DBServiceNamespacePathName)

	// GetHTTPMethod is the HTTP method used with this resource.
	GetHTTPMethod = http.MethodGet
)
View Source
var (
	// M3DBSchemaURL is the url for the M3DB schema handler.
	M3DBSchemaURL = path.Join(handler.RoutePrefixV1, M3DBServiceSchemaPathName)

	// SchemaDeployHTTPMethod is the HTTP method used to append to this resource.
	SchemaDeployHTTPMethod = http.MethodPost
)

Functions

func Metadata

func Metadata(store kv.Store) ([]namespace.Metadata, int, error)

Metadata returns the current metadata in the given store and its version

func RegisterRoutes

func RegisterRoutes(
	r *mux.Router,
	client clusterclient.Client,
	defaults []handler.ServiceOptionsDefault,
	instrumentOpts instrument.Options,
)

RegisterRoutes registers the namespace routes.

Types

type AddHandler

type AddHandler Handler

AddHandler is the handler for namespace adds.

func NewAddHandler

func NewAddHandler(
	client clusterclient.Client,
	instrumentOpts instrument.Options,
) *AddHandler

NewAddHandler returns a new instance of AddHandler.

func (*AddHandler) Add

Add adds a namespace.

func (*AddHandler) ServeHTTP

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) error

Delete deletes a namespace.

func (*DeleteHandler) ServeHTTP

func (h *DeleteHandler) ServeHTTP(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() (nsproto.Registry, error)

Get gets the namespaces.

func (*GetHandler) ServeHTTP

func (h *GetHandler) ServeHTTP(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 SchemaHandler

type SchemaHandler Handler

SchemaHandler is the handler for namespace schema upserts.

func NewSchemaHandler

func NewSchemaHandler(
	client clusterclient.Client,
	instrumentOpts instrument.Options,
) *SchemaHandler

NewSchemaHandler returns a new instance of SchemaHandler.

func (*SchemaHandler) Add

Add adds schema to an existing namespace.

func (*SchemaHandler) ServeHTTP

type SchemaResetHandler

type SchemaResetHandler Handler

SchemaResetHandler is the handler for namespace schema reset.

func NewSchemaResetHandler

func NewSchemaResetHandler(
	client clusterclient.Client,
	instrumentOpts instrument.Options,
) *SchemaResetHandler

NewSchemaResetHandler returns a new instance of SchemaHandler.

func (*SchemaResetHandler) Reset

Reset resets schema for an existing namespace.

func (*SchemaResetHandler) ServeHTTP

Jump to

Keyboard shortcuts

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