Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EndpointsInfo ¶
type EndpointsInfo struct {
Endpoints []HandlerInfo
}
var Endpoints *EndpointsInfo = &EndpointsInfo{ Endpoints: []HandlerInfo{ { Regexp: regexp.MustCompile("^" + api.TopicsPath + "/(?P<topic>[A-Za-z0-9_-]+)/(?P<partition>[0-9]+)/?$"), Handlers: MethodHandlers{ "GET": topicGetHandler, "POST": jsonresponse.Handler(topicPostHandler), }, }, { Regexp: regexp.MustCompile("^" + api.InfoTopicsPath + "/(?P<topic>[A-Za-z0-9_-]+)/(?P<partition>[0-9]+)/?$"), Handlers: MethodHandlers{ "GET": jsonresponse.Handler(infoSinglePartitionHandler), }, }, { Regexp: regexp.MustCompile("^" + api.InfoTopicsPath + "/(?P<topic>[A-Za-z0-9_-]+)/?$"), Handlers: MethodHandlers{ "GET": jsonresponse.Handler(infoAllPartitionHandler), }, }, { Regexp: regexp.MustCompile("^" + api.InfoTopicsPath + "/?$"), Handlers: MethodHandlers{ "GET": jsonresponse.Handler(infoTopicsHandler), }, }, { Regexp: regexp.MustCompile("^" + api.BlobsPath + "/(?P<digest>[a-zA-Z0-9]+:[a-zA-Z0-9]+)/?$"), Handlers: MethodHandlers{ "GET": blobGetHandler, }, }, { Regexp: regexp.MustCompile("^" + api.JSONTopicsPath + "/(?P<topic>[A-Za-z0-9_-]+)/(?P<partition>[0-9]+)/?$"), Handlers: MethodHandlers{ "GET": jsonresponse.Handler(jsonGetHandler), "POST": jsonresponse.Handler(jsonPostHandler), }, }, { Regexp: regexp.MustCompile("^" + api.PingPath + "$"), Handlers: MethodHandlers{ "GET": pingHandler, }, }, { Regexp: regexp.MustCompile("^" + api.EtcdMembersPath + "/(?P<memberid>[0-9]+)/?$"), Handlers: MethodHandlers{ "POST": jsonresponse.Handler(etcdUpdateHandler), "DELETE": jsonresponse.Handler(etcdDeleteHandler), }, }, { Regexp: regexp.MustCompile("^" + api.EtcdMembersPath + "$"), Handlers: MethodHandlers{ "GET": jsonresponse.Handler(etcdListHandler), "POST": jsonresponse.Handler(etcdAddHandler), }, }, { Regexp: regexp.MustCompile("^/"), Handlers: MethodHandlers{ "GET": defultHandler, }, }, }, }
type HandlerInfo ¶
type HandlerInfo struct {
Regexp *regexp.Regexp
Handlers MethodHandlers
}
type MethodHandlers ¶
Click to show internal directories.
Click to hide internal directories.