xlsx

package
v0.0.0-...-aa2b6f1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package xlsx provides standard operations on files with .xlsx format.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPathNotExists is returned when path to a file was not found.
	ErrPathNotExists = errors.New("path to a file does not exists")
	// ErrFileNotExists is returned when file was not found.
	ErrFileNotExists = errors.New("file does not exists")
	// ErrSheetNotExists is returned when sheet was not found.
	ErrSheetNotExists = errors.New("sheet does not exists in a file")
	// ErrRows is returned when rows could not be read.
	ErrRows = errors.New("could not read rows")
)

Functions

func Read

func Read(n string, skip bool) ([][]string, error)

Read retrieves data from the first sheet of file n. If skip is set to true, it skips the first line.

func Write

func Write(n, p, s string, dd [][]string) error

Write creates a file with a given name in a given path and saves passed data in it.

Types

type Error

type Error struct {
	Op   Operation
	File string
	Err  error
}

Error represents an error struct returned by this package.

func (*Error) Error

func (e *Error) Error() string

type Operation

type Operation string

Operation is a type of action which can be performed on a .xlsx file. It is used in error messages.

const (
	// ReadOp is a read operation.
	ReadOp Operation = "read"
	// WriteOp is a write operation.
	WriteOp Operation = "write"
)

Jump to

Keyboard shortcuts

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