convoy

package module
v0.0.0-...-f4984b2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: MIT Imports: 10 Imported by: 0

README

Convoy - Consul-Envoy service discovery service

Convoy is a tiny little service to allow Envoy to interface with Consul for service discovery.

Install
go install github.com/tcolar/convoy/cmd/convoy
Usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDSResp

type CDSResp struct {
	Clusters []Cluster `json:"clusters"`
}

func ToClusters

func ToClusters(services map[string][]string) CDSResp

type CORs

type CORs struct {
}

type CircuitBreakers

type CircuitBreakers struct {
}

type Cluster

type Cluster struct {
	Name                          string            `json:"name"`                                        //required
	Type                          string            `json:"type"`                                        //required
	ConnectTimeoutMS              int               `json:"connect_timeout_ms"`                          //required
	PerConnectionBufferLimitBytes int               `json:"per_connection_buffer_limit_bytes,omitempty"` //optional
	LBType                        string            `json:"lb_type"`                                     //required
	ServiceName                   string            `json:"service_name"`                                //required
	HealthCheck                   *HealthCheck      `json:"health_check,omitempty"`                      //optional
	MaxRequestsPerConnection      int               `json:"max_requests_per_connection,omitempty"`       //optional
	CircuitBreakers               *CircuitBreakers  `json:"circuit_breakers,omitempty"`                  //optional
	SSLContext                    *SSLContext       `json:"ssl_context,omitempty"`                       //optional
	Features                      string            `json:"features,omitempty"`                          //optional
	HTTP2Settings                 *HTTP2Settings    `json:"http2_settings,omitempty"`                    //optional
	CleanupIntervalMS             int               `json:"cleanup_interval_ms,omitempty"`               //optional
	DNSRefreshRateMS              int               `json:"dns_refresh_rate_ms,omitempty"`               //optional
	DNSLookupFamily               string            `json:"dns_lookup_family,omitempty"`                 //optional
	DNSResolvers                  []string          `json:"dns_resolvers,omitempty"`                     //optional
	OutlierDetection              *OutlierDetection `json:"outlier_detection,omitempty"`                 //optional

}

type ConsulKeys

type ConsulKeys struct {
	Keys map[string]consulapi.KVPairs
	sync.RWMutex
}

type HTTP2Settings

type HTTP2Settings struct {
}

type HealthCheck

type HealthCheck struct {
	Type string `json:"type,omitempty""`
}

type Host

type Host struct {
	IPAddress string `json:"ip_address"`
	Port      int    `json:"port"`
	Tags      Tags   `json:"tags"`
}

type OutlierDetection

type OutlierDetection struct {
}

type RDSResp

type RDSResp struct {
	ValidateClusters        bool                `json:"valide_clusters,omitempty"`
	VirtualHosts            []VirtualHost       `json:"virtual_hosts"`
	InternalOnlyHeaders     []string            `json:"internal_only_headers,omitempty"`
	ResponseHeadersToAdd    []map[string]string `json:"response_headers_to_add,omitempty"`
	ResponseHeadersToRemove []string            `json:"response_headers_to_remove,omitempty"`
	RequestHeadersToAdd     []map[string]string `json:"request_headers_to_add,omitempty"`
}

type RateLimit

type RateLimit struct {
}

type Route

type Route struct {
	Prefix    string `json:"prefix"`
	Cluster   string `json:"cluster"`
	TimeOutMS int    `json:"timeout_ms,omitempty"`
}

type SDSResp

type SDSResp struct {
	Hosts []Host `json:"hosts"`
}

func ToHosts

func ToHosts(services []*consulapi.CatalogService) SDSResp

type SSLContext

type SSLContext struct {
}

type Server

type Server struct {
	Port      int
	ConsulAPI *consulapi.Client

	QueryOptions consulapi.QueryOptions
	ConsulKeys   ConsulKeys
	// contains filtered or unexported fields
}

Server is the convoy server, a shim between Envoy and Consul

func NewServer

func NewServer(port int) *Server

NewServer creates a Convoy server

func (*Server) GetClusters

func (s *Server) GetClusters(w http.ResponseWriter, r *http.Request)

func (*Server) GetConsulKeys

func (s *Server) GetConsulKeys()

func (*Server) GetRoutes

func (s *Server) GetRoutes(w http.ResponseWriter, r *http.Request)

func (*Server) GetService

func (s *Server) GetService(w http.ResponseWriter, r *http.Request)

func (*Server) Start

func (s *Server) Start()

Start starts the server, in the background

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully stops the server

func (*Server) ToRoutes

func (s *Server) ToRoutes(services map[string][]string) RDSResp

type Tags

type Tags struct {
	AZ                  string `json:"az,omitempty"`
	Canary              string `json:"canary,omitempty"`
	LoadBalancingWeight int    `json:"load_balancing_weight,omitempty"`
}

func ToTags

func ToTags(tags []string) Tags

type VirtualCluster

type VirtualCluster struct {
}

type VirtualHost

type VirtualHost struct {
	Name                string              `json:"name"`
	Domains             []string            `json:"domains"`
	Routes              []Route             `json:"routes"`
	CORs                *CORs               `json:"cors,omitempty"`
	RequireSSL          string              `json:"require_ssl,omitempty"`
	VirtualClusters     []VirtualCluster    `json:"virtual_clusters,omitempty"`
	RateLimits          []RateLimit         `json:"rate_limits,omitempty"`
	RequestHeadersToAdd []map[string]string `json:"request_headers_to_add,omitempty"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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