fakeevtapi

package
v0.55.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Rendered for windows/amd64

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

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 New

func New() *API

New returns a new Windows Event Log API fake

func (*API) AddEventLog

func (api *API) AddEventLog(name string) error

AddEventLog adds a new event log (channel) to the fake API

func (*API) AddEventSource

func (api *API) AddEventSource(channel string, source string) error

AddEventSource adds a new source to an existing event log/channel

func (*API) EvtClearLog

func (api *API) EvtClearLog(ChannelPath string) error

EvtClearLog fake https://learn.microsoft.com/en-us/windows/win32/api/winevt/nf-winevt-evtclearlog

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) 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) GenerateEvents

func (api *API) GenerateEvents(sourceName string, numEvents uint) error

GenerateEvents writes @numEvents to the @sourceName event log source to help with generating events for testing.

func (*API) RemoveEventLog

func (api *API) RemoveEventLog(name string) error

RemoveEventLog removes an event log (channel) from the fake API

func (*API) RemoveEventSource

func (api *API) RemoveEventSource(channel string, name string) error

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

Jump to

Keyboard shortcuts

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