monitor

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor is a generic monitor to subscribe to Wmi Events based on a Query String

func CreateMonitor

func CreateMonitor(wmiNamespace string, callbackContext interface{},
	callback func(interface{}, string)) *Monitor

CreateMonitor createa a new Monitor

func (*Monitor) AddEntityWithFilter

func (c *Monitor) AddEntityWithFilter(entityName, wqlQueryString string, filters query.WmiQueryFilterCollection) (err error)

AddEntityWithFilter would add the entity to be monitored for changes

func (*Monitor) Close

func (c *Monitor) Close() error

Close the monitor

func (*Monitor) RemoveEntity

func (c *Monitor) RemoveEntity(entityName string) (err error)

RemoveEntity to remove the entity being monitored for changes

type WmiEventMessage added in v0.2.7

type WmiEventMessage interface {
	ToString() string
	AsFilter() interface{}
}

type WmiEventMessageFactory added in v0.2.7

type WmiEventMessageFactory interface {
	NewWmiEventMessage(wmiInstances []*cim.WmiInstance) (WmiEventMessage, error)
}

type WmiNotificationLockedCallback added in v0.2.7

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

type WmiNotificationMonitor added in v0.2.7

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

func NewWmiNotificationMonitor added in v0.2.7

func NewWmiNotificationMonitor(wmiNamespace string, wmiObjectName string, wmiHostDomainName string, queryString string, wmiEventFactory WmiEventMessageFactory) *WmiNotificationMonitor

func (*WmiNotificationMonitor) AddCallback added in v0.2.7

func (n *WmiNotificationMonitor) AddCallback(filter interface{}, cb func(context.Context, WmiEventMessage, interface{}) error, callbackContext interface{}) (err error)

AddCallback adds a corresponding callback to be called when a notification comes in for the corresponding operation

func (*WmiNotificationMonitor) RemoveCallback added in v0.2.7

func (n *WmiNotificationMonitor) RemoveCallback(filter interface{}, cb func(context.Context, WmiEventMessage, interface{}) error)

RemoveCallback removes the corresponding callback

func (*WmiNotificationMonitor) Start added in v0.2.7

func (n *WmiNotificationMonitor) Start() error

Start

func (*WmiNotificationMonitor) Stop added in v0.2.7

func (n *WmiNotificationMonitor) Stop() (err error)

Stop

type WmiNotificationMonitorInstance added in v0.2.7

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

func (*WmiNotificationMonitorInstance) Close added in v0.2.7

func (c *WmiNotificationMonitorInstance) Close()

Jump to

Keyboard shortcuts

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