topic

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: Apache-2.0 Imports: 13 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 (
	// 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)

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) *AddHandler

NewAddHandler returns a new instance of AddHandler.

func (*AddHandler) ServeHTTP

func (h *AddHandler) 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) *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) *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