database

package
Version: v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Overview

Package database contains API endpoints for managing the database.

Index

Constants

View Source
const (
	// CreateURL is the URL for the database create handler.
	CreateURL = route.Prefix + "/database/create"

	// CreateNamespaceURL is the URL for the database namespace create handler.
	CreateNamespaceURL = route.Prefix + "/database/namespace/create"

	// CreateHTTPMethod is the HTTP method used with the create database resource.
	CreateHTTPMethod = http.MethodPost

	// CreateNamespaceHTTPMethod is the HTTP method used with the create database namespace resource.
	CreateNamespaceHTTPMethod = http.MethodPost

	// DefaultLocalHostID is the default local host ID when creating a database.
	DefaultLocalHostID = "m3db_local"

	// DefaultLocalIsolationGroup is the default isolation group when creating a
	// local database.
	DefaultLocalIsolationGroup = "local"

	// DefaultLocalZone is the default zone when creating a local database.
	DefaultLocalZone = "embedded"
)
View Source
const (
	// KeyValueStoreURL is the url to edit key/value configuration values.
	KeyValueStoreURL = route.Prefix + "/kvstore"
	// KeyValueStoreHTTPMethod is the HTTP method used with this resource.
	KeyValueStoreHTTPMethod = http.MethodPost
)

Variables

This section is empty.

Functions

func NewCreateHandler

func NewCreateHandler(
	client clusterclient.Client,
	cfg config.Configuration,
	embeddedDBCfg *dbconfig.DBConfiguration,
	defaults []handleroptions.ServiceOptionsDefault,
	instrumentOpts instrument.Options,
	namespaceValidator options.NamespaceValidator,
) (http.Handler, error)

NewCreateHandler returns a new instance of a database create handler.

func NewKeyValueStoreHandler added in v1.0.1

func NewKeyValueStoreHandler(
	client clusterclient.Client,
	instrumentOpts instrument.Options,
	kvStoreProtoParser options.KVStoreProtoParser,
) http.Handler

NewKeyValueStoreHandler returns a new instance of handler

func RegisterRoutes

func RegisterRoutes(
	r *queryhttp.EndpointRegistry,
	client clusterclient.Client,
	cfg config.Configuration,
	embeddedDBCfg *dbconfig.DBConfiguration,
	defaults []handleroptions.ServiceOptionsDefault,
	instrumentOpts instrument.Options,
	namespaceValidator options.NamespaceValidator,
	kvStoreProtoParser options.KVStoreProtoParser,
) error

RegisterRoutes registers the namespace routes

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler represents a generic handler for namespace endpoints.

type KeyValueStoreHandler added in v1.0.1

type KeyValueStoreHandler struct {
	// contains filtered or unexported fields
}

KeyValueStoreHandler represents a handler for the key/value store endpoint

func (*KeyValueStoreHandler) ServeHTTP added in v1.0.1

func (h *KeyValueStoreHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type KeyValueUpdate added in v1.0.1

type KeyValueUpdate struct {
	// Key to update.
	Key string `json:"key"`
	// Value to update the key to.
	Value json.RawMessage `json:"value"`
	// Commit, if false, will not persist the update. If true, the
	// update will be persisted. Used to test format of inputs.
	Commit bool `json:"commit"`
}

KeyValueUpdate defines an update to a key's value.

type KeyValueUpdateResult added in v1.0.1

type KeyValueUpdateResult struct {
	// Key to update.
	Key string `json:"key"`
	// Old is the value before the update.
	Old json.RawMessage `json:"old"`
	// New is the value after the update.
	New json.RawMessage `json:"new"`
	// Version of the key.
	Version int `json:"version"`
}

KeyValueUpdateResult defines the result of an update to a key's value.

Jump to

Keyboard shortcuts

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