mesh

package
v0.0.0-...-7b34d14 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolUnknown = "<unknown>"
	ProtocolTCP     = "tcp"
	ProtocolHTTP    = "http"
)
View Source
const (
	CircuitBreakerType model.ResourceType = "CircuitBreaker"
)
View Source
const (
	DataplaneInsightType model.ResourceType = "DataplaneInsight"
)
View Source
const (
	DataplaneOverviewType model.ResourceType = "DataplaneOverview"
)
View Source
const (
	DataplaneType model.ResourceType = "Dataplane"
)
View Source
const (
	FaultInjectionType model.ResourceType = "FaultInjection"
)
View Source
const (
	HealthCheckType model.ResourceType = "HealthCheck"
)
View Source
const (
	MeshType model.ResourceType = "Mesh"
)
View Source
const PassThroughService = "pass_through"

Service that indicates L4 pass through cluster

View Source
const (
	ProfileDefaultProxy = "default-proxy"
)
View Source
const (
	ProxyTemplateType model.ResourceType = "ProxyTemplate"
)
View Source
const (
	TrafficLogType model.ResourceType = "TrafficLog"
)
View Source
const (
	TrafficPermissionType model.ResourceType = "TrafficPermission"
)
View Source
const (
	TrafficRouteType model.ResourceType = "TrafficRoute"
)
View Source
const (
	TrafficTraceType model.ResourceType = "TrafficTrace"
)

Variables

View Source
var AvailableProfiles = []string{ProfileDefaultProxy}
View Source
var IPv4Loopback = net.IPv4(127, 0, 0, 1)
View Source
var OnlyServiceTagAllowed = ValidateSelectorsOpts{
	RequireAtLeastOneSelector: true,
	ValidateSelectorOpts: ValidateSelectorOpts{
		RequireService: true,
		ExtraSelectorValidators: []SelectorValidatorFunc{
			func(path validators.PathBuilder, selector map[string]string) (err validators.ValidationError) {
				_, defined := selector[mesh_proto.ServiceTag]
				if len(selector) != 1 || !defined {
					err.AddViolationAt(path, fmt.Sprintf("must consist of exactly one tag %q", mesh_proto.ServiceTag))
				}
				return
			},
		},
		ExtraTagKeyValidators: []TagKeyValidatorFunc{
			func(path validators.PathBuilder, key string) (err validators.ValidationError) {
				if key != mesh_proto.ServiceTag {
					err.AddViolationAt(path.Key(key), fmt.Sprintf("tag %q is not allowed", key))
				}
				return
			},
		},
	},
}
View Source
var SupportedProtocols = ProtocolList{
	ProtocolHTTP,
	ProtocolTCP,
}

SupportedProtocols is a list of supported protocols that will be communicated to a user.

Functions

func AllowedValuesHint

func AllowedValuesHint(values ...string) string

func Keys

func Keys(tags map[string]string) []string

func ParseDuration

func ParseDuration(durationStr string) (time.Duration, error)

ParseDuration parses a string into a time.Duration

func ValidateDuration

func ValidateDuration(path validators.PathBuilder, duration *pduration.Duration) (errs validators.ValidationError)

func ValidateMeta

func ValidateMeta(name, mesh string) validators.ValidationError

func ValidateSelector

func ValidateSelector(path validators.PathBuilder, selector map[string]string, opts ValidateSelectorOpts) (err validators.ValidationError)

func ValidateThreshold

func ValidateThreshold(path validators.PathBuilder, threshold uint32) (err validators.ValidationError)

Types

type CircuitBreakerResource

type CircuitBreakerResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.CircuitBreaker
}

func (*CircuitBreakerResource) Destinations

func (c *CircuitBreakerResource) Destinations() []*mesh_proto.Selector

func (*CircuitBreakerResource) GetMeta

func (*CircuitBreakerResource) GetSpec

func (*CircuitBreakerResource) GetType

func (*CircuitBreakerResource) HasDetectors

func (c *CircuitBreakerResource) HasDetectors() bool

func (*CircuitBreakerResource) SetMeta

func (*CircuitBreakerResource) SetSpec

func (*CircuitBreakerResource) Sources

func (c *CircuitBreakerResource) Sources() []*mesh_proto.Selector

func (*CircuitBreakerResource) Validate

func (c *CircuitBreakerResource) Validate() error

type CircuitBreakerResourceList

type CircuitBreakerResourceList struct {
	Items      []*CircuitBreakerResource
	Pagination model.Pagination
}

func (*CircuitBreakerResourceList) AddItem

func (*CircuitBreakerResourceList) GetItemType

func (*CircuitBreakerResourceList) GetItems

func (l *CircuitBreakerResourceList) GetItems() []model.Resource

func (*CircuitBreakerResourceList) GetPagination

func (l *CircuitBreakerResourceList) GetPagination() *model.Pagination

func (*CircuitBreakerResourceList) NewItem

type DataplaneInsightResource

type DataplaneInsightResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.DataplaneInsight
}

func (*DataplaneInsightResource) GetMeta

func (*DataplaneInsightResource) GetSpec

func (*DataplaneInsightResource) GetType

func (*DataplaneInsightResource) SetMeta

func (*DataplaneInsightResource) SetSpec

func (*DataplaneInsightResource) Validate

func (t *DataplaneInsightResource) Validate() error

type DataplaneInsightResourceList

type DataplaneInsightResourceList struct {
	Items      []*DataplaneInsightResource
	Pagination model.Pagination
}

func (*DataplaneInsightResourceList) AddItem

func (*DataplaneInsightResourceList) GetItemType

func (*DataplaneInsightResourceList) GetItems

func (*DataplaneInsightResourceList) GetPagination

func (l *DataplaneInsightResourceList) GetPagination() *model.Pagination

func (*DataplaneInsightResourceList) NewItem

type DataplaneOverviewResource

type DataplaneOverviewResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.DataplaneOverview
}

func (*DataplaneOverviewResource) GetMeta

func (*DataplaneOverviewResource) GetSpec

func (*DataplaneOverviewResource) GetType

func (*DataplaneOverviewResource) SetMeta

func (*DataplaneOverviewResource) SetSpec

func (*DataplaneOverviewResource) Validate

func (t *DataplaneOverviewResource) Validate() error

type DataplaneOverviewResourceList

type DataplaneOverviewResourceList struct {
	Items      []*DataplaneOverviewResource
	Pagination model.Pagination
}

func (*DataplaneOverviewResourceList) AddItem

func (*DataplaneOverviewResourceList) GetItemType

func (*DataplaneOverviewResourceList) GetItems

func (*DataplaneOverviewResourceList) GetPagination

func (l *DataplaneOverviewResourceList) GetPagination() *model.Pagination

func (*DataplaneOverviewResourceList) NewItem

func (*DataplaneOverviewResourceList) RetainGatewayDataplanes

func (l *DataplaneOverviewResourceList) RetainGatewayDataplanes()

RetainGatewayDataplanes to get only gateway Dataplanes

func (*DataplaneOverviewResourceList) RetainIngressDataplanes

func (l *DataplaneOverviewResourceList) RetainIngressDataplanes()

RetainIngressDataplanes to get only ingress Dataplanes

func (*DataplaneOverviewResourceList) RetainMatchingTags

func (d *DataplaneOverviewResourceList) RetainMatchingTags(tags map[string]string)

type DataplaneResource

type DataplaneResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.Dataplane
}

func (*DataplaneResource) GetIP

func (d *DataplaneResource) GetIP() string

func (*DataplaneResource) GetMeta

func (t *DataplaneResource) GetMeta() model.ResourceMeta

func (*DataplaneResource) GetPrometheusEndpoint

func (*DataplaneResource) GetSpec

func (t *DataplaneResource) GetSpec() model.ResourceSpec

func (*DataplaneResource) GetType

func (t *DataplaneResource) GetType() model.ResourceType

func (*DataplaneResource) SetMeta

func (t *DataplaneResource) SetMeta(m model.ResourceMeta)

func (*DataplaneResource) SetSpec

func (t *DataplaneResource) SetSpec(spec model.ResourceSpec) error

func (*DataplaneResource) UsesInboundInterface

func (d *DataplaneResource) UsesInboundInterface(address net.IP, port uint32) bool

func (*DataplaneResource) UsesInterface

func (d *DataplaneResource) UsesInterface(address net.IP, port uint32) bool

func (*DataplaneResource) UsesOutboundInterface

func (d *DataplaneResource) UsesOutboundInterface(address net.IP, port uint32) bool

func (*DataplaneResource) Validate

func (d *DataplaneResource) Validate() error

type DataplaneResourceList

type DataplaneResourceList struct {
	Items      []*DataplaneResource
	Pagination model.Pagination
}

func (*DataplaneResourceList) AddItem

func (l *DataplaneResourceList) AddItem(r model.Resource) error

func (*DataplaneResourceList) GetItemType

func (l *DataplaneResourceList) GetItemType() model.ResourceType

func (*DataplaneResourceList) GetItems

func (l *DataplaneResourceList) GetItems() []model.Resource

func (*DataplaneResourceList) GetPagination

func (l *DataplaneResourceList) GetPagination() *model.Pagination

func (*DataplaneResourceList) NewItem

func (l *DataplaneResourceList) NewItem() model.Resource

type FaultInjectionResource

type FaultInjectionResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.FaultInjection
}

func (*FaultInjectionResource) Destinations

func (f *FaultInjectionResource) Destinations() []*mesh_proto.Selector

func (*FaultInjectionResource) GetMeta

func (*FaultInjectionResource) GetSpec

func (*FaultInjectionResource) GetType

func (*FaultInjectionResource) HasFaultAbort

func (f *FaultInjectionResource) HasFaultAbort() bool

func (*FaultInjectionResource) HasFaultDelay

func (f *FaultInjectionResource) HasFaultDelay() bool

func (*FaultInjectionResource) HasFaultResponseBandwidth

func (f *FaultInjectionResource) HasFaultResponseBandwidth() bool

func (*FaultInjectionResource) SetMeta

func (*FaultInjectionResource) SetSpec

func (*FaultInjectionResource) Sources

func (f *FaultInjectionResource) Sources() []*mesh_proto.Selector

func (*FaultInjectionResource) Validate

func (f *FaultInjectionResource) Validate() error

type FaultInjectionResourceList

type FaultInjectionResourceList struct {
	Items      []*FaultInjectionResource
	Pagination model.Pagination
}

func (*FaultInjectionResourceList) AddItem

func (*FaultInjectionResourceList) GetItemType

func (*FaultInjectionResourceList) GetItems

func (l *FaultInjectionResourceList) GetItems() []model.Resource

func (*FaultInjectionResourceList) GetPagination

func (l *FaultInjectionResourceList) GetPagination() *model.Pagination

func (*FaultInjectionResourceList) NewItem

type HealthCheckResource

type HealthCheckResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.HealthCheck
}

func (*HealthCheckResource) Destinations

func (t *HealthCheckResource) Destinations() []*mesh_proto.Selector

func (*HealthCheckResource) GetMeta

func (r *HealthCheckResource) GetMeta() model.ResourceMeta

func (*HealthCheckResource) GetSpec

func (r *HealthCheckResource) GetSpec() model.ResourceSpec

func (*HealthCheckResource) GetType

func (r *HealthCheckResource) GetType() model.ResourceType

func (*HealthCheckResource) SetMeta

func (r *HealthCheckResource) SetMeta(m model.ResourceMeta)

func (*HealthCheckResource) SetSpec

func (r *HealthCheckResource) SetSpec(value model.ResourceSpec) error

func (*HealthCheckResource) Sources

func (t *HealthCheckResource) Sources() []*mesh_proto.Selector

func (*HealthCheckResource) Validate

func (d *HealthCheckResource) Validate() error

type HealthCheckResourceList

type HealthCheckResourceList struct {
	Items      []*HealthCheckResource
	Pagination model.Pagination
}

func (*HealthCheckResourceList) AddItem

func (*HealthCheckResourceList) GetItemType

func (l *HealthCheckResourceList) GetItemType() model.ResourceType

func (*HealthCheckResourceList) GetItems

func (l *HealthCheckResourceList) GetItems() []model.Resource

func (*HealthCheckResourceList) GetPagination

func (l *HealthCheckResourceList) GetPagination() *model.Pagination

func (*HealthCheckResourceList) NewItem

func (l *HealthCheckResourceList) NewItem() model.Resource

type MeshResource

type MeshResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.Mesh
}

func (*MeshResource) Default

func (mesh *MeshResource) Default() error

func (*MeshResource) GetCertificateAuthorityBackend

func (m *MeshResource) GetCertificateAuthorityBackend(name string) *mesh_proto.CertificateAuthorityBackend

func (*MeshResource) GetEnabledCertificateAuthorityBackend

func (m *MeshResource) GetEnabledCertificateAuthorityBackend() *mesh_proto.CertificateAuthorityBackend

func (*MeshResource) GetEnabledMetricsBackend

func (m *MeshResource) GetEnabledMetricsBackend() *mesh_proto.MetricsBackend

func (*MeshResource) GetLoggingBackends

func (m *MeshResource) GetLoggingBackends() string

GetLoggingBackends will return logging backends as comma separated strings if empty return empty string

func (*MeshResource) GetMeta

func (t *MeshResource) GetMeta() model.ResourceMeta

func (*MeshResource) GetMetricsBackend

func (m *MeshResource) GetMetricsBackend(name string) *mesh_proto.MetricsBackend

func (*MeshResource) GetSpec

func (t *MeshResource) GetSpec() model.ResourceSpec

func (*MeshResource) GetTracingBackend

func (m *MeshResource) GetTracingBackend(name string) *mesh_proto.TracingBackend

func (*MeshResource) GetTracingBackends

func (m *MeshResource) GetTracingBackends() string

GetTracingBackends will return tracing backends as comma separated strings if empty return empty string

func (*MeshResource) GetType

func (t *MeshResource) GetType() model.ResourceType

func (*MeshResource) HasPrometheusMetricsEnabled

func (m *MeshResource) HasPrometheusMetricsEnabled() bool

func (*MeshResource) MTLSEnabled

func (m *MeshResource) MTLSEnabled() bool

func (*MeshResource) SetMeta

func (t *MeshResource) SetMeta(m model.ResourceMeta)

func (*MeshResource) SetSpec

func (t *MeshResource) SetSpec(spec model.ResourceSpec) error

func (*MeshResource) Validate

func (m *MeshResource) Validate() error

type MeshResourceList

type MeshResourceList struct {
	Items      []*MeshResource
	Pagination model.Pagination
}

func (*MeshResourceList) AddItem

func (l *MeshResourceList) AddItem(r model.Resource) error

func (*MeshResourceList) GetItemType

func (l *MeshResourceList) GetItemType() model.ResourceType

func (*MeshResourceList) GetItems

func (l *MeshResourceList) GetItems() []model.Resource

func (*MeshResourceList) GetPagination

func (l *MeshResourceList) GetPagination() *model.Pagination

func (*MeshResourceList) NewItem

func (l *MeshResourceList) NewItem() model.Resource

type Protocol

type Protocol string

Protocol identifies a protocol supported by a service.

func ParseProtocol

func ParseProtocol(tag string) Protocol

type ProtocolList

type ProtocolList []Protocol

ProtocolList represents a list of Protocols.

func (ProtocolList) Strings

func (l ProtocolList) Strings() []string

type ProxyTemplateResource

type ProxyTemplateResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.ProxyTemplate
}

func (*ProxyTemplateResource) GetMeta

func (*ProxyTemplateResource) GetSpec

func (*ProxyTemplateResource) GetType

func (*ProxyTemplateResource) Selectors

func (t *ProxyTemplateResource) Selectors() []*mesh_proto.Selector

func (*ProxyTemplateResource) SetMeta

func (*ProxyTemplateResource) SetSpec

func (t *ProxyTemplateResource) SetSpec(spec model.ResourceSpec) error

func (*ProxyTemplateResource) Validate

func (t *ProxyTemplateResource) Validate() error

type ProxyTemplateResourceList

type ProxyTemplateResourceList struct {
	Items      []*ProxyTemplateResource
	Pagination model.Pagination
}

func (*ProxyTemplateResourceList) AddItem

func (*ProxyTemplateResourceList) GetItemType

func (l *ProxyTemplateResourceList) GetItemType() model.ResourceType

func (*ProxyTemplateResourceList) GetItems

func (l *ProxyTemplateResourceList) GetItems() []model.Resource

func (*ProxyTemplateResourceList) GetPagination

func (l *ProxyTemplateResourceList) GetPagination() *model.Pagination

func (*ProxyTemplateResourceList) NewItem

type SelectorValidatorFunc

type SelectorValidatorFunc func(path validators.PathBuilder, selector map[string]string) validators.ValidationError

func ProtocolValidator

func ProtocolValidator(protocols ...string) SelectorValidatorFunc

type TagKeyValidatorFunc

type TagKeyValidatorFunc func(path validators.PathBuilder, key string) validators.ValidationError

type TagValueValidatorFunc

type TagValueValidatorFunc func(path validators.PathBuilder, key, value string) validators.ValidationError

type TrafficLogResource

type TrafficLogResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.TrafficLog
}

func (*TrafficLogResource) Destinations

func (t *TrafficLogResource) Destinations() []*mesh_proto.Selector

func (*TrafficLogResource) GetMeta

func (t *TrafficLogResource) GetMeta() model.ResourceMeta

func (*TrafficLogResource) GetSpec

func (t *TrafficLogResource) GetSpec() model.ResourceSpec

func (*TrafficLogResource) GetType

func (t *TrafficLogResource) GetType() model.ResourceType

func (*TrafficLogResource) SetMeta

func (t *TrafficLogResource) SetMeta(m model.ResourceMeta)

func (*TrafficLogResource) SetSpec

func (t *TrafficLogResource) SetSpec(spec model.ResourceSpec) error

func (*TrafficLogResource) Sources

func (t *TrafficLogResource) Sources() []*mesh_proto.Selector

func (*TrafficLogResource) Validate

func (d *TrafficLogResource) Validate() error

type TrafficLogResourceList

type TrafficLogResourceList struct {
	Items      []*TrafficLogResource
	Pagination model.Pagination
}

func (*TrafficLogResourceList) AddItem

func (*TrafficLogResourceList) GetItemType

func (l *TrafficLogResourceList) GetItemType() model.ResourceType

func (*TrafficLogResourceList) GetItems

func (l *TrafficLogResourceList) GetItems() []model.Resource

func (*TrafficLogResourceList) GetPagination

func (l *TrafficLogResourceList) GetPagination() *model.Pagination

func (*TrafficLogResourceList) NewItem

func (l *TrafficLogResourceList) NewItem() model.Resource

type TrafficPermissionResource

type TrafficPermissionResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.TrafficPermission
}

func (*TrafficPermissionResource) Destinations

func (t *TrafficPermissionResource) Destinations() []*mesh_proto.Selector

func (*TrafficPermissionResource) GetMeta

func (*TrafficPermissionResource) GetSpec

func (*TrafficPermissionResource) GetType

func (*TrafficPermissionResource) SetMeta

func (*TrafficPermissionResource) SetSpec

func (*TrafficPermissionResource) Sources

func (*TrafficPermissionResource) Validate

func (d *TrafficPermissionResource) Validate() error

type TrafficPermissionResourceList

type TrafficPermissionResourceList struct {
	Items      []*TrafficPermissionResource
	Pagination model.Pagination
}

func (*TrafficPermissionResourceList) AddItem

func (*TrafficPermissionResourceList) GetItemType

func (*TrafficPermissionResourceList) GetItems

func (*TrafficPermissionResourceList) GetPagination

func (l *TrafficPermissionResourceList) GetPagination() *model.Pagination

func (*TrafficPermissionResourceList) NewItem

type TrafficRouteResource

type TrafficRouteResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.TrafficRoute
}

func (*TrafficRouteResource) Destinations

func (t *TrafficRouteResource) Destinations() []*mesh_proto.Selector

func (*TrafficRouteResource) GetMeta

func (*TrafficRouteResource) GetSpec

func (*TrafficRouteResource) GetType

func (*TrafficRouteResource) SetMeta

func (t *TrafficRouteResource) SetMeta(m model.ResourceMeta)

func (*TrafficRouteResource) SetSpec

func (t *TrafficRouteResource) SetSpec(spec model.ResourceSpec) error

func (*TrafficRouteResource) Sources

func (t *TrafficRouteResource) Sources() []*mesh_proto.Selector

func (*TrafficRouteResource) Validate

func (d *TrafficRouteResource) Validate() error

type TrafficRouteResourceList

type TrafficRouteResourceList struct {
	Items      []*TrafficRouteResource
	Pagination model.Pagination
}

func (*TrafficRouteResourceList) AddItem

func (*TrafficRouteResourceList) GetItemType

func (l *TrafficRouteResourceList) GetItemType() model.ResourceType

func (*TrafficRouteResourceList) GetItems

func (l *TrafficRouteResourceList) GetItems() []model.Resource

func (*TrafficRouteResourceList) GetPagination

func (l *TrafficRouteResourceList) GetPagination() *model.Pagination

func (*TrafficRouteResourceList) NewItem

type TrafficTraceResource

type TrafficTraceResource struct {
	Meta model.ResourceMeta
	Spec mesh_proto.TrafficTrace
}

func (*TrafficTraceResource) GetMeta

func (*TrafficTraceResource) GetSpec

func (*TrafficTraceResource) GetType

func (*TrafficTraceResource) Selectors

func (t *TrafficTraceResource) Selectors() []*mesh_proto.Selector

func (*TrafficTraceResource) SetMeta

func (t *TrafficTraceResource) SetMeta(m model.ResourceMeta)

func (*TrafficTraceResource) SetSpec

func (t *TrafficTraceResource) SetSpec(spec model.ResourceSpec) error

func (*TrafficTraceResource) Validate

func (d *TrafficTraceResource) Validate() error

type TrafficTraceResourceList

type TrafficTraceResourceList struct {
	Items      []*TrafficTraceResource
	Pagination model.Pagination
}

func (*TrafficTraceResourceList) AddItem

func (*TrafficTraceResourceList) GetItemType

func (l *TrafficTraceResourceList) GetItemType() model.ResourceType

func (*TrafficTraceResourceList) GetItems

func (l *TrafficTraceResourceList) GetItems() []model.Resource

func (*TrafficTraceResourceList) GetPagination

func (l *TrafficTraceResourceList) GetPagination() *model.Pagination

func (*TrafficTraceResourceList) NewItem

type ValidateSelectorOpts

type ValidateSelectorOpts struct {
	RequireAtLeastOneTag    bool
	RequireService          bool
	ExtraSelectorValidators []SelectorValidatorFunc
	ExtraTagKeyValidators   []TagKeyValidatorFunc
	ExtraTagValueValidators []TagValueValidatorFunc
}

type ValidateSelectorsOpts

type ValidateSelectorsOpts struct {
	ValidateSelectorOpts
	RequireAtLeastOneSelector bool
}

Jump to

Keyboard shortcuts

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