policy_client

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMaxPolicies = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunker

type Chunker interface {
	Chunk(allPolicies []api_v0.Policy) [][]api_v0.Policy
}

type ExternalClient

type ExternalClient struct {
	JsonClient json_client.JsonClient
	Chunker    Chunker
}

func NewExternal

func NewExternal(logger lager.Logger, httpClient json_client.HttpClient, baseURL string) *ExternalClient

func (*ExternalClient) AddPolicies

func (c *ExternalClient) AddPolicies(token string, policies []api.Policy) error

func (*ExternalClient) AddPoliciesV0

func (c *ExternalClient) AddPoliciesV0(token string, policies []api_v0.Policy) error

func (*ExternalClient) DeletePolicies

func (c *ExternalClient) DeletePolicies(token string, policies []api.Policy) error

func (*ExternalClient) DeletePoliciesV0

func (c *ExternalClient) DeletePoliciesV0(token string, policies []api_v0.Policy) error

func (*ExternalClient) GetPolicies

func (c *ExternalClient) GetPolicies(token string) ([]api.Policy, error)

func (*ExternalClient) GetPoliciesByID

func (c *ExternalClient) GetPoliciesByID(token string, ids ...string) ([]api.Policy, error)

func (*ExternalClient) GetPoliciesV0

func (c *ExternalClient) GetPoliciesV0(token string) ([]api_v0.Policy, error)

func (*ExternalClient) GetPoliciesV0ByID

func (c *ExternalClient) GetPoliciesV0ByID(token string, ids ...string) ([]api_v0.Policy, error)

type ExternalPolicyClient

type ExternalPolicyClient interface {
	GetPolicies(token string) ([]api.Policy, error)
	GetPoliciesByID(token string, ids ...string) ([]api.Policy, error)
	GetPoliciesV0(token string) ([]api_v0.Policy, error)
	GetPoliciesV0ByID(token string, ids ...string) ([]api_v0.Policy, error)
	DeletePolicies(token string, policies []api.Policy) error
	DeletePoliciesV0(token string, policies []api_v0.Policy) error
	AddPolicies(token string, policies []api.Policy) error
	AddPoliciesV0(token string, policies []api_v0.Policy) error
}

type InternalClient

type InternalClient struct {
	JsonClient json_client.JsonClient
}

func NewInternal

func NewInternal(logger lager.Logger, httpClient json_client.HttpClient, baseURL string) *InternalClient

func (*InternalClient) GetPolicies

func (c *InternalClient) GetPolicies() ([]api.Policy, error)

func (*InternalClient) GetPoliciesByID

func (c *InternalClient) GetPoliciesByID(ids ...string) ([]api.Policy, error)

func (*InternalClient) HealthCheck

func (c *InternalClient) HealthCheck() (bool, error)

type SimpleChunker

type SimpleChunker struct {
	ChunkSize int
}

func (*SimpleChunker) Chunk

func (c *SimpleChunker) Chunk(allPolicies []api_v0.Policy) [][]api_v0.Policy

Jump to

Keyboard shortcuts

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