Documentation ¶
Index ¶
- Constants
- Variables
- func NameHash(s string) uint16
- func RenderXML(b []byte) (string, error)
- type Attribute
- type Bookmark
- type Content
- type Document
- type Element
- type Fragment
- type Name
- type ProcInst
- type Reader
- func (r *Reader) Begin(ctx string)
- func (r *Reader) Done() error
- func (r *Reader) Read(data any) (int, error)
- func (r *Reader) ReadTag(expect ...uint8) uint8
- func (r *Reader) ReadTagAndMore(expect ...uint8) (uint8, bool)
- func (r *Reader) ReadUTF16NStringWithSize(s any) error
- func (r *Reader) ReadUTF16String(s any, sz int) error
- func (r *Reader) ReadUTF16StringWithSize(s any) error
- func (r *Reader) ReadWithBytes(b []byte, f interface{}) error
- func (r *Reader) ReadWithLen(f interface{}, excludeSize ...excludeSize) error
- func (r *Reader) SetSize(sz *uint32)
- func (r *Reader) WithErr(err ...error) error
- func (r *Reader) WithErrf(frmt string, args ...interface{}) error
- type Renderer
- type ResultSet
- type Substitution
- type Template
- type TemplateValues
- type Value
Constants ¶
const ( Null = 0x00 String = 0x01 ANSIString = 0x02 Int8 = 0x03 Uint8 = 0x04 Int16 = 0x05 Uint16 = 0x06 Int32 = 0x07 Uint32 = 0x08 Int64 = 0x09 Uint64 = 0x0A Float32 = 0x0B Float64 = 0x0C Bool = 0x0D Binary = 0x0E GUID = 0x0F SizeT = 0x10 FileTime = 0x11 SysTime = 0x12 SID = 0x13 HexInt32 = 0x14 HexInt64 = 0x15 BinXML = 0x21 )
Variables ¶
var ( ElementType uint8 = 0x01 ValueTextType uint8 = 0x05 AttributeType uint8 = 0x06 CDATAType uint8 = 0x07 CharRefType uint8 = 0x08 EntityRefType uint8 = 0x09 ProcInstType uint8 = 0x0B NormalSubstitutionType uint8 = 0x0D OptionalSubstitutionType uint8 = 0x0E )
var (
Debug = false
)
var (
ExcludeSize = excludeSize{}
)
Functions ¶
Types ¶
type Attribute ¶
type Bookmark ¶
type Bookmark struct { // A 32-bit unsigned integer that contains the total size in bytes of the // bookmark, including the header and logRecordNumbers. BookmarkSize uint32 `json:"bookmark_size"` // A 32-bit unsigned integer, and MUST be set to 0x00000018. HeaderSize uint32 `json:"header_size"` // A 32-bit unsigned integer that contains the number of channels in the // query. This is the number of elements in logRecordNumbers. LogRecordNumbersSize uint32 `json:"log_record_numbers_size"` // A 32-bit unsigned integer that indicates what channel the current // event is from. CurrentChannel uint32 `json:"current_channel"` // A 32-bit unsigned integer that contains the read direction. 0x00000000 // indicates chronological order based on time written, and 0x00000001 // indicates reverse order. ReadDirection uint32 `json:"read_direction"` // A 32-bit unsigned integer that contains the byte offset from the start // of the header to logRecordNumbers. RecordIDsOffset uint32 `json:"record_ids_offset"` // An array of 64-bit unsigned integers that contain the record numbers // for each of the channels or backup event logs. The order of the record // numbers MUST match the order of the channels or backup event logs in // the query (for example, the first channel in the query corresponds to // the first member of the array). LogRecordNumbers []uint64 `json:"log_record_numbers"` }
A query can refer to several channels or backup event logs. A subscription can refer to several channels. To accurately record the state of a query, it is necessary to know where the file cursor (bookmark) is with respect to those channels or backup event logs. The bookmark data is encoded as follows. Note that all integer fields in this structure MUST be in little-endian byte order (that is, least significant byte first).
type Content ¶
type Content struct { Type uint8 `json:"type"` More bool `json:"-"` Element *Element `json:"element,omitempty"` Text string `json:"text_value,omitempty"` Substitution *Substitution `json:"substitution,omitempty"` CharRef uint16 `json:"char_ref,omitempty"` EntityRef *Name `json:"entitiy_ref,omitempty"` CDATA string `json:"cdata,omitempty"` ProcInst *ProcInst `json:"pidata,omitempty"` }
type Document ¶
type Element ¶
type Fragment ¶
type Reader ¶
func (*Reader) ReadUTF16NStringWithSize ¶
func (*Reader) ReadUTF16StringWithSize ¶
func (*Reader) ReadWithBytes ¶
func (*Reader) ReadWithLen ¶
type Renderer ¶
type Renderer struct { EscapeText bool // contains filtered or unexported fields }
func NewRenderer ¶
func NewRenderer() *Renderer
type ResultSet ¶
type ResultSet struct { // A 32-bit unsigned integer that contains the total size in bytes of this // structure, including the header. TotalSize uint32 `json:"total_size"` // This MUST always be set to 0x00000010. HeaderSize uint32 `json:"header_size"` // This MUST always be set to 0x00000010. EventOffset uint32 `json:"event_offset"` // A 32-bit unsigned integer that contains the byte offset from the start // of this structure to bookMarkData. BookmarkOffset uint32 `json:"bookmark_offset"` // Size in bytes of the BinXml data in the eventData field. BinXMLSize uint32 `json:"binxml_size"` // A byte-array that contains variable length BinXml data. Document *Document `json:"document"` // Number of subqueryIDs fields that follow. This is 0 if the event // is selected by an XPath expression (rather than a structured XML query). SubqueriesLength uint32 `json:"subqueries_length"` // An array of subquery IDs. Events that are selected using a structured // XML query can be selected by one or more subqueries. Each subquery has // either an ID specified in the XML element that defines the subquery, // or defaults to 0xFFFFFFFF. This list has an entry for each subquery // that matches the event. If two subqueries select the event, and both // use the same ID, the ID only is listed once. Subqueries []uint32 `json:"subqueries"` // A byte-array that contains variable length bookmark data. Bookmark *Bookmark `json:"bookmark"` }
An event query or subscription returns multiple events in the result set. The result set is a buffer containing one or more variable length EVENT_DESCRIPTOR structures, as specified in [MS-DTYP] section 2.3.1. Methods that return multiple events always return an array of offsets into the buffer for the individual events.
type Substitution ¶
type Substitution struct { IsOptional bool `json:"optional,omitempty"` ID uint16 `json:"id"` Type uint8 `json:"type"` }
func (*Substitution) Decode ¶
func (s *Substitution) Decode(r *Reader) error
type Template ¶
type Template struct { ID *uuid.UUID `json:"template_id"` Length uint32 `json:"template_size"` Fragment *Fragment `json:"fragment"` Values *TemplateValues `json:"values"` }
type TemplateValues ¶
type TemplateValues struct { Values []*Value `json:"values"` ValuesLength uint32 `json:"values_length"` }
func (*TemplateValues) Decode ¶
func (o *TemplateValues) Decode(r *Reader) error