dpsh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColumnTypeText     = "text"
	ColumnTypeNumber   = "number" // 符号付き整数
	ColumnTypeDate     = "date"
	ColumnTypeDeadline = "deadline"
	ColumnTypeLog      = "log"
)

Variables

View Source
var (
	ErrorInvalidDate       = errors.New("無効な日付")
	ErrorNoColumnName      = errors.New("カラム名が未指定")
	ErrorNoColumnType      = errors.New("カラム型が未指定")
	ErrorUndefinedColumn   = errors.New("未定義のカラム")
	ErrorUnknownColumnType = errors.New("未知のカラム型")
	ErrorMultipleValue     = errors.New("複数の値")
)

Functions

func DoMain

func DoMain(configpath string)

func LoadAllFiles

func LoadAllFiles(basepath string, paths []string) []*dptxt.Document

func LoadConfig

func LoadConfig(filename string, config *DustpanConfig) error

func LoadFile

func LoadFile(filename string, doc *dptxt.Document) error

func WriteCsv

func WriteCsv(basepath string, config *DustpanConfig, docs []*dptxt.Document) error

func WriteHtml

func WriteHtml(basepath string, config *DustpanConfig, docs []*dptxt.Document) error

Types

type ColumnConfig

type ColumnConfig struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type CsvConfig

type CsvConfig struct {
	DstPath    string `json:"dst"`
	AddHeading bool   `json:"heading"`
}

type DustpanConfig

type DustpanConfig struct {
	SrcPath    []string       `json:"src"`
	Html       HtmlConfig     `json:"html"`
	Csv        CsvConfig      `json:"csv"`
	ColumnDefs []ColumnConfig `json:"columns"`
	SortOrder  []SortConfig   `json:"order"`
}

func (*DustpanConfig) GetColumnDef

func (config *DustpanConfig) GetColumnDef(name string) *ColumnConfig

type HtmlConfig

type HtmlConfig struct {
	DstPath        string   `json:"dst"`
	CssPath        string   `json:"css"`
	JsPath         string   `json:"js"`
	Title          string   `json:"title"`
	DisplayColumns []string `json:"display"`
}

type SortConfig

type SortConfig struct {
	Name       string `json:"name"`
	Descending bool   `json:"descending"` // trueなら降順
}

type ValueError

type ValueError struct {
	Filename string
	Linenum  int
	// contains filtered or unexported fields
}

func NewValueError

func NewValueError(filename string, linenum int, err error) *ValueError

func (*ValueError) Error

func (ve *ValueError) Error() string

func (*ValueError) Unwrap

func (ve *ValueError) Unwrap() error

Jump to

Keyboard shortcuts

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