xlsx

package
v0.0.0-...-22cb0ac Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypesFileName = "[Content_Types].xml"
View Source
const PrefixXL = "/xl"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	xml.Name  `xml:"c"`
	Reference string `xml:"r,attr"`
	Type      string `xml:"t,attr"`
	Value     string `xml:"v"`
}

type Content

type Content struct {
	xml.Name      `xml:"Types"`
	DefaultTypes  []DefaultType  `xml:"Default"`
	OverrideTypes []OverrideType `xml:"Override"`
}

func (Content) FindFirstOverrideByContentType

func (cts Content) FindFirstOverrideByContentType(partNamePrefix string, cty ContentType) (OverrideType, error)

type ContentType

type ContentType string
const (
	ContentTypeXML      ContentType = "application/xml"
	ContentTypeWorkbook ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
	ContentTypeSheet    ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
	ContentTypeRels     ContentType = "application/vnd.openxmlformats-package.relationships+xml"
)

type DefaultType

type DefaultType struct {
	xml.Name    `xml:"Default"`
	Extension   string      `xml:"Extension,attr"`
	ContentType ContentType `xml:"ContentType,attr"`
}

type OverrideType

type OverrideType struct {
	xml.Name    `xml:"Override"`
	PartName    string      `xml:"PartName,attr"`
	ContentType ContentType `xml:"ContentType,attr"`
}

type Row

type Row struct {
	xml.Name `xml:"row"`
	Number   int    `xml:"r,attr"`
	Cells    []Cell `xml:"c"`
}

type Sheet

type Sheet struct {
	xml.Name  `xml:"sheet"`
	SheetName string `xml:"name,attr"`
	ID        string `xml:"sheetId,attr"`
	RID       string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr"`
}

type Workbook

type Workbook struct {
	xml.Name `xml:"workbook"`
	Sheets   []Sheet `xml:"sheets>sheet"`
}

func (Workbook) FindSheet

func (wb Workbook) FindSheet(name string) (Sheet, bool)

type WorkbookRel

type WorkbookRel struct {
	xml.Name `xml:"Relationship"`
	ID       string `xml:"Id,attr"`
	Type     string `xml:"Type,attr"`
	Target   string `xml:"Target,attr"`
}

type WorkbookRels

type WorkbookRels struct {
	xml.Name `xml:"Relationships"`
	Rels     []WorkbookRel `xml:"Relationship"`
}

func (WorkbookRels) FindRel

func (wrs WorkbookRels) FindRel(id string) (WorkbookRel, bool)

Jump to

Keyboard shortcuts

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