apiserver

package
v0.0.0-...-69db04a Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service contains dependencies used by the service and the service implementation.

func NewService

func NewService(store storage.Storage) *Service

NewService create a new service with a default configuration.

func (*Service) Authorize

func (s *Service) Authorize(ctx context.Context, in *pb.AuthorizeRequest) (*pb.AuthorizeResponse, error)

Authorize decides whether a given authorization request should be allowed or denied.

func (*Service) CreatePolicy

func (s *Service) CreatePolicy(ctx context.Context, in *pb.CreatePolicyRequest) (*pb.Policy, error)

CreatePolicy create a policy. This function should not allow upsert and returns error when the policy already exist. This function allow End-User to override the default auto generate policy ID.

func (*Service) DeletePolicy

func (s *Service) DeletePolicy(ctx context.Context, in *pb.DeletePolicyRequest) (*empty.Empty, error)

DeletePolicy delete the policy with the given policy ID from the state. This function can or not can returns error when the given policy ID does not exist it's depend of the storage implementation.

func (*Service) GetPolicy

func (s *Service) GetPolicy(ctx context.Context, in *pb.GetPolicyRequest) (*pb.Policy, error)

GetPolicy returns the policy stored in the state. This function returns an error when the policy does not exist.

func (*Service) ListPolicies

func (s *Service) ListPolicies(ctx context.Context, in *pb.ListPoliciesRequest) (*pb.ListPoliciesResponse, error)

func (*Service) Register

func (s *Service) Register(server *grpc.Server)

Register register the service to an gRPC server.

func (*Service) UpdatePolicy

func (s *Service) UpdatePolicy(ctx context.Context, in *pb.UpdatePolicyRequest) (*pb.Policy, error)

UpdatePolicy upsert a policy. This function create the policy when the ID does not exist or update the policy with the same ID. If you need creation only use the CreatePolicy function. This function allow End-User to override the default auto generate policy ID.

Jump to

Keyboard shortcuts

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