lattice

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// K8S HTTPRouteMatch
	MatchByPath = "HTTPRouteMatch"
	// K8S HTTPRouteFilter
	MatchByFilter = "HTTPRouteFilter"

	MAX_NUM_OF_MATCHED_HEADERS = 5
)
View Source
const (
	K8SServiceNetworkOwnedByVPC = "K8SServiceNetworkOwnedByVPC"
	K8SServiceOwnedByVPC        = "K8SServiceOwnedByVPC"
)
View Source
const (
	K8SServiceNameKey        = "K8SServiceName"
	K8SServiceNamespaceKey   = "K8SServiceNamespace"
	K8SParentRefTypeKey      = "K8SParentRefTypeKey"
	K8SHTTPRouteNameKey      = "K8SHTTPRouteName"
	K8SHTTPRouteNamespaceKey = "K8SHTTPRouteNamespace"
	K8SServiceExportType     = "K8SServiceExportType"
	K8SHTTPRouteType         = "K8SHTTPRouteType"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultAction

type DefaultAction struct {
	Is_Import               bool   `json:"isimport"`
	BackendServiceName      string `json:"backendservicename"`
	BackendServiceNamespace string `json:"backendservicenamespace"`
}

type Listener

type Listener struct {
	core.ResourceMeta `json:"-"`
	Spec              ListenerSpec    `json:"spec"`
	Status            *ListenerStatus `json:"status,omitempty"`
}

func NewListener

func NewListener(stack core.Stack, id string, port int64, protocol string, name string, namespace string, action DefaultAction) *Listener

type ListenerSpec

type ListenerSpec struct {
	Name          string        `json:"name"`
	Namespace     string        `json:"namespace"`
	Port          int64         `json:"port"`
	Protocol      string        `json:"protocol"`
	DefaultAction DefaultAction `json:"defaultaction"`
}

type ListenerStatus

type ListenerStatus struct {
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	ListenerARN string `json:"listenerARN"`
	ListenerID  string `json:"listenerID"`
	ServiceID   string `json:"serviceID"`
	Port        int64  `json:"port"`
	Protocol    string `json:"protocol"`
}

type Rule

type Rule struct {
	core.ResourceMeta `json:"-"`
	Spec              RuleSpec    `json:"spec"`
	Status            *RuleStatus `json:"status,omitempty"`
}

func NewRule

func NewRule(stack core.Stack, id string, name string, namespace string, port int64,
	protocol string, action RuleAction, ruleSpec RuleSpec) *Rule

type RuleAction

type RuleAction struct {
	TargetGroups []*RuleTargetGroup `json:"ruletarget"`
}

type RuleSpec

type RuleSpec struct {
	ServiceName      string `json:"name"`
	ServiceNamespace string `json:"namespace"`
	ListenerPort     int64  `json:"port"`
	ListenerProtocol string `json:"protocol"`
	// PathMatch
	PathMatchValue  string `json:"pathmatchvalue"`
	PathMatchExact  bool   `json:"pathmatchexact"`
	PathMatchPrefix bool   `json:"pathmatchprefix"`
	// Header
	NumOfHeaderMatches int `json:"numofheadermatches"`
	MatchedHeaders     [MAX_NUM_OF_MATCHED_HEADERS]vpclattice.HeaderMatch

	RuleID     string     `json:"id"`
	Action     RuleAction `json:"action"`
	CreateTime time.Time  `json:"time"`
}

type RuleStatus

type RuleStatus struct {
	RuleARN              string `json:"ARN"`
	RuleID               string `json:"ID"`
	Priority             int64  `json:"priority"`
	ListenerID           string `json:"Listner"`
	ServiceID            string `json:"Service"`
	UpdatePriorityNeeded bool   `json:"updatepriorityneeded"`
	UpdateTGsNeeded      bool   `json:"updateTGneeded"`
}

type RuleTargetGroup

type RuleTargetGroup struct {
	Name            string `json:"name"`
	Namespace       string `json:"namespace"`
	RouteName       string `json:"routename"`
	IsServiceImport bool   `json:"isServiceImport"`
	Weight          int64  `json:"weight"`
}

type Service

type Service struct {
	core.ResourceMeta `json:"-"`

	Spec ServiceSpec `json:"spec"`

	Status *ServiceStatus `json:"status,omitempty"`
}

func NewLatticeService

func NewLatticeService(stack core.Stack, id string, spec ServiceSpec) *Service

type ServiceNetwork

type ServiceNetwork struct {
	core.ResourceMeta `json:"-"`

	// desired state of ServiceNetwork
	Spec ServiceNetworkSpec `json:"spec"`

	// observed state of ServiceNetwork
	Status *ServiceNetworkStatus `json:"status,omitempty"`
}

func NewServiceNetwork

func NewServiceNetwork(stack core.Stack, id string, spec ServiceNetworkSpec) *ServiceNetwork

type ServiceNetworkSpec

type ServiceNetworkSpec struct {
	// The name of the ServiceNetwork
	Name           string `json:"name"`
	Namespace      string `json:"namespace"`
	Account        string `json:"account"`
	AssociateToVPC bool
	IsDeleted      bool
}

type ServiceNetworkStatus

type ServiceNetworkStatus struct {
	ServiceNetworkARN string `json:"servicenetworkARN"`
	ServiceNetworkID  string `json:"servicenetworkID"`
}

type ServiceSpec

type ServiceSpec struct {
	Name                string    `json:"name"`
	Namespace           string    `json:"namespace"`
	Protocols           []*string `json:"protocols"`
	ServiceNetworkNames []string  `json:"servicenetworkhname"`
	CustomerDomainName  string    `json:"customerdomainname"`
	CustomerCertARN     string    `json:"customercertarn"`
	IsDeleted           bool
}

type ServiceStatus

type ServiceStatus struct {
	ServiceARN string `json:"latticeServiceARN"`
	ServiceID  string `json:"latticeServiceID"`
	ServiceDNS string `json:"latticeServiceDNS"`
}

type Target

type Target struct {
	TargetIP string `json:"targetID"`
	Port     int64  `json:"port"`
}

type TargetGroup

type TargetGroup struct {
	core.ResourceMeta `json:"-"`
	Spec              TargetGroupSpec    `json:"spec"`
	Status            *TargetGroupStatus `json:"status,omitempty"`
}

func NewTargetGroup

func NewTargetGroup(stack core.Stack, id string, spec TargetGroupSpec) *TargetGroup

type TargetGroupConfig

type TargetGroupConfig struct {
	Port            int32  `json:"port"`
	Protocol        string `json:"protocol"`
	ProtocolVersion string `json:"protocolversion"`
	VpcID           string `json:"vpcid"`
	EKSClusterName  string `json:"eksclustername"`
	IsServiceImport bool   `json:"serviceimport"`
	// the following fields are used for AWS resource tagging
	IsServiceExport       bool   `json:"serviceexport"`
	K8SServiceName        string `json:"k8sservice"`
	K8SServiceNamespace   string `json:"k8sservicenamespace"`
	K8SHTTPRouteName      string `json:"k8shttproutename"`
	K8SHTTPRouteNamespace string `json:"k8shttproutenamespace"`
}

type TargetGroupSpec

type TargetGroupSpec struct {
	Name      string
	Config    TargetGroupConfig `json:"config"`
	Type      TargetGroupType
	IsDeleted bool
	LatticeID string
}

type TargetGroupStatus

type TargetGroupStatus struct {
	TargetGroupARN string `json:"latticeServiceARN"`
	TargetGroupID  string `json:"latticeServiceID"`
}

type TargetGroupType

type TargetGroupType string
const (
	TargetGroupTypeIP TargetGroupType = "IP"
)

type Targets

type Targets struct {
	core.ResourceMeta `json:"-"`
	Spec              TargetsSpec `json:"spec"`
}

func NewTargets

func NewTargets(stack core.Stack, id string, spec TargetsSpec) *Targets

type TargetsSpec

type TargetsSpec struct {
	Name          string   `json:"name"`
	Namespace     string   `json:"namespace"`
	RouteName     string   `json:"routename"`
	TargetGroupID string   `json:"targetgroupID"`
	TargetIPList  []Target `json:"targetIPlist"`
}

Jump to

Keyboard shortcuts

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