io

package
v0.0.0-...-c64de18 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotExist

func IsNotExist(path string) bool

func Mkdir

func Mkdir(filePath string) error

func OpenFile

func OpenFile(filePath string, permType PermType) (*os.File, error)

func ReadCsv

func ReadCsv(filePath string, skipHeader bool) ([][]string, error)

func ReadExcel

func ReadExcel(filePath string, sheetName string) (content [][]string, err error)

func ReadFile

func ReadFile(filePath string) (ret []string, err error)

func ReadJson

func ReadJson(filePath string) (map[string]interface{}, error)

func UpdateExcel

func UpdateExcel(fileName, sheetName string, area Area, calAreas []Area, processor func(in [][][]string) string) error

func WriteCsv

func WriteCsv(filePath string, records [][]string, append bool) error

func WriteExcel

func WriteExcel(filePath string, content [][]string) error

func WriteFile

func WriteFile(filePath string, content []string) (err error)

func WriteJson

func WriteJson(filePath string, m map[string]interface{}) error

Types

type Absolute

type Absolute int

func (Absolute) Get

func (a Absolute) Get(_ int) int

type Area

type Area struct {
	// contains filtered or unexported fields
}

func (Area) GetBoundary

func (a Area) GetBoundary(relative string) (left, right, up, bottom int, err error)

func (Area) ToCellNameArray

func (a Area) ToCellNameArray(relative string) [][]string

func (Area) ToCellNameList

func (a Area) ToCellNameList(relative string) []string

type Coordinate

type Coordinate struct {
	// contains filtered or unexported fields
}

func (Coordinate) GetCellName

func (c Coordinate) GetCellName(relative string) string

type PermType

type PermType int
const (
	READ PermType = iota
	WRITE
	REWRITE
	APPEND
)

type Relative

type Relative int

func (Relative) Get

func (r Relative) Get(relative int) int

type Value

type Value interface {
	Get(int) int
}

Jump to

Keyboard shortcuts

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