translation

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationInfo = "htnn.mosn.io/info"
)

Variables

This section is empty.

Functions

func AllowRoute

func AllowRoute(cond *gwapiv1.AllowedRoutes, route *gwapiv1b1.HTTPRoute, gwNsName *types.NamespacedName) bool

Types

type Ctx

type Ctx struct {
	context.Context
}

type FinalState

type FinalState struct {
	EnvoyFilters map[string]*istiov1a3.EnvoyFilter
}

finalState is the end of the translation. We convert the state to EnvoyFilter and write it to k8s.

type HTTPFilterPolicyWrapper

type HTTPFilterPolicyWrapper struct {
	*mosniov1.HTTPFilterPolicy
	// contains filtered or unexported fields
}

type HTTPRoutePolicies

type HTTPRoutePolicies struct {
	HTTPRoute     *gwapiv1b1.HTTPRoute
	RoutePolicies map[string][]*HTTPFilterPolicyWrapper
	Gateways      []*gwapiv1b1.Gateway
}

type Info

type Info struct {
	// HTTPFilterPolicies indicates what HTTPFilterPolicies are used to generated the EnvoyFilter.
	HTTPFilterPolicies []string `json:"httpfilterpolicies"`
}

func (*Info) Merge

func (info *Info) Merge(other *Info)

func (*Info) String

func (info *Info) String() string

type InitState

type InitState struct {
	VirtualServicePolicies map[types.NamespacedName]*VirtualServicePolicies
	HTTPRoutePolicies      map[types.NamespacedName]*HTTPRoutePolicies
}

InitState is the beginning of our translation.

func NewInitState

func NewInitState() *InitState

func (*InitState) AddPolicyForHTTPRoute

func (s *InitState) AddPolicyForHTTPRoute(policy *mosniov1.HTTPFilterPolicy, route *gwapiv1b1.HTTPRoute, gws []*gwapiv1b1.Gateway)

func (*InitState) AddPolicyForVirtualService

func (s *InitState) AddPolicyForVirtualService(policy *mosniov1.HTTPFilterPolicy, vs *istiov1a3.VirtualService, gws []*istiov1a3.Gateway)

func (*InitState) GetGatewaysWithHTTPRoute

func (s *InitState) GetGatewaysWithHTTPRoute(route *gwapiv1b1.HTTPRoute) []*gwapiv1b1.Gateway

func (*InitState) GetGatewaysWithVirtualService

func (s *InitState) GetGatewaysWithVirtualService(vs *istiov1a3.VirtualService) []*istiov1a3.Gateway

func (*InitState) Process

func (s *InitState) Process(original_ctx context.Context) (*FinalState, error)

type PolicyScope

type PolicyScope int
const (
	// sort from small to large
	PolicyScopeRule  PolicyScope = iota // a route in a VirtualService or a rule in xRoute
	PolicyScopeRoute                    // a VirtualService or a xRoute
)

type VirtualServicePolicies

type VirtualServicePolicies struct {
	VirtualService *istiov1a3.VirtualService
	RoutePolicies  map[string][]*HTTPFilterPolicyWrapper
	Gateways       []*istiov1a3.Gateway
}

Jump to

Keyboard shortcuts

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