tdtg

package
v0.0.0-...-3649715 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(dbPath string) (*DB, error)

type ToDoItem

type ToDoItem struct {
	Text        string    `json:"text"`
	Description string    `json:"description,omitempty"`
	AddedAt     time.Time `json:"addedAt"`
	AddedBy     string    `json:"addedBy"`
	Completed   bool      `json:"completed"`
	CompletedAt time.Time `json:"completedAt,omitempty"`
	CompletedBy string    `json:"completedBy,omitempty"`
}

func NewToDoItem

func NewToDoItem(txt, desc, addBy string) (*ToDoItem, error)

type ToDoList

type ToDoList struct {
	ID        string      `json:"id"`
	Title     string      `json:"title"`
	CreatedBy string      `json:"createdBy"`
	CreatedAt time.Time   `json:"createdAt"`
	Items     []*ToDoItem `json:"items"`
}

func NewToDoList

func NewToDoList(title, createdBy string) (*ToDoList, error)

func (*ToDoList) Validate

func (l *ToDoList) Validate() error

type User

type User struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	PassHash string `json:"passHash"`
}

func NewUser

func NewUser(name, rawPass string) (*User, error)

func (*User) Validate

func (u *User) Validate() error

Jump to

Keyboard shortcuts

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