Documentation ¶
Overview ¶
Package opsys provides an interface OS for interacting with the running operating system, both with the filesystem and with Mac OS commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OS ¶
type OS interface { afero.Fs // FileAccess checks if the binary has access to the given file path. FileAccess(fp string) error // FileExist checks if the given path already exists. FileExist(fp string) (bool, error) // GetMacOSVersion checks the version of the current operating system, // assuming it is Mac OS. GetMacOSVersion() (*semver.Version, error) // GetContactMap gets a map of vcards indexed by phone numbers and email // addresses specified in those cards, from the vcard file at the given // path. GetContactMap(path string) (map[string]*vcard.Card, error) // ReadFile is a thin wrapper on the afero ReadFile utility. ReadFile(fp string) (string, error) // CopyFile copies the src file to the dstDir directory. If the file is // designated as unique and it already exists in the destination directory, // a numbered suffix will be added to the copied file name. The path of the // copied file is returned. CopyFile(src, dstDir string, unique bool) (string, error) // RmTempDir removes the temporary directory used by this package for // staging converted images for inclusion in PDF files. RmTempDir() error // GetOpenFilesLimit gets the current limit on the number of open files. GetOpenFilesLimit() int // SetOpenFilesLimit sets the open files limit to the given value to // accommodate wkhtmltopdf: // https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3081#issue-172083214 SetOpenFilesLimit(n int) error // HEIC2JPG converts the src file to a JPEG image if the src file is an // HEIC image, returning the path to the JPEG image. Otherwise the src // path is returned. HEIC2JPG(src string) (string, error) NewTxtOutFile(afero.File) OutFile NewPDFOutFile(chatFile afero.File, pdfg pdfgen.PDFGenerator, includePPA bool) OutFile }
OS interacts with the local filesystem and operating system.
type OutFile ¶
type OutFile interface { // Name returns the filepath of the Outfile. Name() string // WriteMessage adds the given message to the Outfile. WriteMessage(msg string) error // WriteAttachment embeds the given attachment in the Outfile, or adds a // reference to it if embedding is not possible (e.g. if the Outfile is // plain text, or the attachment is a movie). The return value lets the // caller know whether the file was embedded or not. WriteAttachment(attPath string) (bool, error) // ReferenceAttachment adds a reference to the given filename in the Outfile. ReferenceAttachment(filename string) error // Flush flushes the contents of an OutFile to disk, and returns the // number of images embedded in the OutFile. Flush() (int, error) }
Outfile represents single messages export file, either text or PDF.
Directories ¶
Path | Synopsis |
---|---|
Package mock_opsys is a generated GoMock package.
|
Package mock_opsys is a generated GoMock package. |
mock_pdfgen
Package mock_pdfgen is a generated GoMock package.
|
Package mock_pdfgen is a generated GoMock package. |
mock_scall
Package mock_scall is a generated GoMock package.
|
Package mock_scall is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.