placement

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// AddURL is the url for the placement add handler (with the POST method).
	AddURL = handler.RoutePrefixV1 + "/placement"

	// AddHTTPMethod is the HTTP method used with this resource.
	AddHTTPMethod = http.MethodPost
)
View Source
const (
	// DefaultServiceName is the default service ID name
	DefaultServiceName = "m3db"
	// DefaultServiceEnvironment is the default service ID environment
	DefaultServiceEnvironment = "default_env"
	// DefaultServiceZone is the default service ID zone
	DefaultServiceZone = "embedded"
	// HeaderClusterServiceName is the header used to specify the service name.
	HeaderClusterServiceName = "Cluster-Service-Name"
	// HeaderClusterEnvironmentName is the header used to specify the environment name.
	HeaderClusterEnvironmentName = "Cluster-Environment-Name"
	// HeaderClusterZoneName is the header used to specify the zone name.
	HeaderClusterZoneName = "Cluster-Zone-Name"
)
View Source
const (
	// DeleteAllURL is the url for the handler to delete all placements (with the DELETE method).
	DeleteAllURL = handler.RoutePrefixV1 + "/placement"

	// DeleteAllHTTPMethod is the HTTP method used with this resource.
	DeleteAllHTTPMethod = http.MethodDelete
)
View Source
const (
	// GetURL is the url for the placement get handler (with the GET method).
	GetURL = handler.RoutePrefixV1 + "/placement"

	// GetHTTPMethod is the HTTP method used with this resource.
	GetHTTPMethod = http.MethodGet
)
View Source
const (
	// InitURL is the url for the placement init handler (with the POST method).
	InitURL = handler.RoutePrefixV1 + "/placement/init"

	// InitHTTPMethod is the HTTP method used with this resource.
	InitHTTPMethod = http.MethodPost
)
View Source
const (

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

Variables

View Source
var (
	// DeleteURL is the url for the placement delete handler.
	DeleteURL = fmt.Sprintf("%s/placement/{%s}", handler.RoutePrefixV1, placementIDVar)
)

Functions

func ConvertInstancesProto

func ConvertInstancesProto(instancesProto []*placementpb.Instance) ([]placement.Instance, error)

ConvertInstancesProto converts a slice of protobuf `Instance`s to `placement.Instance`s

func RegisterRoutes

func RegisterRoutes(r *mux.Router, client clusterclient.Client, cfg config.Configuration)

RegisterRoutes registers the placement routes

func Service

func Service(clusterClient clusterclient.Client, headers http.Header) (placement.Service, error)

Service gets a placement service from m3cluster client

Types

type AddHandler

type AddHandler Handler

AddHandler is the handler for placement adds.

func NewAddHandler

func NewAddHandler(client clusterclient.Client, cfg config.Configuration) *AddHandler

NewAddHandler returns a new instance of AddHandler.

func (*AddHandler) Add

Add adds a placement.

func (*AddHandler) ServeHTTP

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

type DeleteAllHandler

type DeleteAllHandler Handler

DeleteAllHandler is the handler to delete all placements.

func NewDeleteAllHandler

func NewDeleteAllHandler(client clusterclient.Client, cfg config.Configuration) *DeleteAllHandler

NewDeleteAllHandler returns a new instance of DeleteAllHandler.

func (*DeleteAllHandler) ServeHTTP

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

type DeleteHandler

type DeleteHandler Handler

DeleteHandler is the handler for placement deletes.

func NewDeleteHandler

func NewDeleteHandler(client clusterclient.Client, cfg config.Configuration) *DeleteHandler

NewDeleteHandler returns a new instance of DeleteHandler.

func (*DeleteHandler) ServeHTTP

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

type GetHandler

type GetHandler Handler

GetHandler is the handler for placement gets.

func NewGetHandler

func NewGetHandler(client clusterclient.Client, cfg config.Configuration) *GetHandler

NewGetHandler returns a new instance of GetHandler.

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 placement endpoints.

type InitHandler

type InitHandler Handler

InitHandler is the handler for placement inits.

func NewInitHandler

func NewInitHandler(client clusterclient.Client, cfg config.Configuration) *InitHandler

NewInitHandler returns a new instance of InitHandler.

func (*InitHandler) Init

Init initializes a placement.

func (*InitHandler) ServeHTTP

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

Jump to

Keyboard shortcuts

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