當前位置: 首頁>>代碼示例>>Golang>>正文


Golang events.NewFilter函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。