export

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVFormatter

type CSVFormatter struct{}

func (*CSVFormatter) Format added in v0.2.0

func (f *CSVFormatter) Format(lists []model.List, tasks []model.Task) (map[string][]byte, error)

type ExportData added in v0.2.0

type ExportData struct {
	Lists []ExportList `json:"lists" yaml:"lists" toml:"lists"`
	Tasks []ExportTask `json:"tasks" yaml:"tasks" toml:"tasks"`
}

type ExportList added in v0.2.0

type ExportList struct {
	Name  string `json:"Name" yaml:"Name" toml:"Name"`
	Color string `json:"Color" yaml:"Color" toml:"Color"`
}

type ExportTask added in v0.2.0

type ExportTask struct {
	Title       string     `json:"Title" yaml:"Title" toml:"Title"`
	Description *string    `json:"Description,omitempty" yaml:"Description,omitempty" toml:"Description,omitempty"`
	ListName    string     `json:"ListName" yaml:"ListName" toml:"ListName"`
	Priority    *string    `json:"Priority,omitempty" yaml:"Priority,omitempty" toml:"Priority,omitempty"`
	Deadline    *time.Time `json:"Deadline,omitempty" yaml:"Deadline,omitempty" toml:"Deadline,omitempty"`
	Status      bool       `json:"Status" yaml:"Status" toml:"Status"`
	CompletedAt *time.Time `json:"CompletedAt,omitempty" yaml:"CompletedAt,omitempty" toml:"CompletedAt,omitempty"`
	CreatedAt   time.Time  `json:"CreatedAt" yaml:"CreatedAt" toml:"CreatedAt"`
	UpdatedAt   *time.Time `json:"UpdatedAt,omitempty" yaml:"UpdatedAt,omitempty" toml:"UpdatedAt,omitempty"`
}

type Formatter

type Formatter interface {
	Format(lists []model.List, tasks []model.Task) (map[string][]byte, error)
}

func GetFormatter

func GetFormatter(format string) (Formatter, error)

type ImportResult added in v0.2.0

type ImportResult struct {
	ListsCreated  int
	ListsMerged   int
	TasksImported int
	TasksSkipped  []SkippedTask
}

func Import added in v0.2.0

func Import(database *sql.DB, format string, data []byte) (*ImportResult, error)

func ImportCSV added in v0.2.0

func ImportCSV(database *sql.DB, tasksData, listsData []byte) (*ImportResult, error)

For CLI CSV import where we have separate buffers

type JSONFormatter

type JSONFormatter struct{}

func (*JSONFormatter) Format added in v0.2.0

func (f *JSONFormatter) Format(lists []model.List, tasks []model.Task) (map[string][]byte, error)

type SkippedTask added in v0.2.0

type SkippedTask struct {
	Title  string
	Reason string
}

type TOMLFormatter

type TOMLFormatter struct{}

func (*TOMLFormatter) Format added in v0.2.0

func (f *TOMLFormatter) Format(lists []model.List, tasks []model.Task) (map[string][]byte, error)

type YAMLFormatter

type YAMLFormatter struct{}

func (*YAMLFormatter) Format added in v0.2.0

func (f *YAMLFormatter) Format(lists []model.List, tasks []model.Task) (map[string][]byte, error)

Jump to

Keyboard shortcuts

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