policy_client

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

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 []models.Policy) [][]models.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 []models.Policy) error

func (*ExternalClient) DeletePolicies

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

func (*ExternalClient) GetPolicies

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

func (*ExternalClient) GetPoliciesByID

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

type ExternalPolicyClient

type ExternalPolicyClient interface {
	GetPolicies(token string) ([]models.Policy, error)
	GetPoliciesByID(token string, ids ...string) ([]models.Policy, error)
	DeletePolicies(token string, policies []models.Policy) error
	AddPolicies(token string, policies []models.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() ([]models.Policy, error)

func (*InternalClient) GetPoliciesByID

func (c *InternalClient) GetPoliciesByID(ids ...string) ([]models.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 []models.Policy) [][]models.Policy

Jump to

Keyboard shortcuts

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