本文整理汇总了Golang中github.com/docker/docker/daemon/events.NewFilter函数的典型用法代码示例。如果您正苦于以下问题:Golang NewFilter函数的具体用法?Golang NewFilter怎么用?Golang NewFilter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewFilter函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: getEventFilter
// getEventFilter returns a filters.Filter for a set of filters
func (daemon *Daemon) getEventFilter(filter filters.Args) *events.Filter {
// incoming container filter can be name, id or partial id, convert to
// a full container id
for _, cn := range filter.Get("container") {
c, err := daemon.GetContainer(cn)
filter.Del("container", cn)
if err == nil {
filter.Add("container", c.ID)
}
}
return events.NewFilter(filter, daemon.GetLabels)
}
开发者ID:jasonamyers,项目名称:docker,代码行数:13,代码来源:daemon.go
示例2: GetEventFilter
// GetEventFilter returns a filters.Filter for a set of filters
func (daemon *Daemon) GetEventFilter(filter filters.Args) *events.Filter {
// incoming container filter can be name, id or partial id, convert to
// a full container id
for i, cn := range filter["container"] {
c, err := daemon.Get(cn)
if err != nil {
filter["container"][i] = ""
} else {
filter["container"][i] = c.ID
}
}
return events.NewFilter(filter, daemon.GetLabels)
}
开发者ID:Evalle,项目名称:docker,代码行数:14,代码来源:daemon.go
示例3: SubscribeToEvents
// SubscribeToEvents returns the currently record of events, a channel to stream new events from, and a function to cancel the stream of events.
func (daemon *Daemon) SubscribeToEvents(since, sinceNano int64, filter filters.Args) ([]eventtypes.Message, chan interface{}) {
ef := events.NewFilter(filter)
return daemon.EventsService.SubscribeTopic(since, sinceNano, ef)
}
开发者ID:float001,项目名称:docker,代码行数:5,代码来源:daemon.go
示例4: SubscribeToEvents
// SubscribeToEvents returns the currently record of events, a channel to stream new events from, and a function to cancel the stream of events.
func (daemon *Daemon) SubscribeToEvents(since, until time.Time, filter filters.Args) ([]events.Message, chan interface{}) {
ef := daemonevents.NewFilter(filter)
return daemon.EventsService.SubscribeTopic(since, until, ef)
}
开发者ID:SUSE,项目名称:docker.mirror,代码行数:5,代码来源:events.go
注:本文中的github.com/docker/docker/daemon/events.NewFilter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论