machelpers

package
v0.2.0-alpha-test Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

This section is empty.

Variables

View Source
var KEY2 string
View Source
var RET interface{}

RET Global return NOTE: THIS IS VERY MESSY

View Source
var RET2 interface{}

Functions

func DecodePlist

func DecodePlist(fp, targetPath string) ([]map[string]interface{}, error)

DecodePlist returns an array of maps corresponding to entries within the given plist, values are interface

func DecodePlistBytes

func DecodePlistBytes(plistBytes []byte) (interface{}, error)

DecodePlistBytes decodes a binary or XML based Plist from bytes into an interface. Returns error from library

func FileMetadata

func FileMetadata(fp string, modulename string) (map[string]string, error)

func FileTimestamps

func FileTimestamps(fp string, modulename string) map[string]string

func GetCodesignatures

func GetCodesignatures(fp string) []string

func GetSingleValueFromPlist

func GetSingleValueFromPlist(data []map[string]interface{}, key string) (string, error)

GetSingleValueFromPlist returns the first encountered value from a given plist as a string

func GetSingleValueInterfaceFromPlist

func GetSingleValueInterfaceFromPlist(data []map[string]interface{}, key string) (interface{}, error)

GetSingleValueInterfaceFromPlist returns the first encountered value from a given plist as an interface

func IsSameFile

func IsSameFile(a, b string) bool

IsSameFile returns true if two filenames describe the same underlying file (i.e. inode)

func ListXAttr

func ListXAttr(filename string) ([]string, error)

ListXAttr returns the list of Xattrs for given file

func PrintPlistAsJSON

func PrintPlistAsJSON(obj interface{})

func ReadAttrFile

func ReadAttrFile(filename string) []byte

ReadAttrFile reads a hash for the given file. It's the fallback for ReadAttr and pairs with RecordAttrFile to read the same files it would write.

func ReadXAttr

func ReadXAttr(filename, xattrName string) ([]byte, error)

ReadAttr reads an attribute from the given file, using xattrs It returns an empty slice if it can't be read.

func ToPlist

func ToPlist(data interface{}) string

ToPlist converts a given struct to a Plist using the github.com/DHowett/go-plist library. Make sure your struct is exported. It returns a string containing the plist.

func UnarchiveNSKeyedArchiver

func UnarchiveNSKeyedArchiver(fp string) ([]interface{}, error)

UnarchiveNSKeyedArchiver extracts an NSKeyedArchiver Plist from a given filepath, (XML or Binary), and returns an array of the NSObjects converted to usable Go Types Primitives will be extracted just like regular Plist primitives (string, float64, int64, []uint8 etc.). NSArray, NSMutableArray, NSSet and NSMutableSet will transformed into []interface{} NSDictionary and NSMutableDictionary will be transformed into map[string] interface{}

func UnarchiveNSKeyedArchiverBytes

func UnarchiveNSKeyedArchiverBytes(f []byte) ([]interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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