etw

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProviderGUIDFromName

func GetProviderGUIDFromName(providerName string) string

GetProviderGUIDFromName returns the provider GUID for a given provider name. If the provider name is not found in the map, it returns an empty string.

func UpdateLogSources

func UpdateLogSources(base64EncodedJSONLogConfig string, useDefaultLogSources bool, includeGUIDs bool) (string, error)

UpdateLogSources updates the user provided log sources with the default log sources based on the configuration and returns the updated log sources as a base64 encoded JSON string. If there is an error in the process, it returns the original user provided log sources string.

func UpdateLogSourcesFromInfo

func UpdateLogSourcesFromInfo(userLogSources LogSourcesInfo, useDefaultLogSources bool, includeGUIDs bool) (string, error)

UpdateLogSourcesFromInfo is the parsed-input variant of UpdateLogSources for callers that already have a LogSourcesInfo in hand (e.g. the gcs-sidecar after it decoded the payload for policy enforcement) and want to avoid a second base64-decode + JSON-unmarshal round-trip.

An empty userLogSources is equivalent to passing "" to UpdateLogSources.

Types

type EtwProvider

type EtwProvider struct {
	ProviderName string `json:"providerName,omitempty"`
	ProviderGUID string `json:"providerGuid,omitempty"`
	Level        string `json:"level,omitempty"`
	Keywords     string `json:"keywords,omitempty"`
}

type LogConfig

type LogConfig struct {
	Sources []Source `json:"sources"`
}

type LogSourcesInfo

type LogSourcesInfo struct {
	LogConfig LogConfig `json:"LogConfig"`
}

Log Sources JSON structure

func DecodeAndUnmarshalLogSources

func DecodeAndUnmarshalLogSources(base64EncodedJSONLogConfig string) (LogSourcesInfo, error)

DecodeAndUnmarshalLogSources decodes a base64-encoded JSON string and unmarshals it into a LogSourcesInfo.

func GetDefaultLogSources

func GetDefaultLogSources() LogSourcesInfo

GetDefaultLogSources returns the default log sources configuration.

type Source

type Source struct {
	Type      string        `json:"type"`
	Providers []EtwProvider `json:"providers"`
}

Jump to

Keyboard shortcuts

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