Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Routes = map[Route]RouterArguments{ Home: RouterArguments{Path: "/", Method: http.MethodGet}, Ping: RouterArguments{Path: "/ping", Method: http.MethodGet}, AddService: RouterArguments{Path: "/services", Method: http.MethodPost}, ListServices: RouterArguments{Path: "/services", Method: http.MethodGet}, RemoveService: RouterArguments{Path: "/services/{host}", Method: http.MethodDelete}, FindService: RouterArguments{Path: "/services/{host}", Method: http.MethodGet}, UpdateService: RouterArguments{Path: "/services/{host}", Method: http.MethodPatch}, }
Functions ¶
This section is empty.
Types ¶
type ApihubServer ¶
func New ¶
func New(log lager.Logger, listenNetwork, listenAddr string, storage apihub.Storage, servicePublisher apihub.ServicePublisher) *ApihubServer
func (*ApihubServer) Handler ¶
func (a *ApihubServer) Handler() http.Handler
func (*ApihubServer) ServeHTTP ¶
func (a *ApihubServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ApihubServer) Start ¶
func (a *ApihubServer) Start(keep bool) error
func (*ApihubServer) Stop ¶
func (a *ApihubServer) Stop() error
type CollectionSerializer ¶
type CollectionSerializer struct { Items interface{} `json:"items"` Count int `json:"item_count"` }
func Collection ¶
func Collection(data interface{}, count int) *CollectionSerializer
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) AddHandler ¶
func (router *Router) AddHandler(args RouterArguments)
func (*Router) NotFoundHandler ¶
type RouterArguments ¶
type RouterArguments struct { Handler http.HandlerFunc Path string PathPrefix string Method string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.