Documentation ¶
Index ¶
- Constants
- Variables
- type Chunker
- type Config
- type Destination
- type DestinationV0
- type ExternalClient
- func (c *ExternalClient) AddPolicies(token string, policies []Policy) error
- func (c *ExternalClient) AddPoliciesV0(token string, policies []PolicyV0) error
- func (c *ExternalClient) DeletePolicies(token string, policies []Policy) error
- func (c *ExternalClient) DeletePoliciesV0(token string, policies []PolicyV0) error
- func (c *ExternalClient) GetPolicies(token string) ([]Policy, error)
- func (c *ExternalClient) GetPoliciesByID(token string, ids ...string) ([]Policy, error)
- func (c *ExternalClient) GetPoliciesV0(token string) ([]PolicyV0, error)
- func (c *ExternalClient) GetPoliciesV0ByID(token string, ids ...string) ([]PolicyV0, error)
- type ExternalPolicyClient
- type IPRange
- type InternalClient
- func (c *InternalClient) CreateOrGetTag(id, groupType string) (string, error)
- func (c *InternalClient) GetPolicies() ([]*Policy, error)
- func (c *InternalClient) GetPoliciesByID(ids ...string) ([]Policy, error)
- func (c *InternalClient) GetPoliciesLastUpdated() (int, error)
- func (c *InternalClient) GetSecurityGroupsForSpace(spaceGuids ...string) ([]SecurityGroup, error)
- func (c *InternalClient) HealthCheck() (bool, error)
- type InternalPolicyClient
- type Policies
- type PoliciesV0
- type Policy
- type PolicySlice
- type PolicyV0
- type Ports
- type SecurityGroup
- type SecurityGroupRule
- type SecurityGroupRules
- type SecurityGroupsResponse
- type SimpleChunker
- type Source
- type SourceV0
- type Space
- type SpaceV0
- type Tag
- type TagRequest
- type TagV0
Constants ¶
View Source
const DefaultMaxPolicies = 100
Variables ¶
View Source
var DefaultConfig = Config{
PerPageSecurityGroups: 5000,
}
Functions ¶
This section is empty.
Types ¶
type Destination ¶
type DestinationV0 ¶
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 []Policy) error
func (*ExternalClient) AddPoliciesV0 ¶
func (c *ExternalClient) AddPoliciesV0(token string, policies []PolicyV0) error
func (*ExternalClient) DeletePolicies ¶
func (c *ExternalClient) DeletePolicies(token string, policies []Policy) error
func (*ExternalClient) DeletePoliciesV0 ¶
func (c *ExternalClient) DeletePoliciesV0(token string, policies []PolicyV0) error
func (*ExternalClient) GetPolicies ¶
func (c *ExternalClient) GetPolicies(token string) ([]Policy, error)
func (*ExternalClient) GetPoliciesByID ¶
func (c *ExternalClient) GetPoliciesByID(token string, ids ...string) ([]Policy, error)
func (*ExternalClient) GetPoliciesV0 ¶
func (c *ExternalClient) GetPoliciesV0(token string) ([]PolicyV0, error)
func (*ExternalClient) GetPoliciesV0ByID ¶
func (c *ExternalClient) GetPoliciesV0ByID(token string, ids ...string) ([]PolicyV0, error)
type ExternalPolicyClient ¶
type ExternalPolicyClient interface { GetPolicies(token string) ([]Policy, error) GetPoliciesByID(token string, ids ...string) ([]Policy, error) GetPoliciesV0(token string) ([]PolicyV0, error) GetPoliciesV0ByID(token string, ids ...string) ([]PolicyV0, error) DeletePolicies(token string, policies []Policy) error DeletePoliciesV0(token string, policies []PolicyV0) error AddPolicies(token string, policies []Policy) error AddPoliciesV0(token string, policies []PolicyV0) error }
type InternalClient ¶
type InternalClient struct { JsonClient json_client.JsonClient Config Config }
func NewInternal ¶
func NewInternal(logger lager.Logger, httpClient json_client.HttpClient, baseURL string, conf Config) *InternalClient
func (*InternalClient) CreateOrGetTag ¶
func (c *InternalClient) CreateOrGetTag(id, groupType string) (string, error)
func (*InternalClient) GetPolicies ¶
func (c *InternalClient) GetPolicies() ([]*Policy, error)
func (*InternalClient) GetPoliciesByID ¶
func (c *InternalClient) GetPoliciesByID(ids ...string) ([]Policy, error)
func (*InternalClient) GetPoliciesLastUpdated ¶
func (c *InternalClient) GetPoliciesLastUpdated() (int, error)
func (*InternalClient) GetSecurityGroupsForSpace ¶
func (c *InternalClient) GetSecurityGroupsForSpace(spaceGuids ...string) ([]SecurityGroup, error)
func (*InternalClient) HealthCheck ¶
func (c *InternalClient) HealthCheck() (bool, error)
type InternalPolicyClient ¶
type InternalPolicyClient interface { GetPolicies() ([]*Policy, error) GetSecurityGroupsForSpace(spaceGuids []string) ([]*SecurityGroup, error) }
type PoliciesV0 ¶
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 SecurityGroup ¶
type SecurityGroup struct { Guid string `json:"guid"` Name string `json:"name"` Rules SecurityGroupRules `json:"rules"` StagingDefault bool `json:"staging_default"` RunningDefault bool `json:"running_default"` StagingSpaceGuids []string `json:"staging_space_guids"` RunningSpaceGuids []string `json:"running_space_guids"` }
type SecurityGroupRule ¶
type SecurityGroupRules ¶
type SecurityGroupRules []SecurityGroupRule
func (*SecurityGroupRules) UnmarshalJSON ¶
func (sgr *SecurityGroupRules) UnmarshalJSON(data []byte) error
type SecurityGroupsResponse ¶
type SecurityGroupsResponse struct { Next int `json:"next"` SecurityGroups []SecurityGroup `json:"security_groups"` }
type SimpleChunker ¶
type SimpleChunker struct {
ChunkSize int
}
func (*SimpleChunker) Chunk ¶
func (c *SimpleChunker) Chunk(allPolicies []PolicyV0) [][]PolicyV0
type TagRequest ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.