Help us shape the future of Go! Take the 2026 Go Developer Survey

policy

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Strategy = strategy{kapi.Scheme}

Strategy is the default logic that applies when creating and updating Policy objects.

Functions

func Matcher

func Matcher(label labels.Selector, field fields.Selector) generic.Matcher

Matcher returns a generic matcher for a given label and field selector.

func SelectableFields

func SelectableFields(policy *authorizationapi.Policy) fields.Set

SelectableFields returns a label set that represents the object

Types

type Registry

type Registry interface {
	// ListPolicies obtains list of policies that match a selector.
	ListPolicies(ctx kapi.Context, label labels.Selector, field fields.Selector) (*authorizationapi.PolicyList, error)
	// GetPolicy retrieves a specific policy.
	GetPolicy(ctx kapi.Context, id string) (*authorizationapi.Policy, error)
	// CreatePolicy creates a new policy.
	CreatePolicy(ctx kapi.Context, policy *authorizationapi.Policy) error
	// UpdatePolicy updates a policy.
	UpdatePolicy(ctx kapi.Context, policy *authorizationapi.Policy) error
	// DeletePolicy deletes a policy.
	DeletePolicy(ctx kapi.Context, id string) error
}

Registry is an interface for things that know how to store Policies.

type Storage

type Storage interface {
	rest.StandardStorage
}

Storage is an interface for a standard REST Storage backend

type WatchingRegistry

type WatchingRegistry interface {
	Registry
	// WatchPolicies watches policies.
	WatchPolicies(ctx kapi.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
}

func NewRegistry

func NewRegistry(s Storage) WatchingRegistry

NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic.

Source Files

  • registry.go
  • strategy.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL