cfnetworkingaction

package
v6.45.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cfnetworkingaction contains the business logic for the cf networking commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	NetworkingClient NetworkingClient
	V3Actor          V3Actor
}

Actor handles all business logic for cf networking operations.

func NewActor

func NewActor(networkingClient NetworkingClient, v3Actor V3Actor) *Actor

NewActor returns a new actor.

func (Actor) AddNetworkPolicy

func (actor Actor) AddNetworkPolicy(srcSpaceGUID, srcAppName, destSpaceGUID, destAppName, protocol string, startPort, endPort int) (Warnings, error)

func (Actor) NetworkPoliciesBySpace

func (actor Actor) NetworkPoliciesBySpace(spaceGUID string) ([]Policy, Warnings, error)

func (Actor) NetworkPoliciesBySpaceAndAppName

func (actor Actor) NetworkPoliciesBySpaceAndAppName(spaceGUID string, srcAppName string) ([]Policy, Warnings, error)

func (Actor) RemoveNetworkPolicy

func (actor Actor) RemoveNetworkPolicy(srcSpaceGUID, srcAppName, destSpaceGUID, destAppName, protocol string, startPort, endPort int) (Warnings, error)

type NetworkingClient

type NetworkingClient interface {
	CreatePolicies(policies []cfnetv1.Policy) error
	ListPolicies(appGUIDs ...string) ([]cfnetv1.Policy, error)
	RemovePolicies(policies []cfnetv1.Policy) error
}

type Policy

type Policy struct {
	SourceName           string
	DestinationName      string
	Protocol             string
	DestinationSpaceName string
	DestinationOrgName   string
	StartPort            int
	EndPort              int
}

type V3Actor

type V3Actor interface {
	GetApplicationByNameAndSpace(appName string, spaceGUID string) (v3action.Application, v3action.Warnings, error)
	GetApplicationsBySpace(spaceGUID string) ([]v3action.Application, v3action.Warnings, error)
	GetOrganizationByName(name string) (v3action.Organization, v3action.Warnings, error)
	GetSpaceByNameAndOrganization(spaceName string, orgGUID string) (v3action.Space, v3action.Warnings, error)
	GetApplicationsByGUIDs(appGUIDs ...string) ([]v3action.Application, v3action.Warnings, error)
	GetSpacesByGUIDs(spaceGUIDs ...string) ([]v3action.Space, v3action.Warnings, error)
	GetOrganizationsByGUIDs(orgGUIDs ...string) ([]v3action.Organization, v3action.Warnings, error)
}

type Warnings

type Warnings []string

Warnings is a list of warnings returned back

Directories

Path Synopsis
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