gateway

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Configuration_Server_Upstream_Protocol_name = map[int32]string{
		0: "GRPC",
		1: "GRPC_WEB",
		2: "CONNECT",
	}
	Configuration_Server_Upstream_Protocol_value = map[string]int32{
		"GRPC":     0,
		"GRPC_WEB": 1,
		"CONNECT":  2,
	}
)

Enum value maps for Configuration_Server_Upstream_Protocol.

View Source
var File_gateway_gateway_proto protoreflect.FileDescriptor

Functions

func BuildAttributeContext

func BuildAttributeContext(s connect.Spec, p connect.Peer, h http.Header) *attribute_context.AttributeContext

func LoadPlugins

func LoadPlugins(cfgs ...*Configuration_Plugin) (cel.EnvOption, error)

func NewMultiAddr

func NewMultiAddr(listeners ...net.Listener) net.Addr

func NewMultiListener

func NewMultiListener(listeners ...net.Listener) net.Listener

func NewServiceHandler

func NewServiceHandler(sd protoreflect.ServiceDescriptor, srv validate.ServiceRuleValidater, upstream *Upstream, opts ...connect.HandlerOption) (string, http.Handler)

Types

type Configuration

type Configuration struct {
	Servers  []*Configuration_Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
	Files    *Configuration_Files    `protobuf:"bytes,2,opt,name=files,proto3" json:"files,omitempty"`
	Plugins  []*Configuration_Plugin `protobuf:"bytes,3,rep,name=plugins,proto3" json:"plugins,omitempty"`
	Validate *validate.Configuration `protobuf:"bytes,10,opt,name=validate,proto3" json:"validate,omitempty"`
	// contains filtered or unexported fields
}

func (*Configuration) Descriptor deprecated

func (*Configuration) Descriptor() ([]byte, []int)

Deprecated: Use Configuration.ProtoReflect.Descriptor instead.

func (*Configuration) GetFiles

func (x *Configuration) GetFiles() *Configuration_Files

func (*Configuration) GetPlugins

func (x *Configuration) GetPlugins() []*Configuration_Plugin

func (*Configuration) GetServers

func (x *Configuration) GetServers() []*Configuration_Server

func (*Configuration) GetValidate

func (x *Configuration) GetValidate() *validate.Configuration

func (*Configuration) ProtoMessage

func (*Configuration) ProtoMessage()

func (*Configuration) ProtoReflect

func (x *Configuration) ProtoReflect() protoreflect.Message

func (*Configuration) Reset

func (x *Configuration) Reset()

func (*Configuration) String

func (x *Configuration) String() string

type Configuration_Files

type Configuration_Files struct {
	Sources []string `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"`
	Imports []string `protobuf:"bytes,2,rep,name=imports,proto3" json:"imports,omitempty"`
	// contains filtered or unexported fields
}

func (*Configuration_Files) Descriptor deprecated

func (*Configuration_Files) Descriptor() ([]byte, []int)

Deprecated: Use Configuration_Files.ProtoReflect.Descriptor instead.

func (*Configuration_Files) GetImports

func (x *Configuration_Files) GetImports() []string

func (*Configuration_Files) GetSources

func (x *Configuration_Files) GetSources() []string

func (*Configuration_Files) ProtoMessage

func (*Configuration_Files) ProtoMessage()

func (*Configuration_Files) ProtoReflect

func (x *Configuration_Files) ProtoReflect() protoreflect.Message

func (*Configuration_Files) Reset

func (x *Configuration_Files) Reset()

func (*Configuration_Files) String

func (x *Configuration_Files) String() string

type Configuration_Plugin

type Configuration_Plugin struct {
	Path string            `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Args map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Configuration_Plugin) Descriptor deprecated

func (*Configuration_Plugin) Descriptor() ([]byte, []int)

Deprecated: Use Configuration_Plugin.ProtoReflect.Descriptor instead.

func (*Configuration_Plugin) GetArgs

func (x *Configuration_Plugin) GetArgs() map[string]string

func (*Configuration_Plugin) GetPath

func (x *Configuration_Plugin) GetPath() string

func (*Configuration_Plugin) ProtoMessage

func (*Configuration_Plugin) ProtoMessage()

func (*Configuration_Plugin) ProtoReflect

func (x *Configuration_Plugin) ProtoReflect() protoreflect.Message

func (*Configuration_Plugin) Reset

func (x *Configuration_Plugin) Reset()

func (*Configuration_Plugin) String

func (x *Configuration_Plugin) String() string

type Configuration_Server

type Configuration_Server struct {
	Listen    []string                                  `protobuf:"bytes,1,rep,name=listen,proto3" json:"listen,omitempty"`
	Upstreams map[string]*Configuration_Server_Upstream `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Configuration_Server) Descriptor deprecated

func (*Configuration_Server) Descriptor() ([]byte, []int)

Deprecated: Use Configuration_Server.ProtoReflect.Descriptor instead.

func (*Configuration_Server) GetListen

func (x *Configuration_Server) GetListen() []string

func (*Configuration_Server) GetUpstreams

func (*Configuration_Server) ProtoMessage

func (*Configuration_Server) ProtoMessage()

func (*Configuration_Server) ProtoReflect

func (x *Configuration_Server) ProtoReflect() protoreflect.Message

func (*Configuration_Server) Reset

func (x *Configuration_Server) Reset()

func (*Configuration_Server) String

func (x *Configuration_Server) String() string

type Configuration_Server_Upstream

type Configuration_Server_Upstream struct {
	Address  string                                 `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Server   string                                 `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"`
	Protocol Configuration_Server_Upstream_Protocol `` /* 130-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Configuration_Server_Upstream) Descriptor deprecated

func (*Configuration_Server_Upstream) Descriptor() ([]byte, []int)

Deprecated: Use Configuration_Server_Upstream.ProtoReflect.Descriptor instead.

func (*Configuration_Server_Upstream) GetAddress

func (x *Configuration_Server_Upstream) GetAddress() string

func (*Configuration_Server_Upstream) GetProtocol

func (*Configuration_Server_Upstream) GetServer

func (x *Configuration_Server_Upstream) GetServer() string

func (*Configuration_Server_Upstream) ProtoMessage

func (*Configuration_Server_Upstream) ProtoMessage()

func (*Configuration_Server_Upstream) ProtoReflect

func (*Configuration_Server_Upstream) Reset

func (x *Configuration_Server_Upstream) Reset()

func (*Configuration_Server_Upstream) String

type Configuration_Server_Upstream_Protocol

type Configuration_Server_Upstream_Protocol int32
const (
	Configuration_Server_Upstream_GRPC     Configuration_Server_Upstream_Protocol = 0
	Configuration_Server_Upstream_GRPC_WEB Configuration_Server_Upstream_Protocol = 1
	Configuration_Server_Upstream_CONNECT  Configuration_Server_Upstream_Protocol = 2
)

func (Configuration_Server_Upstream_Protocol) Descriptor

func (Configuration_Server_Upstream_Protocol) Enum

func (Configuration_Server_Upstream_Protocol) EnumDescriptor deprecated

func (Configuration_Server_Upstream_Protocol) EnumDescriptor() ([]byte, []int)

Deprecated: Use Configuration_Server_Upstream_Protocol.Descriptor instead.

func (Configuration_Server_Upstream_Protocol) MarshalYAML

func (x Configuration_Server_Upstream_Protocol) MarshalYAML() (interface{}, error)

func (Configuration_Server_Upstream_Protocol) Number

func (Configuration_Server_Upstream_Protocol) String

func (Configuration_Server_Upstream_Protocol) Type

func (*Configuration_Server_Upstream_Protocol) UnmarshalYAML

func (x *Configuration_Server_Upstream_Protocol) UnmarshalYAML(value *yaml.Node) error

type Linker

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

func NewLinker

func NewLinker(ctx context.Context, filesConfig *Configuration_Files) (*Linker, error)

type MultiAddr

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

func (*MultiAddr) Addrs

func (a *MultiAddr) Addrs() []net.Addr

func (*MultiAddr) Network

func (a *MultiAddr) Network() string

func (*MultiAddr) String

func (a *MultiAddr) String() string

type MultiListener

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

func (*MultiListener) Accept

func (l *MultiListener) Accept() (net.Conn, error)

func (*MultiListener) Addr

func (l *MultiListener) Addr() net.Addr

func (*MultiListener) Close

func (l *MultiListener) Close() error

type Plugin

type Plugin interface {
	Name() string
	Version() string
	BuildLibrary(args ...string) (cel.Library, error)
}

type Server

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

func NewServer

func NewServer(linker *Linker, serverCfg *Configuration_Server, opts *validate.Configuration, envOpts ...cel.EnvOption) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) RegisterOnShutdown

func (s *Server) RegisterOnShutdown(f func())

func (*Server) SetKeepAlivesEnabled

func (s *Server) SetKeepAlivesEnabled(v bool)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

type Upstream

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

func NewUpstream

func NewUpstream(cfg *Configuration_Server_Upstream) (*Upstream, error)

func (*Upstream) NewClient

func (u *Upstream) NewClient(md protoreflect.MethodDescriptor) *connect.Client[*dynamicpb.Message, *dynamicpb.Message]

Jump to

Keyboard shortcuts

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