workbook

package module
v0.0.0-...-f0d39a7 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Go Report Card

workbook

This is a simple elaboration on tealeg's xlsx package.

Documentation

Overview

Package workbook supports creating EADs from Excel Workbooks that can be imported into ArchivesSpace

@author R. S. Doiel, <rsdoiel@caltech.edu>

Copyright (c) 2016, Caltech All rights not granted herein are expressly reserved by Caltech.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	XMLName xml.Name `json:"-"`
	RowNo   int      `xml:"row_no,attr,omitempty" json:"row_no,int,omitempty"`
	ColNo   int      `xml:"col_no,attr,omitempty" json:"col_no,int,omitempty"`
	Value   string   `xml:",innerxml" json:"value,string"`
}

type Row

type Row struct {
	XMLName xml.Name `json:"-"`
	No      int      `xml:"row_no,attr,omitempty" json:"row_no,int,omitempty"`
	Cols    []Cell   `xml:"col,omitempty" json:"col,omitempty"`
}

type Sheet

type Sheet struct {
	XMLName xml.Name `json:"-"`
	Name    string   `xml:"sheet_name,attr,omitempty" json:"sheet_name,omitempty"`
	No      int      `xml:"sheet_no,attr,omitempty" json:"sheet_no,int,omitempty"`
	Rows    []Row    `xml:"row,omitempty" json:"row,omitempty"`
}

type Workbook

type Workbook struct {
	XMLName  xml.Name `json:"-"`
	Filename string   `xml:"filename,omitempty" json:"filename,omitempty"`
	Sheets   []Sheet  `xml:"sheets,omitempty" json:"sheets,omitempty"`
}

func New

func New() *Workbook

New creates an empty Workbook object

func NewFromExcelFile

func NewFromExcelFile(xlFile *xlsx.File) (*Workbook, error)

NewFromExcelFile creates a Workbook from an xlsx.File object

func NewFromExcelFilename

func NewFromExcelFilename(fname string) (*Workbook, error)

NewFromExcelFilename creates a Workbook by opening a excel file given a filename

func (*Workbook) String

func (wb *Workbook) String() string

func (*Workbook) ToContainer

func (wb *Workbook) ToContainer() ([]string, error)

Jump to

Keyboard shortcuts

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