topic

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

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

	// AddHTTPMethod is the HTTP method used with this resource.
	AddHTTPMethod = http.MethodPost
)
View Source
const (
	// DefaultTopicName is the default topic name
	DefaultTopicName = "aggregated_metrics"
	// HeaderTopicName is the header used to specify the topic name.
	HeaderTopicName = "topic-name"
)
View Source
const (
	// DeleteURL is the url for the topic delete handler (with the DELETE method).
	DeleteURL = handler.RoutePrefixV1 + "/topic"

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

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

	// InitHTTPMethod is the HTTP method used with this resource.
	InitHTTPMethod = http.MethodPost
)

Variables

This section is empty.

Functions

func RegisterRoutes

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

RegisterRoutes registers the topic routes

func Service

func Service(clusterClient clusterclient.Client) (topic.Service, error)

Service gets a topic service from m3cluster client

Types

type AddHandler

type AddHandler Handler

AddHandler is the handler for topic adds.

func NewAddHandler

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

NewAddHandler returns a new instance of AddHandler.

func (*AddHandler) ServeHTTP

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

type DeleteHandler added in v0.12.0

type DeleteHandler Handler

DeleteHandler is the handler for topic adds.

func NewDeleteHandler added in v0.12.0

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

NewDeleteHandler returns a new instance of DeleteHandler.

func (*DeleteHandler) ServeHTTP added in v0.12.0

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

type GetHandler

type GetHandler Handler

GetHandler is the handler for topic gets.

func NewGetHandler

func NewGetHandler(
	client clusterclient.Client,
	cfg config.Configuration,
	instrumentOpts instrument.Options,
) *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 topic endpoints. nolint: structcheck

type InitHandler

type InitHandler Handler

InitHandler is the handler for topic inits.

func NewInitHandler

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

NewInitHandler returns a new instance of InitHandler.

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