config

package
v0.0.0-...-941e108 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLUME_PATH            = "/flume"
	FLUME_SOURCE_PATH_PID = "/flume_source"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Action string `json:"action"`

	Params map[string]interface{} `json:"params"`
}

command

type HostPort

type HostPort struct {
	Host string
	Port int
}

func NewHostPort

func NewHostPort(hp string) HostPort

func (HostPort) String

func (self HostPort) String() string

type IWatcher

type IWatcher interface {
	BusinessWatcher(business string, eventType ZkEvent)
	ChildWatcher(business string, childNode []HostPort)
}

每个watcher

type Option

type Option struct {
	LogPath    string
	Businesses []string

	Zkhost string //zookeeper的Host

	QueueHostPorts []QueueHostPort //redis队列Pop

	IsCompress bool //是否对数据进行压缩

}

启动设置的选项

func NewOption

func NewOption(logPath string, businesses []string, zkhosts string, hostPorts []QueueHostPort, isCompress bool) *Option

type QueueHostPort

type QueueHostPort struct {
	HostPort

	QueueName string

	Maxconn int

	Timeout int
}

type Watcher

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

func NewWatcher

func NewWatcher(business string, watcher IWatcher) *Watcher

创建一个watcher

type ZKManager

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

func NewZKManager

func NewZKManager(zkhosts string) *ZKManager

func (*ZKManager) Close

func (self *ZKManager) Close()

func (*ZKManager) DecodeNode

func (self *ZKManager) DecodeNode(paths []string) []HostPort

func (*ZKManager) GetAndWatch

func (self *ZKManager) GetAndWatch(business string, nwatcher *Watcher) []HostPort

func (*ZKManager) RegistePath

func (self *ZKManager) RegistePath(businesses []string, childpath string)

注册当前进程节点

type ZkEvent

type ZkEvent zk.EventType
const (
	Created ZkEvent = 1 // From Exists, Get
	Deleted ZkEvent = 2 // From Exists, Get
	Changed ZkEvent = 3 // From Exists, Get
	Child   ZkEvent = 4 // From Children
)

Jump to

Keyboard shortcuts

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