本文整理匯總了Golang中github.com/driskell/log-courier/src/lc-lib/core.Pipeline類的典型用法代碼示例。如果您正苦於以下問題:Golang Pipeline類的具體用法?Golang Pipeline怎麽用?Golang Pipeline使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Pipeline類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newStdinRegistrar
func newStdinRegistrar(pipeline *core.Pipeline) *StdinRegistrar {
ret := &StdinRegistrar{
registrar_chan: make(chan []registrar.EventProcessor, 16),
signal_chan: make(chan int64, 1),
}
ret.group.Add(1)
pipeline.Register(ret)
return ret
}
示例2: NewSpooler
func NewSpooler(pipeline *core.Pipeline, config *core.GeneralConfig, publisher_imp *publisher.Publisher) *Spooler {
ret := &Spooler{
config: config,
spool: make([]*core.EventDescriptor, 0, config.SpoolSize),
input: make(chan *core.EventDescriptor, 16), // TODO: Make configurable?
output: publisher_imp.Connect(),
}
pipeline.Register(ret)
return ret
}
示例3: NewRegistrar
func NewRegistrar(pipeline *core.Pipeline, persistdir string) *Registrar {
ret := &Registrar{
registrar_chan: make(chan []EventProcessor, 16), // TODO: Make configurable?
persistdir: persistdir,
statefile: ".log-courier",
state: make(map[core.Stream]*FileState),
}
pipeline.Register(ret)
return ret
}
示例4: NewPublisher
func NewPublisher(pipeline *core.Pipeline, config *core.NetworkConfig, registrar registrar.Registrator) (*Publisher, error) {
ret := &Publisher{
config: config,
input: make(chan []*core.EventDescriptor, 1),
}
if registrar == nil {
ret.registrar_spool = newNullEventSpool()
} else {
ret.registrar_spool = registrar.Connect()
}
if err := ret.init(); err != nil {
return nil, err
}
pipeline.Register(ret)
return ret, nil
}
示例5: NewProspector
func NewProspector(pipeline *core.Pipeline, config *core.Config, from_beginning bool, registrar_imp registrar.Registrator, spooler_imp *spooler.Spooler) (*Prospector, error) {
ret := &Prospector{
config: config,
prospectorindex: make(map[string]*prospectorInfo),
prospectors: make(map[*prospectorInfo]*prospectorInfo),
from_beginning: from_beginning,
registrar: registrar_imp,
registrar_spool: registrar_imp.Connect(),
snapshot_chan: make(chan interface{}),
snapshot_sink: make(chan []*core.Snapshot),
output: spooler_imp.Connect(),
}
if err := ret.init(); err != nil {
return nil, err
}
pipeline.Register(ret)
return ret, nil
}
示例6: NewListener
func NewListener(pipeline *core.Pipeline, config *core.GeneralConfig) (*Listener, error) {
var err error
ret := &Listener{
config: config,
command_chan: make(chan string),
response_chan: make(chan *Response),
client_shutdown: make(chan interface{}),
// TODO: Make this limit configurable
client_started: make(chan interface{}, 50),
client_ended: make(chan interface{}, 50),
}
if ret.listener, err = ret.listen(config); err != nil {
return nil, err
}
pipeline.Register(ret)
return ret, nil
}