Documentation ¶
Index ¶
- Constants
- func ServeHttp(list *memberlist.Memberlist, state *catalog.ServicesState, config *HttpConfig)
- func SvcName(name string, port int64) string
- func SvcNameSplit(name string) (string, int64, error)
- type ApiServer
- type ApiServices
- type EnvoyApi
- func (s *EnvoyApi) EnvoyClustersFromState() []*EnvoyCluster
- func (s *EnvoyApi) EnvoyListenerFromService(svc *service.Service, port int64) *EnvoyListener
- func (s *EnvoyApi) EnvoyListenersFromState() []*EnvoyListener
- func (s *EnvoyApi) EnvoyServiceFromService(svc *service.Service, svcPort int64) *EnvoyService
- func (s *EnvoyApi) HttpMux() http.Handler
- type EnvoyCluster
- type EnvoyFilter
- type EnvoyHttpFilterConfig
- type EnvoyListener
- type EnvoyRoute
- type EnvoyRouteConfig
- type EnvoyService
- type EnvoyVirtualHost
- type HttpConfig
- type HttpListener
- type Member
- type SidecarApi
Constants ¶
const (
// Used to join service name and port. Must not occur in service names
ServiceNameSeparator = ":"
)
Variables ¶
This section is empty.
Functions ¶
func ServeHttp ¶
func ServeHttp(list *memberlist.Memberlist, state *catalog.ServicesState, config *HttpConfig)
Types ¶
type ApiServices ¶
type EnvoyApi ¶
type EnvoyApi struct {
// contains filtered or unexported fields
}
func (*EnvoyApi) EnvoyClustersFromState ¶
func (s *EnvoyApi) EnvoyClustersFromState() []*EnvoyCluster
EnvoyClustersFromState genenerates a set of Envoy API cluster definitions from Sidecar state
func (*EnvoyApi) EnvoyListenerFromService ¶
func (s *EnvoyApi) EnvoyListenerFromService(svc *service.Service, port int64) *EnvoyListener
EnvoyListenerFromService takes a Sidecar service and formats it into the API format for an Envoy proxy listener (LDS API v1)
func (*EnvoyApi) EnvoyListenersFromState ¶
func (s *EnvoyApi) EnvoyListenersFromState() []*EnvoyListener
EnvoyListenersFromState creates a set of Enovy API listener definitions from all the ServicePorts in the Sidecar state.
func (*EnvoyApi) EnvoyServiceFromService ¶
func (s *EnvoyApi) EnvoyServiceFromService(svc *service.Service, svcPort int64) *EnvoyService
EnvoyServiceFromService converts a Sidecar service to an Envoy API service for reporting to the proxy
type EnvoyCluster ¶
type EnvoyCluster struct { Name string `json:"name"` Type string `json:"type"` ConnectTimeoutMs int64 `json:"connect_timeout_ms"` LBType string `json:"lb_type"` ServiceName string `json:"service_name"` }
See https://www.envoyproxy.io/docs/envoy/latest/api-v1/cluster_manager/cluster.html
type EnvoyFilter ¶
type EnvoyFilter struct { Name string `json:"name"` Config *EnvoyHttpFilterConfig `json:"config"` }
A basic Envoy Http Route Filter
type EnvoyHttpFilterConfig ¶
type EnvoyHttpFilterConfig struct { CodecType string `json:"codec_type,omitempty"` StatPrefix string `json:"stat_prefix,omitempty"` RouteConfig *EnvoyRouteConfig `json:"route_config,omitempty"` Filters []*EnvoyFilter `json:"filters,omitempty"` }
type EnvoyListener ¶
type EnvoyListener struct { Name string `json:"name"` Address string `json:"address"` Filters []*EnvoyFilter `json:"filters"` // TODO support filters? }
https://www.envoyproxy.io/docs/envoy/latest/api-v1/listeners/listeners.html
type EnvoyRoute ¶
type EnvoyRouteConfig ¶
type EnvoyRouteConfig struct {
VirtualHosts []*EnvoyVirtualHost `json:"virtual_hosts"`
}
type EnvoyService ¶
type EnvoyService struct { IPAddress string `json:"ip_address"` LastCheckIn string `json:"last_check_in"` Port int64 `json:"port"` Revision string `json:"revision"` Service string `json:"service"` ServiceRepoName string `json:"service_repo_name"` Tags map[string]string `json:"tags"` }
See https://www.envoyproxy.io/docs/envoy/latest/api-v1/cluster_manager/sds.html
type EnvoyVirtualHost ¶
type EnvoyVirtualHost struct { Name string `json:"name"` Domains []string `json:"domains"` Routes []*EnvoyRoute `json:"routes"` }
type HttpConfig ¶
type HttpListener ¶
type HttpListener struct {
// contains filtered or unexported fields
}
A ServicesState.Listener that we use for the /watch endpoint
func NewHttpListener ¶
func NewHttpListener() *HttpListener
func (*HttpListener) Chan ¶
func (h *HttpListener) Chan() chan catalog.ChangeEvent
func (*HttpListener) Managed ¶
func (h *HttpListener) Managed() bool
func (*HttpListener) Name ¶
func (h *HttpListener) Name() string
type SidecarApi ¶
type SidecarApi struct {
// contains filtered or unexported fields
}
func (*SidecarApi) HttpMux ¶
func (s *SidecarApi) HttpMux() http.Handler