Documentation ¶
Index ¶
- Constants
- func AddFileFromDisk(z *zip.Writer, zipPath, diskPath string) error
- func Decode(f *zip.File, dest interface{}) error
- func DecodeFromMap(files []*zip.File, decMap map[string]interface{}) error
- func ExtractToDiskTmp(f *zip.File, path string) (string, error)
- func MarshalXML(z *zip.Writer, filename string, v interface{}) error
- func RelationsPathFor(path string) string
- type SelfClosingWriter
Constants ¶
const ( ContentTypesFilename = "[Content_Types].xml" BaseRelsFilename = "_rels/.rels" AppPropsFilename = "docProps/app.xml" CorePropsFilename = "docProps/core.xml" )
Common filenames used in zip packages.
const XMLHeader = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>` + "\n"
XMLHeader is a header that MarshalXML uses to prefix the XML files it creates.
Variables ¶
This section is empty.
Functions ¶
func AddFileFromDisk ¶
AddFileFromDisk reads a file from disk and adds it at a given path to a zip file.
func DecodeFromMap ¶
DecodeFromMap iterates over a slice of *zip.File, decoding the entries in decMap with a matching filename.
func ExtractToDiskTmp ¶
ExtractToDiskTmp extracts a zip file to a temporary file in a given path, returning the name of the file.
func MarshalXML ¶
MarshalXML creates a file inside of a zip and marshals an object as xml, prefixing it with a standard XML header.
func RelationsPathFor ¶
RelationsPathFor returns the relations path for a given filename.
Types ¶
type SelfClosingWriter ¶
SelfClosingWriter wraps a writer and replaces XML tags of the type <foo></foo> with <foo/>