Back to godoc.org

Package topic

v0.0.0-...-9649366
Latest Go to latest

The highest tagged major version is .

Published: Nov 21, 2019 | License: Apache-2.0 | Module: github.com/chronosphereiox/m3

Index

Constants

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
)
const (
	// DefaultTopicName is the default topic name
	DefaultTopicName = "aggregated_metrics"
	// HeaderTopicName is the header used to specify the topic name.
	HeaderTopicName = "topic-name"
)
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
)
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
)
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
)

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

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

type DeleteHandler Handler

DeleteHandler is the handler for topic adds.

func NewDeleteHandler

func NewDeleteHandler(
	client clusterclient.Client,
	cfg config.Configuration,
	instrumentOpts instrument.Options,
) *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 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)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier