config

package
v0.0.0-...-7b65136 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version     string
	VersionDate string
	HTTPAddr    string         `json:"http_addr"`
	DebugAddr   string         `json:"debug_addr"`
	GRPCAddr    string         `json:"grpc_addr"`
	TopicRouter *TopicRouter   `json:"topic_router,omitempty"`
	Storage     *StorageConfig `json:"storage,omitempty"`
}
var (
	DefaultConfig *Config
)

func (*Config) ServeHTTP

func (c *Config) ServeHTTP(w http.ResponseWriter, _ *http.Request)

type KafkaConfig

type KafkaConfig struct {
	Addrs          string         `json:"addrs"`
	ProducerConfig *sarama.Config `json:"producer_config"`
}

type StorageConfig

type StorageConfig struct {
	DataType string       `json:"data_type"`       //json|protobuf, default protobuf
	Types    string       `json:"types,omitempty"` //kafka|stdout, multiple values are comma separated, default stdout
	Kafka    *KafkaConfig `json:"kafka,omitempty"`
}

type TopicRouter

type TopicRouter struct {
	DefaultTopic string `json:"default_topic"`
	// router defination and priority:
	//   {app_type}.env.{env} => topic
	//   {app_type}.{event} => topic
	//   {app_type} => topic
	//
	//   e.g.
	//   routemap:
	//   myapp.env.test => myapp_event_log_test
	//   myapp.pv => myapp_event_log_pv
	//   myapp => myapp_event_log_other
	//
	//   case app_type = myapp, env = test then myapp_event_log_test
	//   case app_type = myapp, env != test, event = pv then myapp_event_log_pv
	//   case app_type = myapp, env != test, event = mv then myapp_event_log_other
	RouteMap map[string]string `json:"route_map"`
}

Jump to

Keyboard shortcuts

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