Documentation
¶
Index ¶
Constants ¶
View Source
const ( // StatusNormal means server quit normally, data <= ts is synced to downstream StatusNormal int = 0 // StatusRunning means server running or quit abnormally, part of data may or may not been synced to downstream StatusRunning int = 1 )
Variables ¶
View Source
var Registry = prometheus.NewRegistry()
Registry is the metrics registry of server
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint interface {
Save(ts int64, status int) error
Load() (ts int64, status int, err error)
}
Checkpoint is able to save and load checkpoints
func NewCheckpoint ¶
func NewCheckpoint(db *gosql.DB, topicName string) (Checkpoint, error)
NewCheckpoint creates a Checkpoint
type Config ¶
type Config struct {
*flag.FlagSet `json:"-"`
LogLevel string `toml:"log-level" json:"log-level"`
ListenAddr string `toml:"addr" json:"addr"`
LogFile string `toml:"log-file" json:"log-file"`
OpenSaramaLog bool `toml:"open-sarama-log" json:"open-sarama-log"`
Up UpConfig `toml:"up" json:"up"`
Down DownConfig `toml:"down" json:"down"`
Metrics Metrics `toml:"metrics" json:"metrics"`
// contains filtered or unexported fields
}
Config is the configuration of Server
type DownConfig ¶
type DownConfig struct {
Host string `toml:"host" json:"host"`
Port int `toml:"port" json:"port"`
User string `toml:"user" json:"user"`
Password string `toml:"password" json:"password"`
WorkerCount int `toml:"worker-count" json:"worker-count"`
BatchSize int `toml:"batch-size" json:"batch-size"`
SafeMode bool `toml:"safe-mode" json:"safe-mode"`
}
DownConfig is configuration of downstream
type Metrics ¶
type Metrics struct {
Addr string `toml:"addr" json:"addr"`
Interval int `toml:"interval" json:"interval"`
}
Metrics is configuration of metrics
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the server to load data to mysql
type UpConfig ¶
type UpConfig struct {
KafkaAddrs string `toml:"kafka-addrs" json:"kafka-addrs"`
KafkaVersion string `toml:"kafka-version" json:"kafka-version"`
InitialCommitTS int64 `toml:"initial-commit-ts" json:"initial-commit-ts"`
Topic string `toml:"topic" json:"topic"`
MessageBufferSize int `toml:"message-buffer-size" json:"message-buffer-size"`
SaramaBufferSize int `toml:"sarama-buffer-size" json:"sarama-buffer-size"`
}
UpConfig is configuration of upstream
Click to show internal directories.
Click to hide internal directories.
