forked from projectatomic/atomic-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.go
25 lines (22 loc) · 1.25 KB
/
registry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package policybinding
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
klabels "github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
// Registry is an interface for things that know how to store Policies.
type Registry interface {
// ListPolicyBindings obtains list of policyBindings that match a selector.
ListPolicyBindings(ctx kapi.Context, labels, fields klabels.Selector) (*authorizationapi.PolicyBindingList, error)
// GetPolicyBinding retrieves a specific policyBinding.
GetPolicyBinding(ctx kapi.Context, id string) (*authorizationapi.PolicyBinding, error)
// CreatePolicyBinding creates a new policyBinding.
CreatePolicyBinding(ctx kapi.Context, policyBinding *authorizationapi.PolicyBinding) error
// UpdatePolicyBinding updates a policyBinding.
UpdatePolicyBinding(ctx kapi.Context, policyBinding *authorizationapi.PolicyBinding) error
// DeletePolicyBinding deletes a policyBinding.
DeletePolicyBinding(ctx kapi.Context, id string) error
// WatchPolicyBindings watches policyBindings.
WatchPolicyBindings(ctx kapi.Context, label, field klabels.Selector, resourceVersion string) (watch.Interface, error)
}