Adding events API to cadvisor interface.

This commit is contained in:
Vishnu Kannan 2015-04-09 15:38:36 -07:00
parent 45f85dbf06
commit 2f68cddbd2
5 changed files with 10 additions and 10 deletions

View File

@ -52,6 +52,6 @@ func (c *Fake) DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error) {
return cadvisorApiV2.FsInfo{}, nil return cadvisorApiV2.FsInfo{}, nil
} }
func (c *Fake) GetPastEvents(request *events.Request) ([]*cadvisorApi.Event, error) { func (c *Fake) WatchEvents(request *events.Request) (*events.EventChannel, error) {
return []*cadvisorApi.Event{}, nil return new(events.EventChannel), nil
} }

View File

@ -147,6 +147,6 @@ func (cc *cadvisorClient) DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error) {
return res[0], nil return res[0], nil
} }
func (cc *cadvisorClient) GetPastEvents(request *events.Request) ([]*cadvisorApi.Event, error) { func (cc *cadvisorClient) WatchEvents(request *events.Request) (*events.EventChannel, error) {
return cc.GetPastEvents(request) return cc.WatchForEvents(request)
} }

View File

@ -62,7 +62,7 @@ func (c *Mock) DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error) {
return args.Get(0).(cadvisorApiV2.FsInfo), args.Error(1) return args.Get(0).(cadvisorApiV2.FsInfo), args.Error(1)
} }
func (c *Mock) GetPastEvents(request *events.Request) ([]*cadvisorApi.Event, error) { func (c *Mock) WatchEvents(request *events.Request) (*events.EventChannel, error) {
args := c.Called() args := c.Called()
return args.Get(0).([]*cadvisorApi.Event), args.Error(1) return args.Get(0).(*events.EventChannel), args.Error(1)
} }

View File

@ -61,6 +61,6 @@ func (cu *cadvisorUnsupported) DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error
return cadvisorApiV2.FsInfo{}, unsupportedErr return cadvisorApiV2.FsInfo{}, unsupportedErr
} }
func (cu *cadvisorUnsupported) GetPastEvents(request *events.Request) ([]*cadvisorApi.Event, error) { func (cu *cadvisorUnsupported) WatchEvents(request *events.Request) (*events.EventChannel, error) {
return []*cadvisorApi.Event{}, unsupportedErr return nil, unsupportedErr
} }

View File

@ -34,6 +34,6 @@ type Interface interface {
// Returns usage information about the filesystem holding Docker images. // Returns usage information about the filesystem holding Docker images.
DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error) DockerImagesFsInfo() (cadvisorApiV2.FsInfo, error)
// Get past events that have been detected and that fit the request. // Get events streamed through passedChannel that fit the request.
GetPastEvents(request *events.Request) ([]*cadvisorApi.Event, error) WatchEvents(request *events.Request) (*events.EventChannel, error)
} }