1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
common.go 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
package eventlogging
import (
"fmt"
)
// SID represents the Windows Security Identifier for an account.
type SID struct {
Identifier string
Name string
Domain string
Type SIDType
}
// String returns string representation of SID.
func (a SID) String() string {
return fmt.Sprintf("SID Identifier[%s] Name[%s] Domain[%s] Type[%s]",
a.Identifier, a.Name, a.Domain, a.Type)
}
// SIDType identifies the type of a security identifier (SID).
type SIDType uint32
// SIDType values.
const (
// Do not reorder.
SidTypeUser SIDType = 1 + iota
SidTypeGroup
SidTypeDomain
SidTypeAlias
SidTypeWellKnownGroup
SidTypeDeletedAccount
SidTypeInvalid
SidTypeUnknown
SidTypeComputer
SidTypeLabel
)
// Mapping of SID types to their string representations.
var sidTypeToString = map[SIDType]string{
SidTypeUser: "User",
SidTypeGroup: "Group",
SidTypeDomain: "Domain",
SidTypeAlias: "Alias",
SidTypeWellKnownGroup: "Well Known Group",
SidTypeDeletedAccount: "Deleted Account",
SidTypeInvalid: "Invalid",
SidTypeUnknown: "Unknown",
SidTypeComputer: "Computer",
SidTypeLabel: "Label",
}
// String returns string representation of SIDType.
func (st SIDType) String() string {
return sidTypeToString[st]
}
// MessageFiles contains handles to event message files associated with an
// event log source.
type MessageFiles struct {
SourceName string
Err error
Handles []FileHandle
}
// FileHandle contains the handle to a single Windows message file.
type FileHandle struct {
File string // Fully-qualified path to the event message file.
Handle uintptr // Handle to the loaded event message file.
Err error // Error that occurred while loading Handle.
}
// InsufficientBufferError indicates the buffer passed to a system call is too
// small.
type InsufficientBufferError struct {
Cause error
RequiredSize int // Size of the buffer that is required.
}
func (e InsufficientBufferError) Error() string {
return e.Cause.Error()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v1.1.0

搜索帮助