Versions in this module Expand all Collapse all v1 v1.0.0 Dec 24, 2023 Changes in this version + const LZFUHeader + var CodePageIdentifierToEncoding = map[int]string + var CompressionTypeCompressed = []byte("LZFu") + var CompressionTypeUncompressed = []byte("MELA") + var ErrAttachmentIndexInvalid = errors.New("go-pst: invalid attachment index, there are no more attachments") + var ErrAttachmentsNotFound = errors.New("go-pst: message has no attachments") + var ErrBTreeNodeConflict = errors.New("go-pst: conflicting b-tree node entry") + var ErrBTreeNodeNotFound = errors.New("go-pst: failed to find b-tree node") + var ErrBlockIndexNotFound = errors.New("go-pst: block index not found") + var ErrBlockSignatureInvalid = errors.New("go-pst: invalid block signature") + var ErrBlockTypeInvalid = errors.New("go-pst: unsupported block type") + var ErrContentTypeUnsupported = errors.New("go-pst: unsupported content type") + var ErrEncryptionTypeUnsupported = errors.New("go-pst: unsupported encryption type") + var ErrFileSignatureInvalid = errors.New("go-pst: invalid file signature") + var ErrFormatTypeUnsupported = errors.New("go-pst: unsupported format type") + var ErrHeapOnNodeExternalNode = errors.New("go-pst: external node, no local descriptors provided") + var ErrLocalDescriptorBranchNode = errors.New(...) + var ErrLocalDescriptorNotFound = errors.New("go-pst: failed to find local descriptor") + var ErrLocalDescriptorsSignatureInvalid = errors.New("go-pst: invalid local descriptors signature") + var ErrMessageIdentifierTypeInvalid = errors.New("go-pst: invalid message identifier type") + var ErrMessagesNotFound = errors.New("go-pst: folder has no messages") + var ErrNameToIDMapKeyNotFound = errors.New("go-pst: failed to find key in Name-To-ID Map") + var ErrPropertyNoData = errors.New("go-pst: property has no data") + var ErrPropertyNotFound = errors.New("go-pst: failed to find property by ID") + var ErrPropertyTypeMismatch = errors.New("go-pst: property type is not the same as the value expected from the caller") + var ErrTableContextNoColumns = errors.New("go-pst: there are no columns in this table context") + var ErrTableContextNoRows = errors.New("go-pst: there are no rows in this table context") + var ErrTableSignatureInvalid = errors.New("go-pst: invalid table signature") + var ErrTableTypeInvalid = errors.New("go-pst: invalid table type") + var ErrTotalBlocksSizeMismatch = errors.New("go-pst: block total size mismatch") + var PropertyMap = make(map[string][]string) + var PropertyMapCSV string + var PropertySets = []string + func BTreeNodeLessFunc(a BTreeNode, b BTreeNode) bool + func DecodeString(s string) (string, error) + func ExtendCharsets(registerFunc func(name string, enc encoding.Encoding)) + func GetBTreeNodeEntryFileOffset(btreeNodeEntryData []byte, isBranchNode bool, formatType FormatType) int64 + func GetBTreeNodeEntrySize(btreeNodeEntryData []byte, formatType FormatType) uint16 + func GetIdentifierSize(formatType FormatType) uint8 + func NewBTreeNodeReader(btreeNode BTreeNode, reader Reader) *io.SectionReader + func NewBTreeStoreInMemory() *btree.BTreeG[BTreeNode] + type AsyncReader struct — linux/amd64 + func NewReaderAsync(name string) (*AsyncReader, error) + func (asyncReader *AsyncReader) Close() + func (asyncReader *AsyncReader) ReadAt(outputBuffer []byte, offset int64) (int, error) + func (asyncReader *AsyncReader) ReadAtAsync(outputBuffer []byte, offset uint64, callback func(err error)) (uint64, error) + type Attachment struct + Identifier Identifier + LocalDescriptors []LocalDescriptor + PropertyContext *PropertyContext + func (attachment *Attachment) WriteTo(writer io.Writer) (int64, error) + type AttachmentIterator struct + func (attachmentIterator *AttachmentIterator) CurrentIndex() int + func (attachmentIterator *AttachmentIterator) Err() error + func (attachmentIterator *AttachmentIterator) Next() bool + func (attachmentIterator *AttachmentIterator) Size() int + func (attachmentIterator *AttachmentIterator) Value() *Attachment + type BTreeNode struct + DataIdentifier Identifier + FileOffset int64 + Identifier Identifier + LocalDescriptorsIdentifier Identifier + NodeLevel uint8 + Size uint16 + type BTreeOnHeapHeader struct + HIDRoot Identifier + KeySize uint8 + Levels uint8 + TableType uint8 + ValueSize uint8 + type BTreeStore interface + Clear func() + Get func(key BTreeNode) (BTreeNode, bool) + Len func() int + Load func(node BTreeNode) (BTreeNode, bool) + type BTreeType uint8 + const BTreeTypeBlock + const BTreeTypeNode + type BlockType uint8 + const BlockTypeXBlock + const BlockTypeXXBlock + type ColumnDescriptor struct + CellExistenceBitmapIndex uint8 + DataOffset uint16 + DataSize uint8 + PropertyID uint16 + PropertyType PropertyType + func NewColumnDescriptor(tableContextReader io.ReaderAt, columnStartOffset int64) (ColumnDescriptor, error) + type ContentType uint8 + const ContentTypeOST + const ContentTypePAB + const ContentTypePST + type DefaultReader struct + func NewDefaultReader(reader io.ReaderAt) *DefaultReader + func (defaultReader *DefaultReader) ReadAt(outputBuffer []byte, offset int64) (int, error) + func (defaultReader *DefaultReader) ReadAtAsync(outputBuffer []byte, offset uint64, callback func(err error)) (uint64, error) + type EncryptionType uint8 + const EncryptionTypeNone + const EncryptionTypePermute + type File struct + BlockBTree BTreeStore + EncryptionType EncryptionType + FormatType FormatType + NameToIDMap *NameToIDMap + NodeBTree BTreeStore + Reader Reader + func New(reader io.ReaderAt) (*File, error) + func NewAsync(name string) (*File, error) + func NewFromReaderWithBTrees(reader Reader, nodeBTree BTreeStore, blockBTree BTreeStore) (*File, error) + func (file *File) Cleanup() + func (file *File) GetAttachment(messageIdentifier Identifier) (*Attachment, error) + func (file *File) GetBTreeNode(identifier Identifier, btreeStore BTreeStore) (BTreeNode, error) + func (file *File) GetBTreeNodeEntries(btreeNodeOffset int64, btreeType BTreeType, ...) + func (file *File) GetBTreeNodeEntryCount(btreeNode []byte) uint16 + func (file *File) GetBTreeNodeEntrySize(btreeNode []byte) uint8 + func (file *File) GetBTreeNodeLevel(btreeNode []byte) uint8 + func (file *File) GetBTreeNodeRawEntries(btreeNodeOffset int64, callback func([]byte, error)) + func (file *File) GetBTreeOnHeapHeader(heapOnNode *HeapOnNode) (*BTreeOnHeapHeader, error) + func (file *File) GetBlockBTreeNode(identifier Identifier) (BTreeNode, error) + func (file *File) GetBlockBTreeOffset() (int64, error) + func (file *File) GetBlockSize() (int, error) + func (file *File) GetBlockTrailerSize() (int, error) + func (file *File) GetBlocks(btreeNodeHeapOnNodeOffset int64) ([]BTreeNode, error) + func (file *File) GetBlocksTotalSize(nodeEntryHeapOnNodeOffset int64) (uint32, error) + func (file *File) GetContentType() (ContentType, error) + func (file *File) GetDataBTreeNode(identifier Identifier) (BTreeNode, error) + func (file *File) GetEncryptionType() (EncryptionType, error) + func (file *File) GetFormatType() (FormatType, error) + func (file *File) GetHeapOnNode(btreeNode BTreeNode) (*HeapOnNode, error) + func (file *File) GetHeapOnNodeFromLocalDescriptor(localDescriptor LocalDescriptor) (*HeapOnNode, error) + func (file *File) GetHeapOnNodeReaderFromHID(hid Identifier, heapOnNodeReader HeapOnNodeReader) (*HeapOnNodeReader, error) + func (file *File) GetHeapOnNodeReaderFromHNID(hnid Identifier, heapOnNodeReader HeapOnNodeReader, ...) (*HeapOnNodeReader, error) + func (file *File) GetLocalDescriptors(btreeNodeEntry BTreeNode) ([]LocalDescriptor, error) + func (file *File) GetLocalDescriptorsFromIdentifier(localDescriptorsIdentifier Identifier) ([]LocalDescriptor, error) + func (file *File) GetMessage(identifier Identifier) (*Message, error) + func (file *File) GetMessageStore() (*PropertyContext, error) + func (file *File) GetNameToIDMap() (*NameToIDMap, error) + func (file *File) GetNodeBTreeNode(identifier Identifier) (BTreeNode, error) + func (file *File) GetNodeBTreeOffset() (int64, error) + func (file *File) GetParentBTreeNodeLevel(btreeNodeOffset int64) (uint8, error) + func (file *File) GetPropertyContext(heapOnNode *HeapOnNode) (*PropertyContext, error) + func (file *File) GetRootFolder() (Folder, error) + func (file *File) GetTableContext(heapOnNode *HeapOnNode, localDescriptors []LocalDescriptor, ...) (TableContext, error) + func (file *File) GetTableContextProperty(tableRowMatrixReader io.ReaderAt, rowOffset int64, column ColumnDescriptor) (Property, error) + func (file *File) IsValidSignature() (bool, error) + func (file *File) WalkAndCreateBTree(btreeOffset int64, btreeType BTreeType, btreeStore BTreeStore) + func (file *File) WalkFolders(walkFolderFunc WalkFolderFunc) error + type Folder struct + File *File + HasSubFolders bool + Identifier Identifier + MessageCount int32 + Name string + PropertyContext *PropertyContext + func (folder *Folder) GetAllMessages() ([]*Message, error) + func (folder *Folder) GetMessageIterator() (MessageIterator, error) + func (folder *Folder) GetMessageTableContext() (TableContext, error) + func (folder *Folder) GetSubFolders() ([]Folder, error) + func (folder *Folder) GetSubFoldersTableContext() (TableContext, error) + func (folder *Folder) WalkFolders(walkFolderFunc WalkFolderFunc) error + type FormatType uint8 + const FormatTypeANSI + const FormatTypeUnicode + const FormatTypeUnicode4k + type GUID struct + Data1 uint32 + Data2 uint16 + Data3 uint16 + Data4 [8]byte + func GUIDFromWindowsArray(b []byte) GUID + func (g GUID) String() string + type HeapOnNode struct + Reader *HeapOnNodeReader + func (heapOnNode *HeapOnNode) GetHIDUserRoot() (Identifier, error) + func (heapOnNode *HeapOnNode) GetTableType() (uint8, error) + func (heapOnNode *HeapOnNode) IsValidSignature() (bool, error) + type HeapOnNodeReader struct + BlockOffsets []int64 + Blocks []io.SectionReader + EncryptionType EncryptionType + TotalBlockSize int64 + func NewHeapOnNodeReader(encryptionType EncryptionType, blocks ...io.SectionReader) *HeapOnNodeReader + func (heapOnNodeReader *HeapOnNodeReader) DecodeCompressibleEncryption(data []byte) []byte + func (heapOnNodeReader *HeapOnNodeReader) ReadAt(p []byte, off int64) (n int, err error) + func (heapOnNodeReader *HeapOnNodeReader) Size() int64 + type Identifier int64 + const IdentifierMessageStore + const IdentifierNameToIDMap + const IdentifierRootFolder + func GetBTreeNodeEntryDataIdentifier(btreeNodeEntryData []byte, formatType FormatType) Identifier + func GetBTreeNodeEntryIdentifier(btreeNodeEntryData []byte, formatType FormatType) Identifier + func GetBTreeNodeEntryLocalDescriptorsIdentifier(btreeNodeEntryData []byte, formatType FormatType) Identifier + func GetIdentifierFromBytes(identifierBytes []byte, formatType FormatType) Identifier + func (identifier Identifier) GetType() IdentifierType + type IdentifierType uint8 + const IdentifierTypeAssociatedContentsTable + const IdentifierTypeAssociatedMessage + const IdentifierTypeAttachment + const IdentifierTypeAttachmentTable + const IdentifierTypeContentsTable + const IdentifierTypeContentsTableIndex + const IdentifierTypeHID + const IdentifierTypeHierarchyTable + const IdentifierTypeInternal + const IdentifierTypeLTP + const IdentifierTypeNormalFolder + const IdentifierTypeNormalMessage + const IdentifierTypeOutgoingQueueTable + const IdentifierTypeReceiveFolderTable + const IdentifierTypeRecipientTable + const IdentifierTypeSearchContentsTable + const IdentifierTypeSearchCriteriaObject + const IdentifierTypeSearchFolder + const IdentifierTypeSearchTableIndex + const IdentifierTypeSearchUpdateQueue + type LocalDescriptor struct + DataIdentifier Identifier + Identifier Identifier + LocalDescriptorsIdentifier Identifier + func FindLocalDescriptor(identifier Identifier, localDescriptors []LocalDescriptor) (LocalDescriptor, error) + func NewLocalDescriptor(data []byte, formatType FormatType) LocalDescriptor + type Message struct + AttachmentTableContext *TableContext + File *File + Identifier Identifier + LocalDescriptors []LocalDescriptor + Properties msgp.Decodable + PropertyContext *PropertyContext + func (message *Message) GetAllAttachments() ([]*Attachment, error) + func (message *Message) GetAttachment(attachmentIndex int) (*Attachment, error) + func (message *Message) GetAttachmentCount() (int, error) + func (message *Message) GetAttachmentIterator() (AttachmentIterator, error) + func (message *Message) GetAttachmentTableContext() (*TableContext, error) + func (message *Message) GetBodyRTF() (string, error) + func (message *Message) HasAttachments() (bool, error) + type MessageIterator struct + func (messageIterator *MessageIterator) CurrentIndex() int + func (messageIterator *MessageIterator) Err() error + func (messageIterator *MessageIterator) Next() bool + func (messageIterator *MessageIterator) Size() int + func (messageIterator *MessageIterator) Value() *Message + type NameToIDMap struct + IDToName map[int]int + IDToString map[int]string + NameToID map[int]int + PropertySets []string + StringToID map[string]int + func (nameToIDMap *NameToIDMap) GetPropertyID(key int, propertySet PropertySet) (int, error) + type Property struct + Data []byte + HNID Identifier + ID uint16 + Type PropertyType + type PropertyContext struct + File *File + HeapOnNode *HeapOnNode + Properties []Property + func (propertyContext *PropertyContext) GetPropertyByID(propertyID uint16) (Property, error) + func (propertyContext *PropertyContext) GetPropertyReader(propertyID uint16, localDescriptors []LocalDescriptor) (PropertyReader, error) + func (propertyContext *PropertyContext) Populate(decodable msgp.Decodable, localDescriptors []LocalDescriptor) error + type PropertyReader struct + File *File + HeapOnNodeReader *HeapOnNodeReader + LocalDescriptors []LocalDescriptor + Property Property + func NewPropertyReader(property Property, heapOnNode *HeapOnNode, file *File, ...) (PropertyReader, error) + func (propertyReader *PropertyReader) DecodeString(data []byte) (string, error) + func (propertyReader *PropertyReader) DecodeString8(data []byte, codePageIdentifier int) (string, error) + func (propertyReader *PropertyReader) GetBoolean() (bool, error) + func (propertyReader *PropertyReader) GetDate() (int64, error) + func (propertyReader *PropertyReader) GetInteger16() (int16, error) + func (propertyReader *PropertyReader) GetInteger32() (int32, error) + func (propertyReader *PropertyReader) GetInteger64() (int64, error) + func (propertyReader *PropertyReader) GetString() (string, error) + func (propertyReader *PropertyReader) GetString8(codepageIdentifier int) (string, error) + func (propertyReader *PropertyReader) ReadAt(outputBuffer []byte, offset int64) (int, error) + func (propertyReader *PropertyReader) Size() int64 + func (propertyReader *PropertyReader) WriteMessagePackValue(writer *msgp.Writer) error + type PropertySet uint8 + const PropertySetAddress + const PropertySetAirSync + const PropertySetAppointment + const PropertySetAttachment + const PropertySetCommon + const PropertySetInternetHeaders + const PropertySetLog + const PropertySetMAPI + const PropertySetMeeting + const PropertySetMessaging + const PropertySetNote + const PropertySetPostRSS + const PropertySetPublicStrings + const PropertySetSharing + const PropertySetTask + const PropertySetUnifiedMessaging + const PropertySetXMLExtractedEntities + type PropertyType uint16 + const PropertyTypeBinary + const PropertyTypeBoolean + const PropertyTypeCurrency + const PropertyTypeErrorCode + const PropertyTypeFloating32 + const PropertyTypeFloating64 + const PropertyTypeFloatingTime + const PropertyTypeGUID + const PropertyTypeInteger16 + const PropertyTypeInteger32 + const PropertyTypeInteger64 + const PropertyTypeMultipleBinary + const PropertyTypeMultipleCurrency + const PropertyTypeMultipleFloating32 + const PropertyTypeMultipleFloating64 + const PropertyTypeMultipleFloatingTime + const PropertyTypeMultipleGUID + const PropertyTypeMultipleInteger16 + const PropertyTypeMultipleInteger32 + const PropertyTypeMultipleInteger64 + const PropertyTypeMultipleString + const PropertyTypeMultipleString8 + const PropertyTypeMultipleTime + const PropertyTypeNull + const PropertyTypeObject + const PropertyTypeRestriction + const PropertyTypeRuleAction + const PropertyTypeServerID + const PropertyTypeString + const PropertyTypeString8 + const PropertyTypeTime + const PropertyTypeUnspecified + func (propertyType PropertyType) GetDataSize() int + type RTFDecoder struct + func NewRTFDecoder() *RTFDecoder + func (rtfDecoder *RTFDecoder) Decode(data []byte) (string, error) + type Reader interface + ReadAtAsync func(outputBuffer []byte, offset uint64, callback func(err error)) (uint64, error) + type TableContext struct + File *File + HeapOnNode *HeapOnNode + Properties [][]Property + func (tableContext *TableContext) GetPropertyReader(property Property, localDescriptors ...LocalDescriptor) (PropertyReader, error) + type WalkFolderFunc = func(folder *Folder) error