router

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretHeaderName = "X-App-Secret"
	KeyProducer      = "producer"
)
View Source
const (
	KeyKibana = "kibana"
)

Variables

This section is empty.

Functions

func KibanaGetClustername added in v0.2.1

func KibanaGetClustername(req *http.Request) string

Types

type ElasticsearchMeta added in v0.3.0

type ElasticsearchMeta struct {
	IndexPrefix  string `json:"index_prefix"`
	DocumentType string `json:"document_type"`
}

type KafkaMeta added in v0.3.0

type KafkaMeta struct {
	TopicName         string `json:"topic_name"`
	Partition         int32  `json:"partition"`
	ReplicationFactor int16  `json:"replication_factor"`
	ConsumerGroup     string `json:"consumer_group"`
}

type KibanaProxy added in v0.3.0

type KibanaProxy interface {
	ReverseProxy() *reverseproxy.ReverseProxy
	KibanaProxyHandler() *KibanaProxyHandler
}

func NewKibanaProxy added in v0.3.0

func NewKibanaProxy(source string, target string) KibanaProxy

type KibanaProxyHandler added in v0.3.0

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

func (KibanaProxyHandler) Director added in v0.3.0

func (h KibanaProxyHandler) Director(req *http.Request)

func (KibanaProxyHandler) ModifyResponse added in v0.3.0

func (h KibanaProxyHandler) ModifyResponse(res *http.Response) error

type KibanaRouter added in v0.2.1

type KibanaRouter interface {
	Server() *http.Server
	ServeHTTP(w http.ResponseWriter, req *http.Request)
}

func NewKibanaRouter added in v0.0.2

func NewKibanaRouter(addr, marketUrl, profilePath, casAddr string) KibanaRouter

NewKibanaRouter

type ProducerProxyHandler added in v0.3.0

type ProducerProxyHandler interface {
	Director(req *http.Request)
}

func NewProducerProxyHandler added in v0.3.0

func NewProducerProxyHandler(target *url.URL, profile Profile) ProducerProxyHandler

type ProducerRouter added in v0.2.1

type ProducerRouter interface {
	Server() *http.Server
	ServeHTTP(w http.ResponseWriter, req *http.Request)
}

func NewProducerRouter added in v0.2.1

func NewProducerRouter(addr, marketUrl, profilePath string) ProducerRouter

type Profile

type Profile struct {
	ID          int         `json:"id"`
	Name        string      `json:"name"`
	AppGroup    string      `json:"app_group_name"`
	MaxTps      int         `json:"max_tps"`
	ClusterName string      `json:"cluster_name"`
	ConsulHost  string      `json:"consul_host"`
	AppStatus   string      `json:"status"`
	Meta        ProfileMeta `json:"meta"`
}

func NewProfileFromBytes

func NewProfileFromBytes(b []byte) (*Profile, error)

func (Profile) MetaServiceName added in v0.2.0

func (p Profile) MetaServiceName(name string) (val string, ok bool)

type ProfileMeta added in v0.2.0

type ProfileMeta struct {
	ServiceNames  map[string]string `json:"service_names"`
	Kafka         KafkaMeta         `json:"kafka"`
	Elasticsearch ElasticsearchMeta `json:"elasticsearch"`
}

type TimberContext added in v0.3.0

type TimberContext struct {
	KafkaTopic             string `json:"kafka_topic"`
	KafkaPartition         int32  `json:"kafka_partition"`
	KafkaReplicationFactor int16  `json:"kafka_replication_factor"`
	ESIndexPrefix          string `json:"es_index_prefix"`
	ESDocumentType         string `json:"es_document_type"`
	AppMaxTPS              int    `json:"app_max_tps"`
}

Jump to

Keyboard shortcuts

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