Versions in this module Expand all Collapse all v1 v1.2.0 Mar 28, 2024 Changes in this version + const ContentTypeRelationships + const ContentTypeVmlDrawing + func CopyZipFile(from *zip.File, to *zip.Writer) error + func ErrorUnknownPackage(p interface{}) error + func GetLettersFn(rune rune) rune + func GetNumbersFn(rune rune) rune + func IsEmptyValue(v reflect.Value) bool + func MarshalZipFile(fileName string, source interface{}, to *zip.Writer) error + func Open(f interface{}, docFactory DocumentFactoryFn) (interface{}, error) + func UniqueName(name string, names []string, nameLimit int) string + func UnmarshalZipFile(f *zip.File, target interface{}) error + type ContentTypes struct + func (ct *ContentTypes) CountTypes(contentType ml.ContentType) int + func (ct *ContentTypes) RegisterContent(fileName string, contentType ml.ContentType) + func (ct *ContentTypes) RegisterType(extension string, contentType ml.ContentType) + func (ct *ContentTypes) RemoveContent(fileName string) + type DocumentFactoryFn func(pkg *PackageInfo) (interface{}, error) + type DocumentValidatorFn func() error + type MarshalFixation interface + AfterMarshalXML func(content []byte) []byte + type MarshalPreparation interface + BeforeMarshalXML func() interface{} + type Package interface + Save func() error + SaveAs func(target interface{}) error + type PackageFile struct + func NewPackageFile(pkg *PackageInfo, f interface{}, target interface{}, source interface{}) *PackageFile + func (pf *PackageFile) FileName() string + func (pf *PackageFile) IsNew() bool + func (pf *PackageFile) LoadIfRequired(callback func()) + func (pf *PackageFile) MarkAsUpdated() + func (pf *PackageFile) ReadStream() (*StreamFileReader, error) + func (pf *PackageFile) WriteStream(memory bool, finalizer StreamFileWriterFinalizer) (*StreamFileWriter, error) + type PackageInfo struct + Validator DocumentValidatorFn + func NewPackage(reader interface{}) *PackageInfo + func (pkg *PackageInfo) Add(fileName string, content interface{}) + func (pkg *PackageInfo) Close() error + func (pkg *PackageInfo) ContentTypes() *ContentTypes + func (pkg *PackageInfo) File(fileName string) interface{} + func (pkg *PackageInfo) FileName() string + func (pkg *PackageInfo) Files(pattern *regexp.Regexp) map[string]interface{} + func (pkg *PackageInfo) IsNew() bool + func (pkg *PackageInfo) Relationships() *Relationships + func (pkg *PackageInfo) Remove(fileName string) + func (pkg *PackageInfo) Save() error + func (pkg *PackageInfo) SaveAs(target interface{}) error + func (pkg *PackageInfo) SavePackage(f io.Writer) error + type Relationships struct + func NewRelationships(f interface{}, pkg *PackageInfo) *Relationships + func (rels *Relationships) AddFile(t ml.RelationType, target string) (int, ml.RID) + func (rels *Relationships) AddLink(t ml.RelationType, target string) (int, ml.RID) + func (rels *Relationships) FileName() string + func (rels *Relationships) GetIdByTarget(target string) ml.RID + func (rels *Relationships) GetTargetById(id string) string + func (rels *Relationships) GetTargetByType(t ml.RelationType) string + func (rels *Relationships) Remove(rid ml.RID) + func (rels *Relationships) Total() int + type StreamFileReader struct + func NewStreamFileReader(f *zip.File) (*StreamFileReader, error) + func (s *StreamFileReader) Close() error + type StreamFileWriter struct + func NewStreamFileWriter(f string, memory bool, finalizer StreamFileWriterFinalizer) (*StreamFileWriter, error) + func (s *StreamFileWriter) Close() error + func (s *StreamFileWriter) Save(to *zip.Writer) error + type StreamFileWriterFinalizer func() error