api

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

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

type Policies

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

type Policy

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

type PolicyMapper

type PolicyMapper interface {
	AsStorePolicy([]byte) ([]store.Policy, error) // marshal
	AsBytes([]store.Policy) ([]byte, error)       // unmarshal
}

func NewMapper

func NewMapper(unmarshaler marshal.Unmarshaler, marshaler marshal.Marshaler, validator validator) PolicyMapper

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 Ports

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

type Source

type Source 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 Tag

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

func MapStoreTag

func MapStoreTag(tag store.Tag) Tag

func MapStoreTags

func MapStoreTags(tags []store.Tag) []Tag

type Validator

type Validator struct{}

func (*Validator) ValidatePolicies

func (v *Validator) ValidatePolicies(policies []Policy) error

Directories

Path Synopsis
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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