Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionPolicy ¶
type ConnectionPolicy interface { core_model.Resource Sources() []*mesh_proto.Selector Destinations() []*mesh_proto.Selector }
ConnectionPolicy is a Policy that is applied on a connection between two data planes that match source and destination.
type ConnectionPolicyByName ¶
type ConnectionPolicyByName []ConnectionPolicy
func (ConnectionPolicyByName) Len ¶
func (a ConnectionPolicyByName) Len() int
func (ConnectionPolicyByName) Less ¶
func (a ConnectionPolicyByName) Less(i, j int) bool
func (ConnectionPolicyByName) Swap ¶
func (a ConnectionPolicyByName) Swap(i, j int)
type DataplanePolicy ¶
type DataplanePolicy interface { core_model.Resource Selectors() []*mesh_proto.Selector }
DataplanePolicy is a Policy that is applied on a selected Dataplane
func SelectDataplanePolicy ¶
func SelectDataplanePolicy(dataplane *mesh.DataplaneResource, policies []DataplanePolicy) DataplanePolicy
SelectDataplanePolicy given a Dataplane definition and a list of DataplanePolicy returns the "best matching" DataplanePolicy. A DataplanePolicy is considered a match if one of the inbound interfaces of a Dataplane or tag section on Gateway Dataplane has all tags of DataplanePolicy's selector. Every matching DataplanePolicy gets a rank (score) defined as a maximum number of tags in a matching selector. DataplanePolicy with an empty list of selectors is considered a match with a rank (score) of 0. DataplanePolicy with an empty selector (one that has no tags) is considered a match with a rank (score) of 0. In case if there are multiple DataplanePolicies with the same rank (score), the policy created last is chosen.
type DataplanePolicyByName ¶
type DataplanePolicyByName []DataplanePolicy
func (DataplanePolicyByName) Len ¶
func (a DataplanePolicyByName) Len() int
func (DataplanePolicyByName) Less ¶
func (a DataplanePolicyByName) Less(i, j int) bool
func (DataplanePolicyByName) Swap ¶
func (a DataplanePolicyByName) Swap(i, j int)
type InboundConnectionPolicyMap ¶
type InboundConnectionPolicyMap map[mesh_proto.InboundInterface]ConnectionPolicy
func SelectInboundConnectionPolicies ¶
func SelectInboundConnectionPolicies(dataplane *mesh_core.DataplaneResource, inbounds []*mesh_proto.Dataplane_Networking_Inbound, policies []ConnectionPolicy) (InboundConnectionPolicyMap, error)
SelectInboundConnectionPolicies picks a single the most specific policy for each inbound interface of a given Dataplane. For each inbound we pick a policy that matches the most destination tags with inbound tags Sources part of matched policies are later used in Envoy config to apply it only for connection that matches sources
type OutboundConnectionPolicyMap ¶
type OutboundConnectionPolicyMap map[core_xds.ServiceName]ConnectionPolicy
OutboundConnectionPolicyMap holds the most specific ConnectionPolicy for each outbound interface of a Dataplane.
func SelectConnectionPolicies ¶
func SelectConnectionPolicies(dataplane *mesh_core.DataplaneResource, destinations ServiceIterator, policies []ConnectionPolicy) OutboundConnectionPolicyMap
SelectConnectionPolicies picks a single the most specific policy applicable to a connection between a given dataplane and given destination services.
func SelectOutboundConnectionPolicies ¶
func SelectOutboundConnectionPolicies(dataplane *mesh_core.DataplaneResource, policies []ConnectionPolicy) OutboundConnectionPolicyMap
SelectOutboundConnectionPolicies picks a single the most specific policy for each outbound interface of a given Dataplane.
type ServiceIterator ¶
type ServiceIterator interface {
Next() (core_xds.ServiceName, bool)
}
type ServiceIteratorFunc ¶
type ServiceIteratorFunc func() (core_xds.ServiceName, bool)
func ToOutboundServicesOf ¶
func ToOutboundServicesOf(dataplane *mesh_core.DataplaneResource) ServiceIteratorFunc
func ToServices ¶
func ToServices(services []core_xds.ServiceName) ServiceIteratorFunc
func ToServicesOf ¶
func ToServicesOf(destinations core_xds.DestinationMap) ServiceIteratorFunc
func (ServiceIteratorFunc) Next ¶
func (f ServiceIteratorFunc) Next() (core_xds.ServiceName, bool)