service

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPRouteReference     ResolvedReferenceType = "HTTPRoute"
	ConsulServiceReference ResolvedReferenceType = "ConsulService"

	MetaKeyKubeServiceName = "k8s-service-name"
	MetaKeyKubeNS          = "k8s-namespace"
)

Variables

This section is empty.

Functions

func NewBackendResolver

func NewBackendResolver(logger hclog.Logger, mapper common.ConsulNamespaceMapper, client gatewayclient.Client, consul consul.Client) *backendResolver

Types

type BackendReference

type BackendReference struct {
	HTTPRef    *gwv1alpha2.HTTPBackendRef
	BackendRef *gwv1alpha2.BackendRef
}

func (*BackendReference) Set

func (b *BackendReference) Set(reference interface{})

TODO: this will require a little extra work to return gwv1alpha2.BackendObjectReference for TCPRoute BackendRef and gwv1beta1.BackendObjectReference for HTTPRoute HTTPBackendRef

type BackendResolver

type BackendResolver interface {
	Resolve(ctx context.Context, namespace string, ref gwv1alpha2.BackendObjectReference) (*ResolvedReference, error)
}

type ConsulService

type ConsulService struct {
	Namespace string
	Name      string
}

type ResolutionError

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

func NewBackendNotFoundError added in v0.4.0

func NewBackendNotFoundError(inner string) ResolutionError

func NewConsulResolutionError

func NewConsulResolutionError(inner string) ResolutionError

func NewInvalidKindError added in v0.4.0

func NewInvalidKindError(inner string) ResolutionError

func NewK8sResolutionError

func NewK8sResolutionError(inner string) ResolutionError

func NewRefNotPermittedError added in v0.2.0

func NewRefNotPermittedError(inner string) ResolutionError

func NewResolutionError

func NewResolutionError(inner string) ResolutionError

func (ResolutionError) Error

func (r ResolutionError) Error() string

type ResolutionErrors

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

func NewResolutionErrors

func NewResolutionErrors() *ResolutionErrors

func (*ResolutionErrors) Add

func (r *ResolutionErrors) Add(err ResolutionError)

func (*ResolutionErrors) Empty

func (r *ResolutionErrors) Empty() bool

func (*ResolutionErrors) Flatten

func (ResolutionErrors) MarshalJSON added in v0.5.0

func (r ResolutionErrors) MarshalJSON() ([]byte, error)

func (*ResolutionErrors) String

func (r *ResolutionErrors) String() string

func (*ResolutionErrors) UnmarshalJSON added in v0.5.0

func (r *ResolutionErrors) UnmarshalJSON(b []byte) error

type ResolvedReference

type ResolvedReference struct {
	Type      ResolvedReferenceType
	Reference *BackendReference
	Consul    *ConsulService
}

func NewConsulServiceReference

func NewConsulServiceReference(consul *ConsulService) *ResolvedReference

type ResolvedReferenceType

type ResolvedReferenceType string

type RouteRule

type RouteRule struct {
	HTTPRule *gwv1alpha2.HTTPRouteRule
	TCPRule  *gwv1alpha2.TCPRouteRule
}

func NewRouteRule

func NewRouteRule(rule interface{}) RouteRule

type RouteRuleReferenceMap

type RouteRuleReferenceMap map[RouteRule][]ResolvedReference

func (RouteRuleReferenceMap) Add

func (r RouteRuleReferenceMap) Add(rule RouteRule, resolved ResolvedReference)

func (RouteRuleReferenceMap) MarshalJSON added in v0.5.0

func (r RouteRuleReferenceMap) MarshalJSON() ([]byte, error)

func (*RouteRuleReferenceMap) UnmarshalJSON added in v0.5.0

func (r *RouteRuleReferenceMap) UnmarshalJSON(b []byte) error

type ServiceResolutionErrorType

type ServiceResolutionErrorType string
const (
	K8sServiceResolutionErrorType    ServiceResolutionErrorType = ""
	BackendNotFoundErrorType         ServiceResolutionErrorType = "BackendNotFoundError"
	ConsulServiceResolutionErrorType ServiceResolutionErrorType = "ConsulServiceResolutionError"
	GenericResolutionErrorType       ServiceResolutionErrorType = "GenericResolutionError"
	InvalidKindErrorType             ServiceResolutionErrorType = "InvalidKindError"
	NoResolutionErrorType            ServiceResolutionErrorType = "NoResolutionError"
	RefNotPermittedErrorType         ServiceResolutionErrorType = "RefNotPermittedError"
)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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