Documentation ¶
Overview ¶
Package fakeevtapi is a fake implementation of the Windows Event Log API intended to be used in tests. It does not make any Windows Event Log API calls. Event rendering is not implemented.
Index ¶
- type API
- func (api *API) AddEventLog(name string) error
- func (api *API) AddEventSource(channel string, source string) error
- func (api *API) DeregisterEventSource(sourceHandle evtapi.EventSourceHandle) error
- func (api *API) EvtClearLog(ChannelPath string) error
- func (api *API) EvtClose(h windows.Handle)
- func (api *API) EvtCreateBookmark(BookmarkXML string) (evtapi.EventBookmarkHandle, error)
- func (api *API) EvtCreateRenderContext(ValuePaths []string, Flags uint) (evtapi.EventRenderContextHandle, error)
- func (api *API) EvtFormatMessage(PublisherMetadata evtapi.EventPublisherMetadataHandle, ...) (string, error)
- func (api *API) EvtNext(Session evtapi.EventResultSetHandle, EventsArray []evtapi.EventRecordHandle, ...) ([]evtapi.EventRecordHandle, error)
- func (api *API) EvtOpenPublisherMetadata(PublisherID string, LogFilePath string) (evtapi.EventPublisherMetadataHandle, error)
- func (api *API) EvtOpenSession(Server string, User string, Domain string, Password string, Flags uint) (evtapi.EventSessionHandle, error)
- func (api *API) EvtRenderBookmark(Fragment evtapi.EventBookmarkHandle) ([]uint16, error)
- func (api *API) EvtRenderEventValues(Context evtapi.EventRenderContextHandle, Fragment evtapi.EventRecordHandle) (evtapi.EvtVariantValues, error)
- func (api *API) EvtRenderEventXml(Fragment evtapi.EventRecordHandle) ([]uint16, error)
- func (api *API) EvtSubscribe(Session evtapi.EventSessionHandle, SignalEvent evtapi.WaitEventHandle, ...) (evtapi.EventResultSetHandle, error)
- func (api *API) EvtUpdateBookmark(Bookmark evtapi.EventBookmarkHandle, Event evtapi.EventRecordHandle) error
- func (api *API) GenerateEvents(sourceName string, numEvents uint) error
- func (api *API) RegisterEventSource(SourceName string) (evtapi.EventSourceHandle, error)
- func (api *API) RemoveEventLog(name string) error
- func (api *API) RemoveEventSource(channel string, name string) error
- func (api *API) ReportEvent(EventLog evtapi.EventSourceHandle, Type uint, Category uint, EventID uint, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a fake implementation of the Windows Event Log API intended to be used in tests. It does not make any Windows Event Log API calls. Event rendering is not implemented.
func (*API) AddEventLog ¶
AddEventLog adds a new event log (channel) to the fake API
func (*API) AddEventSource ¶
AddEventSource adds a new source to an existing event log/channel
func (*API) DeregisterEventSource ¶
func (api *API) DeregisterEventSource(sourceHandle evtapi.EventSourceHandle) error
DeregisterEventSource fake https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-deregistereventsource
func (*API) EvtClearLog ¶
EvtClearLog fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtclearlog
func (*API) EvtClose ¶
EvtClose fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtclose
func (*API) EvtCreateBookmark ¶
func (api *API) EvtCreateBookmark(BookmarkXML string) (evtapi.EventBookmarkHandle, error)
EvtCreateBookmark fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtcreatebookmark
func (*API) EvtCreateRenderContext ¶
func (api *API) EvtCreateRenderContext(ValuePaths []string, Flags uint) (evtapi.EventRenderContextHandle, error)
EvtCreateRenderContext fake not implemented. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtcreaterendercontext
func (*API) EvtFormatMessage ¶
func (api *API) EvtFormatMessage( PublisherMetadata evtapi.EventPublisherMetadataHandle, Event evtapi.EventRecordHandle, MessageID uint, Values evtapi.EvtVariantValues, Flags uint) (string, error)
EvtFormatMessage fake not implemented. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtformatmessage
func (*API) EvtNext ¶
func (api *API) EvtNext( Session evtapi.EventResultSetHandle, EventsArray []evtapi.EventRecordHandle, EventsSize uint, Timeout uint) ([]evtapi.EventRecordHandle, error)
EvtNext fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtnext
func (*API) EvtOpenPublisherMetadata ¶
func (api *API) EvtOpenPublisherMetadata( PublisherID string, LogFilePath string) (evtapi.EventPublisherMetadataHandle, error)
EvtOpenPublisherMetadata fake not implemented. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtopenpublishermetadata
func (*API) EvtOpenSession ¶
func (api *API) EvtOpenSession( Server string, User string, Domain string, Password string, Flags uint, ) (evtapi.EventSessionHandle, error)
EvtOpenSession fake not implemented. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtformatmessage
func (*API) EvtRenderBookmark ¶
func (api *API) EvtRenderBookmark(Fragment evtapi.EventBookmarkHandle) ([]uint16, error)
EvtRenderBookmark is a fake of EvtRender with EvtRenderEventBookmark not implemented. https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender
func (*API) EvtRenderEventValues ¶
func (api *API) EvtRenderEventValues(Context evtapi.EventRenderContextHandle, Fragment evtapi.EventRecordHandle) (evtapi.EvtVariantValues, error)
EvtRenderEventValues is a fake of EvtRender with EvtRenderEventValues https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender
func (*API) EvtRenderEventXml ¶
func (api *API) EvtRenderEventXml(Fragment evtapi.EventRecordHandle) ([]uint16, error)
EvtRenderEventXml is a fake of EvtRender with EvtRenderEventXml https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtrender
func (*API) EvtSubscribe ¶
func (api *API) EvtSubscribe( Session evtapi.EventSessionHandle, SignalEvent evtapi.WaitEventHandle, ChannelPath string, Query string, Bookmark evtapi.EventBookmarkHandle, Flags uint) (evtapi.EventResultSetHandle, error)
EvtSubscribe fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtsubscribe
func (*API) EvtUpdateBookmark ¶
func (api *API) EvtUpdateBookmark(Bookmark evtapi.EventBookmarkHandle, Event evtapi.EventRecordHandle) error
EvtUpdateBookmark fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtupdatebookmark
func (*API) GenerateEvents ¶
GenerateEvents writes @numEvents to the @sourceName event log source to help with generating events for testing.
func (*API) RegisterEventSource ¶
func (api *API) RegisterEventSource(SourceName string) (evtapi.EventSourceHandle, error)
RegisterEventSource fake https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-registereventsourcew
func (*API) RemoveEventLog ¶
RemoveEventLog removes an event log (channel) from the fake API
func (*API) RemoveEventSource ¶
RemoveEventSource removes a source from a event log/channel
func (*API) ReportEvent ¶
func (api *API) ReportEvent( EventLog evtapi.EventSourceHandle, Type uint, Category uint, EventID uint, UserSID *windows.SID, Strings []string, RawData []uint8) error
ReportEvent fake https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventw