本文整理汇总了Golang中github.com/openshift/origin/pkg/authorization/api.ToClusterRole函数的典型用法代码示例。如果您正苦于以下问题:Golang ToClusterRole函数的具体用法?Golang ToClusterRole怎么用?Golang ToClusterRole使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ToClusterRole函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Get
func (s *ClusterRoleStorage) Get(ctx kapi.Context, name string) (runtime.Object, error) {
ret, err := s.roleStorage.Get(ctx, name)
if ret == nil {
return nil, err
}
return authorizationapi.ToClusterRole(ret.(*authorizationapi.Role)), err
}
示例2: Update
func (s *ClusterRoleStorage) Update(ctx kapi.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
ret, created, err := s.roleStorage.Update(ctx, name, convertingObjectInfo{objInfo})
if ret == nil {
return nil, created, err
}
return authorizationapi.ToClusterRole(ret.(*authorizationapi.Role)), created, err
}
示例3: Update
func (s *ClusterRoleStorage) Update(ctx kapi.Context, obj runtime.Object) (runtime.Object, bool, error) {
clusterObj := obj.(*authorizationapi.ClusterRole)
convertedObj := authorizationapi.ToRole(clusterObj)
ret, created, err := s.roleStorage.Update(ctx, convertedObj)
if ret == nil {
return nil, created, err
}
return authorizationapi.ToClusterRole(ret.(*authorizationapi.Role)), created, err
}
示例4: UpdatedObject
func (i convertingObjectInfo) UpdatedObject(ctx kapi.Context, old runtime.Object) (runtime.Object, error) {
oldObj := old.(*authorizationapi.Role)
convertedOldObj := authorizationapi.ToClusterRole(oldObj)
obj, err := i.UpdatedObjectInfo.UpdatedObject(ctx, convertedOldObj)
if err != nil {
return nil, err
}
clusterObj := obj.(*authorizationapi.ClusterRole)
convertedObj := authorizationapi.ToRole(clusterObj)
return convertedObj, nil
}
示例5: CreateClusterRoleWithEscalation
func (m *ClusterRoleStorage) CreateClusterRoleWithEscalation(ctx kapi.Context, obj *authorizationapi.ClusterRole) (*authorizationapi.ClusterRole, error) {
in := authorizationapi.ToRole(obj)
ret, err := m.roleStorage.CreateRoleWithEscalation(ctx, in)
return authorizationapi.ToClusterRole(ret), err
}