Documentation ¶
Overview ¶
Package proxy provides an implementation of a simple proxying service.
TODO(mwhittaker): Merge into gke/internal/local.
Index ¶
- Constants
- Variables
- func NewProxy(logger *slog.Logger) *proxy
- type Backend
- type HostBackends
- type RouteRequest
- func (*RouteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RouteRequest) GetClump() string
- func (x *RouteRequest) GetHostBackends() map[string]*HostBackends
- func (*RouteRequest) ProtoMessage()
- func (x *RouteRequest) ProtoReflect() protoreflect.Message
- func (x *RouteRequest) Reset()
- func (x *RouteRequest) String() string
Constants ¶
View Source
const ( // URLs for various HTTP endpoints exported by the proxy. These endpoints // are only accessible when using the hostname 'serviceweaver.internal'. RouteURL = "/proxy/route" // Host used to update proxy state. Host = "serviceweaver.internal" )
Variables ¶
View Source
var File_internal_local_proxy_proxy_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Backend ¶
type Backend struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // address of a backend Weight float32 `protobuf:"fixed32,2,opt,name=weight,proto3" json:"weight,omitempty"` // traffic fraction for the backend // contains filtered or unexported fields }
Backend stores information about a backend.
func (*Backend) Descriptor
deprecated
func (*Backend) GetAddress ¶
func (*Backend) ProtoMessage ¶
func (*Backend) ProtoMessage()
func (*Backend) ProtoReflect ¶
func (x *Backend) ProtoReflect() protoreflect.Message
type HostBackends ¶
type HostBackends struct { Backends []*Backend `protobuf:"bytes,1,rep,name=backends,proto3" json:"backends,omitempty"` // contains filtered or unexported fields }
HostBackends stores a list of backends for a given hostname.
func (*HostBackends) Descriptor
deprecated
func (*HostBackends) Descriptor() ([]byte, []int)
Deprecated: Use HostBackends.ProtoReflect.Descriptor instead.
func (*HostBackends) GetBackends ¶
func (x *HostBackends) GetBackends() []*Backend
func (*HostBackends) ProtoMessage ¶
func (*HostBackends) ProtoMessage()
func (*HostBackends) ProtoReflect ¶
func (x *HostBackends) ProtoReflect() protoreflect.Message
func (*HostBackends) Reset ¶
func (x *HostBackends) Reset()
func (*HostBackends) String ¶
func (x *HostBackends) String() string
type RouteRequest ¶
type RouteRequest struct { HostBackends map[string]*HostBackends `` /* 185-byte string literal not displayed */ Clump string `protobuf:"bytes,2,opt,name=clump,proto3" json:"clump,omitempty"` // contains filtered or unexported fields }
RouteRequest stores the mapping from hostname to the backends for that hostname.
func (*RouteRequest) Descriptor
deprecated
func (*RouteRequest) Descriptor() ([]byte, []int)
Deprecated: Use RouteRequest.ProtoReflect.Descriptor instead.
func (*RouteRequest) GetClump ¶
func (x *RouteRequest) GetClump() string
func (*RouteRequest) GetHostBackends ¶
func (x *RouteRequest) GetHostBackends() map[string]*HostBackends
func (*RouteRequest) ProtoMessage ¶
func (*RouteRequest) ProtoMessage()
func (*RouteRequest) ProtoReflect ¶
func (x *RouteRequest) ProtoReflect() protoreflect.Message
func (*RouteRequest) Reset ¶
func (x *RouteRequest) Reset()
func (*RouteRequest) String ¶
func (x *RouteRequest) String() string
Click to show internal directories.
Click to hide internal directories.