apiabbr

package
v0.39.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExternalPeeringSeparator = "~"
)
View Source
const (
	VPCAttachmentAbbrSeparator = "@"
)
View Source
const (
	VPCPeeringAbbrSeparator = "+"
)

Variables

View Source
var (
	FallbackParamDisable = []string{"disable"}

	FallbackParams = [][]string{
		FallbackParamDisable,
	}
)
View Source
var (
	TrueVals        = []string{"true", "t", "yes", "y", "1"}
	TrueValsDefault = append(TrueVals, "")
)
View Source
var (
	ExtPeeringParamSubnets  = []string{"subnets", "s"}
	ExtPeeringParamPrefixes = []string{"prefixes", "p"}

	ExtPeeringParams = [][]string{
		ExtPeeringParamSubnets,
		ExtPeeringParamPrefixes,
	}
)
View Source
var (
	VPCParamDefaultIsolated   = []string{"defaultIsolated", "defI", "i"}
	VPCParamDefaultRestricted = []string{"defaultRestricted", "defR", "r"}
	VPCParamIPNS              = []string{"ipns"}
	VPCParamVLANNS            = []string{"vlanns"}
	VPCParamSubnets           = []string{"subnet", "s"}
	VPCParamPermits           = []string{"permit", "p"}

	VPCParams = [][]string{
		VPCParamDefaultIsolated,
		VPCParamDefaultRestricted,
		VPCParamIPNS,
		VPCParamVLANNS,
		VPCParamSubnets,
		VPCParamPermits,
	}
)
View Source
var (
	VPCAttachmentParamNativeVLAN = []string{"native-vlan", "native", "nv"}

	VPCAttachmentParams = [][]string{
		VPCAttachmentParamNativeVLAN,
	}
)
View Source
var (
	VPCPeeringParamRemote = []string{"remote", "r"}
	VPCPeeringParamPermit = []string{"permit", "p"}

	VPCPeeringParams = [][]string{
		VPCPeeringParamRemote,
		VPCPeeringParamPermit,
	}
)

Functions

func ParseVPCPeeringPermits

func ParseVPCPeeringPermits(vpc1, vpc2, in string) (map[string]vpcapi.VPCPeer, error)

func ParseVPCPermits

func ParseVPCPermits(in string) ([]string, error)

func ParseVPCSubnet

func ParseVPCSubnet(in string) (string, *vpcapi.VPCSubnet, error)

Types

type AbbrHandler

type AbbrHandler interface {
	Load(ct AbbrType, abbr string, params AbbrParams) (handled bool, err error)
	PreProcess(ctx context.Context, kube client.Client) error
	PostProcess(ctx context.Context, kube client.Client) error
}

type AbbrParams

type AbbrParams map[string][]string

func (AbbrParams) GetBool

func (p AbbrParams) GetBool(keys []string) (bool, error)

func (AbbrParams) GetString

func (p AbbrParams) GetString(keys []string) (string, error)

func (AbbrParams) GetStringSlice

func (p AbbrParams) GetStringSlice(keys []string) []string

type AbbrType

type AbbrType string
const (
	AbbrTypeUnknown            AbbrType = ""
	AbbrTypeVPC                AbbrType = "vpc"
	AbbrTypeVPCAttachment      AbbrType = "vpcAttach"
	AbbrTypeVPCPeering         AbbrType = "vpcPeering"
	AbbrTypeExternalPeering    AbbrType = "extPeering"
	AbbrTypeConnectionFallback AbbrType = "fallback"
)

type Enforcer

type Enforcer struct {
	// contains filtered or unexported fields
}

func NewEnforcer

func NewEnforcer(ignoreNotDefined bool) (*Enforcer, error)

func (*Enforcer) Enforce

func (e *Enforcer) Enforce(ctx context.Context, kube client.Client) error

func (*Enforcer) Load

func (e *Enforcer) Load(lines ...string) error

type ObjectAbbrHandler

type ObjectAbbrHandler[T meta.Object, TList meta.ObjectList] struct {
	AbbrType         AbbrType
	AcceptedParams   [][]string
	AcceptNoTypeFn   func(abbr string) bool
	NameFn           func(abbr string) (name string)
	ParseObjectFn    func(name, abbr string, params AbbrParams) (T, error)
	ObjectListFn     func(ctx context.Context, kube client.Client) (TList, error)
	CreateOrUpdateFn func(ctx context.Context, kube client.Client, obj T) (ctrlutil.OperationResult, error)
	PatchExistingFn  func(obj T) bool

	DisallowOverride  bool
	CleanupNotDefined bool
	// contains filtered or unexported fields
}

func (*ObjectAbbrHandler[T, TList]) Init

func (h *ObjectAbbrHandler[T, TList]) Init() (*ObjectAbbrHandler[T, TList], error)

func (*ObjectAbbrHandler[T, TList]) Load

func (h *ObjectAbbrHandler[T, TList]) Load(ct AbbrType, abbr string, params AbbrParams) (bool, error)

func (*ObjectAbbrHandler[T, TList]) PostProcess

func (h *ObjectAbbrHandler[T, TList]) PostProcess(ctx context.Context, kube client.Client) error

func (*ObjectAbbrHandler[T, TList]) PreProcess

func (h *ObjectAbbrHandler[T, TList]) PreProcess(ctx context.Context, kube client.Client) error

Jump to

Keyboard shortcuts

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