policy_client

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 5 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 []PolicyV0) [][]PolicyV0
}

type Destination

type Destination struct {
	ID       string `json:"id"`
	Tag      string `json:"tag,omitempty"`
	Protocol string `json:"protocol"`
	Ports    Ports  `json:"ports"`
}

type DestinationV0

type DestinationV0 struct {
	ID       string `json:"id"`
	Tag      string `json:"tag,omitempty"`
	Protocol string `json:"protocol"`
	Port     int    `json:"port"`
}

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() ([]Policy, error)

func (*InternalClient) GetPoliciesByID

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

func (*InternalClient) HealthCheck

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

type Policies

type Policies struct {
	TotalPolicies int      `json:"total_policies"`
	Policies      []Policy `json:"policies"`
}

type PoliciesV0

type PoliciesV0 struct {
	TotalPolicies int        `json:"total_policies"`
	Policies      []PolicyV0 `json:"policies"`
}

type Policy

type Policy struct {
	Source      Source      `json:"source"`
	Destination Destination `json:"destination"`
}

type PolicySlice

type PolicySlice []Policy

func (PolicySlice) Len

func (s PolicySlice) Len() int

func (PolicySlice) Less

func (s PolicySlice) Less(i, j int) bool

func (PolicySlice) Swap

func (s PolicySlice) Swap(i, j int)

type PolicyV0

type PolicyV0 struct {
	Source      SourceV0      `json:"source"`
	Destination DestinationV0 `json:"destination"`
}

type Ports

type Ports struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

type SimpleChunker

type SimpleChunker struct {
	ChunkSize int
}

func (*SimpleChunker) Chunk

func (c *SimpleChunker) Chunk(allPolicies []PolicyV0) [][]PolicyV0

type Source

type Source struct {
	ID  string `json:"id"`
	Tag string `json:"tag,omitempty"`
}

type SourceV0

type SourceV0 struct {
	ID  string `json:"id"`
	Tag string `json:"tag,omitempty"`
}

type Space

type Space struct {
	Name    string `json:name`
	OrgGUID string `json:organization_guid`
}

type SpaceV0

type SpaceV0 struct {
	Name    string `json:name`
	OrgGUID string `json:organization_guid`
}

type Tag

type Tag struct {
	ID  string `json:"id"`
	Tag string `json:"tag"`
}

type TagV0

type TagV0 struct {
	ID  string `json:"id"`
	Tag string `json:"tag"`
}

Jump to

Keyboard shortcuts

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