cloudresource

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name      = "Name"
	Namespace = "Ns"
)

Used to create a rule description.

Variables

View Source
var (
	ControllerPrefix             string
	ControllerAddressGroupPrefix string
	ControllerAppliedToPrefix    string
)

Functions

func GetControllerAddressGroupPrefix

func GetControllerAddressGroupPrefix() string

func GetControllerAppliedToPrefix

func GetControllerAppliedToPrefix() string

func SetCloudResourcePrefix

func SetCloudResourcePrefix(CloudResourcePrefix string)

Types

type CloudResource

type CloudResource struct {
	Type CloudResourceType
	CloudResourceID
	// TODO: Rename AccountID to AccountNameSpacedName.
	AccountID     string
	CloudProvider string
}

CloudResource uniquely identify a cloud resource.

func (*CloudResource) String

func (c *CloudResource) String() string

type CloudResourceID

type CloudResourceID struct {
	Name string
	Vpc  string
}

func (*CloudResourceID) GetCloudName

func (c *CloudResourceID) GetCloudName(membershipOnly bool) string

func (*CloudResourceID) String

func (c *CloudResourceID) String() string

type CloudResourceType

type CloudResourceType string

CloudResourceType specifies the type of cloud resource.

type CloudRule

type CloudRule struct {
	Hash             string `json:"-"`
	Rule             Rule
	NpNamespacedName string `json:"-"`
	AppliedToGrp     string
}

func (*CloudRule) GetHash

func (c *CloudRule) GetHash() string

type CloudRuleDescription

type CloudRuleDescription struct {
	Name      string
	Namespace string
}

func (*CloudRuleDescription) String

func (r *CloudRuleDescription) String() string

type EgressRule

type EgressRule struct {
	ToPort           *int
	ToDstIP          []*net.IPNet
	ToSecurityGroups []*CloudResourceID
	Protocol         *int
	AppliedToGroup   map[string]struct{}
}

EgressRule specifies one egress rule of cloud SecurityGroup.

type IngressRule

type IngressRule struct {
	FromPort           *int
	FromSrcIP          []*net.IPNet
	FromSecurityGroups []*CloudResourceID
	Protocol           *int
	AppliedToGroup     map[string]struct{}
}

IngressRule specifies one ingress rule of cloud SecurityGroup.

type Rule

type Rule interface {
	// contains filtered or unexported methods
}

type SynchronizationContent

type SynchronizationContent struct {
	Resource                   CloudResource
	MembershipOnly             bool
	Members                    []CloudResource
	MembersWithOtherSGAttached []CloudResource
	IngressRules               []CloudRule
	EgressRules                []CloudRule
}

SynchronizationContent returns a SecurityGroup content in cloud.

Jump to

Keyboard shortcuts

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