當前位置: 首頁>>代碼示例>>Golang>>正文


Golang clusterpolicy.NewSimulatedRegistry函數代碼示例

本文整理匯總了Golang中github.com/openshift/origin/pkg/authorization/registry/clusterpolicy.NewSimulatedRegistry函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewSimulatedRegistry函數的具體用法?Golang NewSimulatedRegistry怎麽用?Golang NewSimulatedRegistry使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewSimulatedRegistry函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: makeClusterTestStorage

func makeClusterTestStorage() rolebindingregistry.Storage {
	clusterBindingRegistry := test.NewClusterPolicyBindingRegistry(testNewClusterBindings(), nil)
	clusterPolicyRegistry := test.NewClusterPolicyRegistry(testNewClusterPolicies(), nil)
	bindingRegistry := clusterpolicybindingregistry.NewSimulatedRegistry(clusterBindingRegistry)
	policyRegistry := clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry)

	return NewVirtualStorage(bindingRegistry, rulevalidation.NewDefaultRuleResolver(policyRegistry, bindingRegistry, clusterPolicyRegistry, clusterBindingRegistry))
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:8,代碼來源:virtual_storage_test.go

示例2: NewClusterRoleStorage

func NewClusterRoleStorage(clusterPolicyRegistry clusterpolicyregistry.Registry) *ClusterRoleStorage {
	return &ClusterRoleStorage{
		roleStorage: rolestorage.VirtualStorage{
			PolicyStorage:  clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry),
			CreateStrategy: roleregistry.ClusterStrategy,
			UpdateStrategy: roleregistry.ClusterStrategy},
	}
}
開發者ID:richm,項目名稱:origin,代碼行數:8,代碼來源:proxy.go

示例3: NewClusterRoleBindingStorage

func NewClusterRoleBindingStorage(clusterPolicyRegistry clusterpolicyregistry.Registry, clusterBindingRegistry clusterpolicybindingregistry.Registry) *ClusterRoleBindingStorage {
	simulatedPolicyRegistry := clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry)
	simulatedPolicyBindingRegistry := clusterpolicybindingregistry.NewSimulatedRegistry(clusterBindingRegistry)

	return &ClusterRoleBindingStorage{
		rolebindingstorage.VirtualStorage{
			PolicyRegistry:               simulatedPolicyRegistry,
			BindingRegistry:              simulatedPolicyBindingRegistry,
			ClusterPolicyRegistry:        clusterPolicyRegistry,
			ClusterPolicyBindingRegistry: clusterBindingRegistry,

			CreateStrategy: rolebindingregistry.ClusterStrategy,
			UpdateStrategy: rolebindingregistry.ClusterStrategy,
		},
	}
}
開發者ID:johnmccawley,項目名稱:origin,代碼行數:16,代碼來源:proxy.go

示例4: NewClusterRoleStorage

func NewClusterRoleStorage(clusterPolicyRegistry clusterpolicyregistry.Registry, clusterBindingRegistry clusterpolicybindingregistry.Registry) *ClusterRoleStorage {
	simulatedPolicyRegistry := clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry)

	ruleResolver := rulevalidation.NewDefaultRuleResolver(
		nil,
		nil,
		clusterpolicyregistry.ReadOnlyClusterPolicy{Registry: clusterPolicyRegistry},
		clusterpolicybindingregistry.ReadOnlyClusterPolicyBinding{Registry: clusterBindingRegistry},
	)

	return &ClusterRoleStorage{
		roleStorage: rolestorage.VirtualStorage{
			PolicyStorage: simulatedPolicyRegistry,

			RuleResolver:   ruleResolver,
			CreateStrategy: roleregistry.ClusterStrategy,
			UpdateStrategy: roleregistry.ClusterStrategy},
	}
}
開發者ID:rhamilto,項目名稱:origin,代碼行數:19,代碼來源:proxy.go

示例5: NewClusterRoleBindingStorage

func NewClusterRoleBindingStorage(clusterPolicyRegistry clusterpolicyregistry.Registry, clusterPolicyBindingRegistry clusterpolicybindingregistry.Registry) *ClusterRoleBindingStorage {
	simulatedPolicyRegistry := clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry)
	simulatedPolicyBindingRegistry := clusterpolicybindingregistry.NewSimulatedRegistry(clusterPolicyBindingRegistry)

	ruleResolver := rulevalidation.NewDefaultRuleResolver(
		simulatedPolicyRegistry,
		simulatedPolicyBindingRegistry,
		clusterPolicyRegistry,
		clusterPolicyBindingRegistry,
	)

	return &ClusterRoleBindingStorage{
		rolebindingstorage.VirtualStorage{
			BindingRegistry: simulatedPolicyBindingRegistry,

			RuleResolver:   ruleResolver,
			CreateStrategy: rolebindingregistry.ClusterStrategy,
			UpdateStrategy: rolebindingregistry.ClusterStrategy,
		},
	}
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:21,代碼來源:proxy.go

示例6: makeClusterTestStorage

func makeClusterTestStorage() rolebindingregistry.Storage {
	clusterBindingRegistry := test.NewClusterPolicyBindingRegistry(testNewClusterBindings(), nil)
	clusterPolicyRegistry := test.NewClusterPolicyRegistry(testNewClusterPolicies(), nil)

	return NewVirtualStorage(clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry), clusterpolicybindingregistry.NewSimulatedRegistry(clusterBindingRegistry), clusterPolicyRegistry, clusterBindingRegistry)
}
開發者ID:ncantor,項目名稱:origin,代碼行數:6,代碼來源:virtual_storage_test.go

示例7: makeClusterTestStorage

func makeClusterTestStorage() roleregistry.Storage {
	clusterPolicyRegistry := test.NewClusterPolicyRegistry(testNewClusterPolicies(), nil)
	policyRegistry := clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry)

	return NewVirtualStorage(policyRegistry, rulevalidation.NewDefaultRuleResolver(nil, &test.PolicyBindingRegistry{}, clusterPolicyRegistry, &test.ClusterPolicyBindingRegistry{}), nil, authorizationapi.Resource("clusterrole"))
}
開發者ID:juanluisvaladas,項目名稱:origin,代碼行數:6,代碼來源:virtual_storage_test.go

示例8: makeClusterTestStorage

func makeClusterTestStorage() roleregistry.Storage {
	clusterPolicyRegistry := test.NewClusterPolicyRegistry(testNewClusterPolicies(), nil)
	return NewVirtualStorage(clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry))
}
開發者ID:johnmccawley,項目名稱:origin,代碼行數:4,代碼來源:virtual_storage_test.go

示例9: NewClusterRoleStorage

func NewClusterRoleStorage(clusterPolicyRegistry clusterpolicyregistry.Registry) *ClusterRoleStorage {
	return &ClusterRoleStorage{rolestorage.VirtualStorage{clusterpolicyregistry.NewSimulatedRegistry(clusterPolicyRegistry), roleregistry.ClusterStrategy, roleregistry.ClusterStrategy}}
}
開發者ID:Tlacenka,項目名稱:origin,代碼行數:3,代碼來源:proxy.go


注:本文中的github.com/openshift/origin/pkg/authorization/registry/clusterpolicy.NewSimulatedRegistry函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。