1 Star 0 Fork 0

ryancartoon / sensu-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
rolebindings.go 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
Simon Plourde 提交于 2019-06-11 11:20 . APId Refactoring (#3018)
package routers
import (
"github.com/gorilla/mux"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/apid/handlers"
"github.com/sensu/sensu-go/backend/store"
)
// RoleBindingsRouter handles requests for RoleBindings.
type RoleBindingsRouter struct {
handlers handlers.Handlers
}
// NewRoleBindingsRouter instantiates a new router for RoleBindings.
func NewRoleBindingsRouter(store store.ResourceStore) *RoleBindingsRouter {
return &RoleBindingsRouter{
handlers: handlers.Handlers{
Resource: &corev2.RoleBinding{},
Store: store,
},
}
}
// Mount the RoleBindingsRouter on the given parent Router
func (r *RoleBindingsRouter) Mount(parent *mux.Router) {
routes := ResourceRoute{
Router: parent,
PathPrefix: "/namespaces/{namespace}/{resource:rolebindings}",
}
routes.Del(r.handlers.DeleteResource)
routes.Get(r.handlers.GetResource)
routes.List(r.handlers.ListResources, corev2.RoleBindingFields)
routes.ListAllNamespaces(r.handlers.ListResources, "/{resource:rolebindings}", corev2.RoleBindingFields)
routes.Post(r.handlers.CreateResource)
routes.Put(r.handlers.CreateOrUpdateResource)
}
1
https://gitee.com/ryancartoon/sensu-go.git
git@gitee.com:ryancartoon/sensu-go.git
ryancartoon
sensu-go
sensu-go
v5.10.1

搜索帮助