本文整理匯總了Golang中github.com/Unknwon/macaron.Macaron.Head方法的典型用法代碼示例。如果您正苦於以下問題:Golang Macaron.Head方法的具體用法?Golang Macaron.Head怎麽用?Golang Macaron.Head使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/Unknwon/macaron.Macaron
的用法示例。
在下文中一共展示了Macaron.Head方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: selectRoute
func selectRoute(m *macaron.Macaron, method string, h macaron.Handler) {
switch method {
case "GET":
m.Get("/", h)
case "PATCH":
m.Patch("/", h)
case "POST":
m.Post("/", h)
case "PUT":
m.Put("/", h)
case "DELETE":
m.Delete("/", h)
case "OPTIONS":
m.Options("/", h)
case "HEAD":
m.Head("/", h)
default:
panic("bad method")
}
}
示例2: SetRouters
func SetRouters(m *macaron.Macaron) {
//Docker Registry & Hub V1 API
m.Group("/v1", func() {
m.Get("/_ping", handler.GetPingV1Handler)
m.Get("/users", handler.GetUsersV1Handler)
m.Post("/users", handler.PostUsersV1Handler)
m.Group("/repositories", func() {
m.Put("/:namespace/:repository/tags/:tag", handler.PutTagV1Handler)
m.Put("/:namespace/:repository/images", handler.PutRepositoryImagesV1Handler)
m.Get("/:namespace/:repository/images", handler.GetRepositoryImagesV1Handler)
m.Get("/:namespace/:repository/tags", handler.GetTagV1Handler)
m.Put("/:namespace/:repository", handler.PutRepositoryV1Handler)
})
m.Group("/images", func() {
m.Get("/:imageId/ancestry", handler.GetImageAncestryV1Handler)
m.Get("/:imageId/json", handler.GetImageJSONV1Handler)
m.Get("/:imageId/layer", handler.GetImageLayerV1Handler)
m.Put("/:imageId/json", handler.PutImageJSONV1Handler)
m.Put("/:imageId/layer", handler.PutImageLayerv1Handler)
m.Put("/:imageId/checksum", handler.PutImageChecksumV1Handler)
})
})
//Docker Registry & Hub V2 API
m.Group("/v2", func() {
m.Get("/", handler.GetPingV2Handler)
m.Head("/:namespace/:repository/blobs/:digest", handler.HeadBlobsV2Handler)
m.Post("/:namespace/:repository/blobs/uploads", handler.PostBlobsV2Handler)
m.Patch("/:namespace/:repository/blobs/uploads/:uuid", handler.PatchBlobsV2Handler)
m.Put("/:namespace/:repository/blobs/uploads/:uuid", handler.PutBlobsV2Handler)
m.Get("/:namespace/:repository/blobs/:digest", handler.GetBlobsV2Handler)
m.Put("/:namespace/:repository/manifests/:tag", handler.PutManifestsV2Handler)
m.Get("/:namespace/:repository/tags/list", handler.GetTagsListV2Handler)
m.Get("/:namespace/:repository/manifests/:tag", handler.GetManifestsV2Handler)
})
}