cfnetworkingaction

package
v8.7.8-mod Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 7 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
	CloudControllerClient CloudControllerClient
}

Actor handles all business logic for cf networking operations.

func NewActor

func NewActor(networkingClient NetworkingClient, ccClient CloudControllerClient) *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 CloudControllerClient

type CloudControllerClient interface {
	GetApplicationByNameAndSpace(appName string, spaceGUID string) (resources.Application, ccv3.Warnings, error)
	GetApplications(query ...ccv3.Query) ([]resources.Application, ccv3.Warnings, error)
	GetOrganizations(query ...ccv3.Query) ([]resources.Organization, ccv3.Warnings, error)
	GetSpaces(query ...ccv3.Query) ([]resources.Space, ccv3.IncludedResources, ccv3.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 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