pst

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Package pst This file is part of go-pst (https://github.com/mooijtech/go-pst) Copyright (C) 2021 Marten Mooij (https://www.mooijtech.com/)

Index

Constants

View Source
const (
	BlockTypeXBlock  = 1
	BlockTypeXXBlock = 2
)

Constants defining the block types.

View Source
const (
	IdentifierTypeHID                     = 0
	IdentifierTypeInternal                = 1
	IdentifierTypeNormalFolder            = 2
	IdentifierTypeSearchFolder            = 3
	IdentifierTypeNormalMessage           = 4
	IdentifierTypeAttachment              = 5
	IdentifierTypeSearchUpdateQueue       = 6
	IdentifierTypeSearchCriteriaObject    = 7
	IdentifierTypeAssociatedMessage       = 8
	IdentifierTypeContentsTableIndex      = 10
	IdentifierTypeReceiveFolderTable      = 11
	IdentifierTypeOutgoingQueueTable      = 12
	IdentifierTypeHierarchyTable          = 13
	IdentifierTypeContentsTable           = 14
	IdentifierTypeAssociatedContentsTable = 15
	IdentifierTypeSearchContentsTable     = 16
	IdentifierTypeAttachmentTable         = 17
	IdentifierTypeRecipientTable          = 18
	IdentifierTypeSearchTableIndex        = 19
	IdentifierTypeLTP                     = 31

	IdentifierTypeRootFolder   = 290
	IdentifierTypeMessageStore = 33
)

Constants defining the identifier types. References "Identifier types".

View Source
const (
	BTreeTypeNode  = 0
	BTreeTypeBlock = 1
)

Constants defining the b-tree types.

View Source
const (
	FormatTypeANSI      = "ANSI"
	FormatTypeUnicode   = "Unicode"
	FormatTypeUnicode4k = "Unicode4k"
)

Constants defining the format types. References "Format Types".

View Source
const (
	EncryptionTypeNone    = "None"
	EncryptionTypePermute = "Permute"
	EncryptionTypeCyclic  = "Cyclic"
)

Constants defining the encryption types. References "Encryption Types".

View Source
const (
	PropertyTypeInteger16            = 2
	PropertyTypeInteger32            = 3
	PropertyTypeFloating32           = 4
	PropertyTypeFloating64           = 5
	PropertyTypeCurrency             = 6
	PropertyTypeFloatingTime         = 7
	PropertyTypeErrorCode            = 10
	PropertyTypeBoolean              = 11
	PropertyTypeInteger64            = 20
	PropertyTypeString               = 31
	PropertyTypeString8              = 30
	PropertyTypeTime                 = 64
	PropertyTypeGUID                 = 72
	PropertyTypeServerID             = 251
	PropertyTypeRestriction          = 253
	PropertyTypeRuleAction           = 254
	PropertyTypeBinary               = 258
	PropertyTypeMultipleInteger16    = 4098
	PropertyTypeMultipleInteger32    = 4099
	PropertyTypeMultipleFloating32   = 4100
	PropertyTypeMultipleFloating64   = 4101
	PropertyTypeMultipleCurrency     = 4102
	PropertyTypeMultipleFloatingTime = 4103
	PropertyTypeMultipleInteger64    = 4116
	PropertyTypeMultipleString       = 4127
	PropertyTypeMultipleString8      = 4126
	PropertyTypeMultipleTime         = 4160
	PropertyTypeMultipleGUID         = 4168
	PropertyTypeMultipleBinary       = 4354
	PropertyTypeUnspecified          = 0
	PropertyTypeNull                 = 1
	PropertyTypeObject               = 13
)

Constants defining the property types. References "Property types".

Variables

View Source
var (
	ContentTypePST = []byte("SM")
	ContentTypeOST = []byte("SO")
	ContentTypePAB = []byte("AB")
)

Constants defining the content types. References "Content Types".

Functions

func DecodeBytesToUTF16String added in v1.0.0

func DecodeBytesToUTF16String(input []byte) (string, error)

DecodeBytesToUTF16String decodes the bytes to UTF-16. The libpff documentation states: "Unicode strings are stored in UTF-16 little-endian without the byte order mark (BOM)."

func DecodeCompressibleEncryption

func DecodeCompressibleEncryption(data []byte) []byte

DecodeCompressibleEncryption decodes the Heap-on-Node using compressible encryption. References "Compressible encryption".

func DecodeMessageBytesToString added in v1.0.0

func DecodeMessageBytesToString(message Message, data []byte) (string, error)

DecodeMessageBytesToString decodes the message property context item to string using the message encoding.

Types

type Attachment

type Attachment struct {
	PropertyContext  []PropertyContextItem
	LocalDescriptors []LocalDescriptor
}

Attachment represents a message attachment.

func (*Attachment) GetFilename

func (attachment *Attachment) GetFilename() (string, error)

GetFilename returns the file name of this attachment.

func (*Attachment) GetLongFilename

func (attachment *Attachment) GetLongFilename() (string, error)

GetLongFilename returns the long file name of this attachment.

func (*Attachment) GetString

func (attachment *Attachment) GetString(propertyID int) (string, error)

GetString returns the string value of the property.

type BTreeNodeEntry

type BTreeNodeEntry struct {
	Data     []byte
	Children []BTreeNodeEntry
}

BTreeNodeEntry represents an entry in a b-tree node.

func FindBTreeNodeFromNode

func FindBTreeNodeFromNode(btreeNode BTreeNodeEntry, identifier int, formatType string) (BTreeNodeEntry, error)

FindBTreeNodeFromNode recursively walks the children of this node to find the given identifier.

func (*BTreeNodeEntry) GetDataIdentifier

func (btreeNodeEntry *BTreeNodeEntry) GetDataIdentifier(formatType string) (int, error)

GetDataIdentifier returns the node identifier of the data (in the node b-tree). References "The b-tree entries".

func (*BTreeNodeEntry) GetFileOffset

func (btreeNodeEntry *BTreeNodeEntry) GetFileOffset(isBranchNode bool, formatType string) (int, error)

GetFileOffset returns the file offset for this b-tree branch or leaf node. References "The b-tree entries".

func (*BTreeNodeEntry) GetIdentifier

func (btreeNodeEntry *BTreeNodeEntry) GetIdentifier(formatType string) (int, error)

GetIdentifier returns the identifier of this b-tree node entry. References "The b-tree entries".

func (*BTreeNodeEntry) GetIdentifierType

func (btreeNodeEntry *BTreeNodeEntry) GetIdentifierType(formatType string) (int, error)

GetIdentifierType returns the b-tree node entry identifier type. References "The b-tree entries", "Identifier".

func (*BTreeNodeEntry) GetLocalDescriptorsIdentifier

func (btreeNodeEntry *BTreeNodeEntry) GetLocalDescriptorsIdentifier(formatType string) (int, error)

GetLocalDescriptorsIdentifier returns the identifier to the local descriptors in the block b-tree.

func (*BTreeNodeEntry) GetSize

func (btreeNodeEntry *BTreeNodeEntry) GetSize(formatType string) (int, error)

GetSize returns the size of the data in the block b-tree leaf node entry. References "The b-tree entries".

type BTreeOnHeapHeader

type BTreeOnHeapHeader struct {
	TableType int
	KeySize   int
	ValueSize int
	Levels    int
	HIDRoot   int
}

BTreeOnHeapHeader represents the b-tree on heap header.

type ColumnDescriptor

type ColumnDescriptor struct {
	PropertyType             int
	PropertyID               int
	DataOffset               int
	DataSize                 int
	CellExistenceBitmapIndex int
}

ColumnDescriptor represents a column in the Table Context. References "Table Context", "Table Context Column Descriptor".

func NewColumnDescriptor

func NewColumnDescriptor(tableContextInputStream HeapOnNodeInputStream, columnStartOffset int) (ColumnDescriptor, error)

NewColumnDescriptor is a constructor for creating column descriptors.

type Encoding added in v0.0.8

type Encoding struct {
	// References https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
	Identifier int
	Name       string
}

Encoding represents an IANA index encoding.

func FindEncoding added in v0.0.8

func FindEncoding(identifier int) (Encoding, error)

FindEncoding returns the encoding by the specified identifier.

func GetEncodings added in v0.0.8

func GetEncodings() ([]Encoding, error)

GetEncodings returns all available encodings.

func (*Encoding) String added in v0.0.8

func (encoding *Encoding) String() string

String returns the encoding name.

type File

type File struct {
	Filepath string

	// Variables defining the node and block b-tree which need to be initialized.
	NodeBTree  []BTreeNodeEntry
	BlockBTree []BTreeNodeEntry
}

File represents a PST file.

func New

func New(filePath string) File

New is a constructor for creating PST files.

func (*File) FindBTreeNode

func (pstFile *File) FindBTreeNode(btreeType int, identifier int, formatType string) (BTreeNodeEntry, error)

FindBTreeNode returns the node in the node or block b-tree with the given identifier. Note that we don't return the first identifier because there may be two or more nodes with the same identifier so prefer leaf nodes (which there is always only one of).

func (*File) GetAttachment

func (pstFile *File) GetAttachment(message *Message, attachmentNumber int, formatType string, encryptionType string) (Attachment, error)

GetAttachment returns the specified attachment.

func (*File) GetAttachmentInputStream

func (pstFile *File) GetAttachmentInputStream(attachment Attachment, formatType string, encryptionType string) (HeapOnNodeInputStream, error)

GetAttachmentInputStream returns the input stream of this attachment.

func (*File) GetAttachments

func (pstFile *File) GetAttachments(message *Message, formatType string, encryptionType string) ([]Attachment, error)

GetAttachments returns the attachments of this message.

func (*File) GetAttachmentsCount

func (pstFile *File) GetAttachmentsCount(message *Message, formatType string, encryptionType string) (int, error)

GetAttachmentsCount returns the amount of rows in the attachments table context.

func (*File) GetAttachmentsTableContext

func (pstFile *File) GetAttachmentsTableContext(message *Message, formatType string, encryptionType string) ([][]TableContextItem, error)

GetAttachmentsTableContext returns the table context of the attachments of this message.

func (*File) GetBTreeNodeEntries

func (pstFile *File) GetBTreeNodeEntries(btreeNodeOffset int, formatType string) ([]BTreeNodeEntry, error)

GetBTreeNodeEntries returns the entries in the b-tree node. References "The node and block b-tree".

func (*File) GetBTreeNodeEntryCount

func (pstFile *File) GetBTreeNodeEntryCount(btreeNodeOffset int, formatType string) (int, error)

GetBTreeNodeEntryCount returns the amount of entries in the b-tree. References "The node and block b-tree".

func (*File) GetBTreeNodeEntrySize

func (pstFile *File) GetBTreeNodeEntrySize(btreeNodeOffset int, formatType string) (int, error)

GetBTreeNodeEntrySize returns the size of an entry in the b-tree. References "The node and block b-tree".

func (*File) GetBTreeNodeLevel

func (pstFile *File) GetBTreeNodeLevel(btreeNodeOffset int, formatType string) (int, error)

GetBTreeNodeLevel returns the level of the b-tree node. References "The node and block b-tree".

func (*File) GetBTreeOnHeapHeader

func (pstFile *File) GetBTreeOnHeapHeader(heapOnNode HeapOnNode, localDescriptors []LocalDescriptor, formatType string, encryptionType string) (BTreeOnHeapHeader, error)

GetBTreeOnHeapHeader returns the btree on heap header.

func (*File) GetBlockBTreeNode

func (pstFile *File) GetBlockBTreeNode(identifier int, formatType string) (BTreeNodeEntry, error)

GetBlockBTreeNode returns the node with the given identifier in the block b-tree.

func (*File) GetBlockBTreeOffset

func (pstFile *File) GetBlockBTreeOffset(formatType string) (int, error)

GetBlockBTreeOffset returns the file offset to the block b-tree. References "The 64-bit header data", "The 32-bit header data".

func (*File) GetBlockSize

func (pstFile *File) GetBlockSize(formatType string) (int, error)

GetBlockSize returns the size of a block. References "Blocks".

func (*File) GetBlockTrailerSize

func (pstFile *File) GetBlockTrailerSize(formatType string) (int, error)

GetBlockTrailerSize returns the size of a block trailer. References "Blocks".

func (*File) GetBlocks

func (pstFile *File) GetBlocks(nodeEntryHeapOnNodeOffset int, formatType string) ([]BTreeNodeEntry, error)

GetBlocks parses the XBlock and XXBlock from a Heap-on-Node. Used by the NodeInputStream (internal identifiers have blocks).

func (*File) GetBlocksTotalSize

func (pstFile *File) GetBlocksTotalSize(nodeEntryHeapOnNodeOffset int) (int, error)

GetBlocksTotalSize returns the size of the external data referenced by the XBlock or XXBlock.

func (*File) GetBodyHTML added in v1.0.0

func (pstFile *File) GetBodyHTML(message Message, formatType string, encryptionType string) (string, error)

GetBodyHTML returns the HTML body of this message.

func (*File) GetContentType

func (pstFile *File) GetContentType() ([]byte, error)

GetContentType returns if the file is a PST, OST or PAB file. References "File Header", "Content Types".

func (*File) GetDataBTreeNode

func (pstFile *File) GetDataBTreeNode(identifier int, formatType string) (BTreeNodeEntry, error)

GetDataBTreeNode searches the identifier in the node b-tree, then searches the data identifier in the block b-tree.

func (*File) GetEncryptionType

func (pstFile *File) GetEncryptionType(formatType string) (string, error)

GetEncryptionType returns the encryption type. References "The 64-bit header data", "The 32-bit header data", "Encryption Types".

func (*File) GetFormatType

func (pstFile *File) GetFormatType() (string, error)

GetFormatType returns the format type. References "File Header", "Format Types".

func (*File) GetLocalDescriptors

func (pstFile *File) GetLocalDescriptors(btreeNodeEntry BTreeNodeEntry, formatType string) ([]LocalDescriptor, error)

func (*File) GetLocalDescriptorsFromIdentifier

func (pstFile *File) GetLocalDescriptorsFromIdentifier(localDescriptorsIdentifier int, formatType string) ([]LocalDescriptor, error)

GetLocalDescriptorsFromIdentifier returns the local descriptors of the local descriptors identifier. References "Local Descriptors".

func (*File) GetMessage

func (pstFile *File) GetMessage(identifier int, formatType string, encryptionType string) (Message, error)

GetMessage returns the message of the identifier.

func (*File) GetMessageBCC added in v1.0.0

func (pstFile *File) GetMessageBCC(message Message, formatType string, encryptionType string) (string, error)

GetMessageBCC returns the BCC of this message.

func (*File) GetMessageBody added in v1.0.0

func (pstFile *File) GetMessageBody(message Message, formatType string, encryptionType string) (string, error)

GetMessageBody returns the plaintext body of the message.

func (*File) GetMessageCC added in v1.0.0

func (pstFile *File) GetMessageCC(message Message, formatType string, encryptionType string) (string, error)

GetMessageCC returns the "CC" header.

func (*File) GetMessageClass added in v1.0.0

func (pstFile *File) GetMessageClass(message Message, formatType string, encryptionType string) (string, error)

GetMessageClass returns the message class.

func (*File) GetMessageDate added in v1.0.0

func (pstFile *File) GetMessageDate(message Message, propertyID int) (time.Time, error)

GetMessageDate returns the date value of the property.

func (*File) GetMessageFrom added in v1.0.0

func (pstFile *File) GetMessageFrom(message Message, formatType string, encryptionType string) (string, error)

GetFrom returns the "From" header.

func (*File) GetMessageHeaders added in v1.0.0

func (pstFile *File) GetMessageHeaders(message Message, formatType string, encryptionType string) (string, error)

GetMessageHeaders return the message headers.

func (*File) GetMessageID added in v1.0.0

func (pstFile *File) GetMessageID(message Message, formatType string, encryptionType string) (string, error)

GetMessageID returns the message ID.

func (*File) GetMessageReceivedDate added in v1.0.0

func (pstFile *File) GetMessageReceivedDate(message Message) (time.Time, error)

GetMessageReceivedDate returns the date this message was received.

func (*File) GetMessageStore added in v0.0.8

func (pstFile *File) GetMessageStore(formatType string, encryptionType string) (MessageStore, error)

GetMessageStore returns the message store of the PST file.

func (*File) GetMessageString added in v1.0.0

func (pstFile *File) GetMessageString(message Message, propertyID int, formatType string, encryptionType string) (string, error)

GetMessageString returns the string value of the property.

func (*File) GetMessageSubject added in v1.0.0

func (pstFile *File) GetMessageSubject(message Message, formatType string, encryptionType string) (string, error)

GetSubject returns the subject of this message.

func (*File) GetMessageTableContext

func (pstFile *File) GetMessageTableContext(folder Folder, formatType string, encryptionType string) ([][]TableContextItem, error)

GetMessageTableContext returns the message table context of this folder.

func (*File) GetMessageTo added in v1.0.0

func (pstFile *File) GetMessageTo(message Message, formatType string, encryptionType string) (string, error)

GetMessageTo returns the "To" header.

func (*File) GetMessages

func (pstFile *File) GetMessages(folder Folder, formatType string, encryptionType string) ([]Message, error)

GetMessages returns an array of messages from the message table context.

func (*File) GetNodeBTreeNode

func (pstFile *File) GetNodeBTreeNode(identifier int, formatType string) (BTreeNodeEntry, error)

GetNodeBTreeNode returns the node with the given identifier in the node b-tree.

func (*File) GetNodeBTreeOffset

func (pstFile *File) GetNodeBTreeOffset(formatType string) (int, error)

GetNodeBTreeOffset returns the file offset to the node b-tree. References "The 64-bit header data", "The 32-bit header data".

func (*File) GetPropertyContext

func (pstFile *File) GetPropertyContext(heapOnNode HeapOnNode, formatType string, encryptionType string) ([]PropertyContextItem, error)

GetPropertyContext returns the property context (BC Table). References "Property Context".

func (*File) GetRootFolder

func (pstFile *File) GetRootFolder(formatType string, encryptionType string) (Folder, error)

GetRootFolder returns the root folder of the PST file.

func (*File) GetSubFolderTableContext

func (pstFile *File) GetSubFolderTableContext(folder Folder, formatType string, encryptionType string) ([][]TableContextItem, error)

GetSubFolderTableContext returns the table context for the sub-folders of this folder.

func (*File) GetSubFolders

func (pstFile *File) GetSubFolders(folder Folder, formatType string, encryptionType string) ([]Folder, error)

GetSubFolders returns the sub folders of this folder.

func (*File) GetTableContext

func (pstFile *File) GetTableContext(heapOnNode HeapOnNode, localDescriptors []LocalDescriptor, formatType string, encryptionType string, startAtRow int, numberOfRowsToReturn int, columnToGet int) ([][]TableContextItem, error)

GetTableContext returns the table context. The number of rows to return may be -1 to return all rows. References "Table Context".

func (*File) InitializeBTree

func (pstFile *File) InitializeBTree(btreeType int, formatType string) error

InitializeBTree walks the b-tree and finds the node with the given identifier.

func (*File) InitializeBTrees

func (pstFile *File) InitializeBTrees(formatType string) error

InitializeBTrees initializes the node and block b-tree.

func (*File) IsValidSignature

func (pstFile *File) IsValidSignature() (bool, error)

IsValidSignature returns true is the file matches the PFF format signature. References "File Header".

func (*File) NewHeapOnNodeFromLocalDescriptor

func (pstFile *File) NewHeapOnNodeFromLocalDescriptor(localDescriptor LocalDescriptor, formatType string, encryptionType string) (HeapOnNode, error)

NewHeapOnNodeFromLocalDescriptor creates a Heap-on-Node from the local descriptor.

func (*File) NewHeapOnNodeFromNode

func (pstFile *File) NewHeapOnNodeFromNode(btreeNodeEntry BTreeNodeEntry, formatType string, encryptionType string) (HeapOnNode, error)

NewHeapOnNodeFromNode creates a Heap-on-Node from the b-tree node entry.

func (*File) NewHeapOnNodeInputStream

func (pstFile *File) NewHeapOnNodeInputStream(btreeNodeEntry BTreeNodeEntry, formatType string, encryptionType string) (HeapOnNodeInputStream, error)

NewHeapOnNodeInputStream creates a node input stream from the Heap-on-Node.

func (*File) NewHeapOnNodeInputStreamFromHNID

func (pstFile *File) NewHeapOnNodeInputStreamFromHNID(hnid int, heapOnNode HeapOnNode, localDescriptors []LocalDescriptor, formatType string, encryptionType string) (HeapOnNodeInputStream, error)

NewHeapOnNodeInputStreamFromHNID returns the offsets from the allocation table of the given HID.

func (*File) Read

func (pstFile *File) Read(outputBufferSize int, offset int) ([]byte, error)

Read reads the PST file from the given output buffer size and offset to bytes.

func (*File) WalkBTree

func (pstFile *File) WalkBTree(btreeOffset int, formatType string) ([]BTreeNodeEntry, error)

WalkBTree walks the b-tree and returns all nodes.

func (*File) WriteAttachmentToFile

func (pstFile *File) WriteAttachmentToFile(attachment Attachment, outputPath string, formatType string, encryptionType string) error

WriteAttachmentToFile writes the input stream of the attachment to the specified output path.

type Folder

type Folder struct {
	Identifier      int
	DisplayName     string
	HasSubFolders   bool
	MessageCount    int
	PropertyContext []PropertyContextItem
}

Folder represents a folder.

type HeapOnNode

type HeapOnNode struct {
	BTreeNodeEntry BTreeNodeEntry
	InputStream    HeapOnNodeInputStream
}

HeapOnNode represents a Heap-on-Node.

func (*HeapOnNode) GetHIDUserRoot

func (heapOnNode *HeapOnNode) GetHIDUserRoot() (int, error)

GetHIDUserRoot returns the HID user root. References "Heap-on-Node header".

func (*HeapOnNode) GetPageMap

func (heapOnNode *HeapOnNode) GetPageMap(blockOffset int) (int, error)

GetPageMap returns the Heap-on-Node Page Map. References "Heap-on-Node page map".

func (*HeapOnNode) GetTableType

func (heapOnNode *HeapOnNode) GetTableType() (int, error)

GetTableType returns the table type. References "Heap-on-Node header", "Table types".

func (*HeapOnNode) IsValidSignature

func (heapOnNode *HeapOnNode) IsValidSignature() (bool, error)

IsValidSignature returns true if the signature of the block matches 0xEC (236). References "Heap-on-Node header".

type HeapOnNodeInputStream

type HeapOnNodeInputStream struct {
	File           *File
	FormatType     string
	EncryptionType string
	FileOffset     int
	StartOffset    int
	Size           int
	Blocks         []BTreeNodeEntry
}

HeapOnNodeInputStream represents a node input stream for a Heap-on-Node.

func (*HeapOnNodeInputStream) Read

func (heapOnNodeInputStream *HeapOnNodeInputStream) Read(outputBufferSize int, offset int) ([]byte, error)

Read reads from the node input stream.

func (*HeapOnNodeInputStream) SeekAndReadUint16

func (heapOnNodeInputStream *HeapOnNodeInputStream) SeekAndReadUint16(outputBufferSize int, offset int) (int, error)

SeekAndReadUint16 seeks and reads an uint16.

func (*HeapOnNodeInputStream) SeekAndReadUint32

func (heapOnNodeInputStream *HeapOnNodeInputStream) SeekAndReadUint32(outputBufferSize int, offset int) (int, error)

SeekAndReadUint32 seeks and reads an uint32.

type LocalDescriptor

type LocalDescriptor struct {
	Data []byte
}

LocalDescriptor represents an item in the local descriptors.

func FindLocalDescriptor

func FindLocalDescriptor(localDescriptors []LocalDescriptor, identifier int, formatType string) (LocalDescriptor, error)

FindLocalDescriptor returns the local descriptor with the specified identifier.

func (*LocalDescriptor) GetDataIdentifier

func (localDescriptor *LocalDescriptor) GetDataIdentifier(formatType string) (int, error)

GetDataIdentifier returns the data identifier of the local descriptor. References "Local Descriptors".

func (*LocalDescriptor) GetIdentifier

func (localDescriptor *LocalDescriptor) GetIdentifier(formatType string) (int, error)

GetIdentifier returns the identifier of the local descriptor. References "Local Descriptors".

func (*LocalDescriptor) GetLocalDescriptorsIdentifier

func (localDescriptor *LocalDescriptor) GetLocalDescriptorsIdentifier(formatType string) (int, error)

GetLocalDescriptorsIdentifier returns the local descriptors identifier of the local descriptor. References "Local Descriptors".

type Message

type Message struct {
	PropertyContext         []PropertyContextItem
	LocalDescriptors        []LocalDescriptor
	AttachmentsTableContext [][]TableContextItem
}

Message represents a message.

func (*Message) GetEncoding added in v0.0.8

func (message *Message) GetEncoding() (Encoding, error)

GetEncoding returns the encoding of the message.

func (*Message) GetInteger

func (message *Message) GetInteger(propertyID int) int

GetInteger returns the integer value of the property or -1 if it was not found.

func (*Message) HasAttachments

func (message *Message) HasAttachments() bool

HasAttachments returns true if this message has attachments.

type MessageStore added in v0.0.8

type MessageStore struct {
	PropertyContext []PropertyContextItem
}

MessageStore represents the message store.

type Property added in v0.0.8

type Property struct {
	Name string
	ID   int
}

Property represents a property.

func FindProperty

func FindProperty(propertyID int) (Property, error)

FindProperty finds the property from the property ID.

func GetProperties

func GetProperties() ([]Property, error)

GetProperties returns all available properties.

type PropertyContextItem

type PropertyContextItem struct {
	Index                    int
	PropertyID               int
	PropertyType             int
	ReferenceHNID            int
	IsExternalValueReference bool
	Data                     []byte
}

PropertyContextItem represents an item within the property context. References "Property Context B-Tree-on-Heap Record".

func FindPropertyContextItem

func FindPropertyContextItem(propertyContext []PropertyContextItem, propertyID int) (PropertyContextItem, error)

FindPropertyContextItem returns the property context item from the property ID.

func (*PropertyContextItem) String

func (propertyContextItem *PropertyContextItem) String() (string, error)

String returns the string representation of this property.

type TableContextItem

type TableContextItem struct {
	PropertyType             int
	PropertyID               int
	ReferenceHNID            int
	IsExternalValueReference bool
	Data                     []byte
}

TableContextItem represents an item within the table context.

Jump to

Keyboard shortcuts

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