core

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonRoute

type CommonRoute struct {
	Meta      map[string]string
	Name      string
	Namespace string
}

func (CommonRoute) GetMeta

func (c CommonRoute) GetMeta() map[string]string

func (CommonRoute) GetName

func (c CommonRoute) GetName() string

func (CommonRoute) GetNamespace

func (c CommonRoute) GetNamespace() string

type GatewayID

type GatewayID struct {
	ConsulNamespace string
	Service         string
}

type HTTPFilter

type HTTPFilter struct {
	Type     HTTPFilterType
	Header   HTTPHeaderFilter
	Redirect HTTPRedirectFilter
}

type HTTPFilterType

type HTTPFilterType int
const (
	HTTPHeaderFilterType HTTPFilterType = iota
	HTTPRedirectFilterType
)

type HTTPHeaderFilter

type HTTPHeaderFilter struct {
	Set    map[string]string
	Add    map[string]string
	Remove []string
}

type HTTPHeaderMatch

type HTTPHeaderMatch struct {
	Type  HTTPHeaderMatchType
	Name  string
	Value string
}

type HTTPHeaderMatchType

type HTTPHeaderMatchType int
const (
	HTTPHeaderMatchNoneType HTTPHeaderMatchType = iota
	HTTPHeaderMatchExactType
	HTTPHeaderMatchPrefixType
	HTTPHeaderMatchSuffixType
	HTTPHeaderMatchPresentType
	HTTPHeaderMatchRegularExpressionType
)

type HTTPMatch

type HTTPMatch struct {
	Path    HTTPPathMatch
	Headers []HTTPHeaderMatch
	Query   []HTTPQueryMatch
	Method  HTTPMethod
}

type HTTPMethod

type HTTPMethod int
const (
	HTTPMethodNone HTTPMethod = iota
	HTTPMethodConnect
	HTTPMethodDelete
	HTTPMethodGet
	HTTPMethodHead
	HTTPMethodOptions
	HTTPMethodPatch
	HTTPMethodPost
	HTTPMethodPut
	HTTPMethodTrace
)

type HTTPPathMatch

type HTTPPathMatch struct {
	Type  HTTPPathMatchType
	Value string
}

type HTTPPathMatchType

type HTTPPathMatchType int
const (
	HTTPPathMatchNoneType HTTPPathMatchType = iota
	HTTPPathMatchExactType
	HTTPPathMatchPrefixType
	HTTPPathMatchRegularExpressionType
)

type HTTPQueryMatch

type HTTPQueryMatch struct {
	Type  HTTPQueryMatchType
	Name  string
	Value string
}

type HTTPQueryMatchType

type HTTPQueryMatchType int
const (
	HTTPQueryMatchNoneType HTTPQueryMatchType = iota
	HTTPQueryMatchExactType
	HTTPQueryMatchPresentType
	HTTPQueryMatchRegularExpressionType
)

type HTTPRedirectFilter

type HTTPRedirectFilter struct {
	Scheme   string
	Hostname string
	Port     int
	Status   int
}

type HTTPRoute

type HTTPRoute struct {
	CommonRoute
	Hostnames []string
	Rules     []HTTPRouteRule
}

func (HTTPRoute) GetType

func (r HTTPRoute) GetType() ResolvedRouteType

type HTTPRouteBuilder

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

func NewHTTPRouteBuilder

func NewHTTPRouteBuilder() *HTTPRouteBuilder

func (*HTTPRouteBuilder) Build

func (b *HTTPRouteBuilder) Build() ResolvedRoute

func (*HTTPRouteBuilder) WithHostnames

func (b *HTTPRouteBuilder) WithHostnames(hostnames []string) *HTTPRouteBuilder

func (*HTTPRouteBuilder) WithMeta

func (b *HTTPRouteBuilder) WithMeta(meta map[string]string) *HTTPRouteBuilder

func (*HTTPRouteBuilder) WithName

func (b *HTTPRouteBuilder) WithName(name string) *HTTPRouteBuilder

func (*HTTPRouteBuilder) WithNamespace

func (b *HTTPRouteBuilder) WithNamespace(namespace string) *HTTPRouteBuilder

func (*HTTPRouteBuilder) WithRules

func (b *HTTPRouteBuilder) WithRules(rules []HTTPRouteRule) *HTTPRouteBuilder

type HTTPRouteRule

type HTTPRouteRule struct {
	Matches  []HTTPMatch
	Filters  []HTTPFilter
	Services []HTTPService
}

type HTTPService

type HTTPService struct {
	Service ResolvedService
	Weight  int32
	Filters []HTTPFilter
}

type ResolvedGateway

type ResolvedGateway struct {
	ID        GatewayID
	Meta      map[string]string
	Listeners []ResolvedListener
}

type ResolvedListener

type ResolvedListener struct {
	Name     string
	Hostname string
	Port     int
	Protocol string
	TLS      TLSParams
	Routes   []ResolvedRoute
}

type ResolvedRoute

type ResolvedRoute interface {
	GetType() ResolvedRouteType
	GetMeta() map[string]string
	GetName() string
	GetNamespace() string
}

type ResolvedRouteType

type ResolvedRouteType int
const (
	ResolvedHTTPRouteType ResolvedRouteType = iota
	ResolvedTCPRouteType
	ResolvedTLSRouteType
	ResolvedUDPRouteType
)

type ResolvedService

type ResolvedService struct {
	ConsulNamespace string
	Service         string
}

type SyncAdapter

type SyncAdapter interface {
	Sync(ctx context.Context, gateway ResolvedGateway) error
	Clear(ctx context.Context, id GatewayID) error
}

SyncAdapter is used for synchronizing store state to an external system

type TCPRoute

type TCPRoute struct {
	CommonRoute
	Service ResolvedService
}

func (TCPRoute) GetType

func (r TCPRoute) GetType() ResolvedRouteType

type TCPRouteBuilder

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

func NewTCPRouteBuilder

func NewTCPRouteBuilder() *TCPRouteBuilder

func (*TCPRouteBuilder) Build

func (b *TCPRouteBuilder) Build() ResolvedRoute

func (*TCPRouteBuilder) WithMeta

func (b *TCPRouteBuilder) WithMeta(meta map[string]string) *TCPRouteBuilder

func (*TCPRouteBuilder) WithName

func (b *TCPRouteBuilder) WithName(name string) *TCPRouteBuilder

func (*TCPRouteBuilder) WithNamespace

func (b *TCPRouteBuilder) WithNamespace(namespace string) *TCPRouteBuilder

func (*TCPRouteBuilder) WithService

func (b *TCPRouteBuilder) WithService(service ResolvedService) *TCPRouteBuilder

type TLSParams

type TLSParams struct {
	Enabled      bool
	MinVersion   string
	MaxVersion   string
	CipherSuites []string
	Certificates []string
}

Jump to

Keyboard shortcuts

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