data

package
v0.0.0-...-80d3fd2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

type Day struct {
	Date       time.Time
	WhyID      uint
	Why        Why
	Enough     bool
	Reflection string
}

type Intention

type Intention struct {
	ID   uint
	Date time.Time

	Content   string
	Done      bool
	Cancelled bool

	Outcome bool
	// True for outcomes added at the end of the day
	Unintended bool

	// To keep track of where the intention is on the list relative to others
	Position int

	Pomos int

	Whys []*Why `gorm:"many2many:whys_intentions;"`
}

type Store

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

func NewStore

func NewStore() Store

func (*Store) DeleteWhys

func (s *Store) DeleteWhys(whys []Why) error

func (*Store) GetDaysIntentions

func (s *Store) GetDaysIntentions(day time.Time) ([]Intention, error)

func (*Store) GetWhys

func (s *Store) GetWhys(status WhyStatusEnum) ([]Why, error)

func (*Store) UpsertDayReview

func (s *Store) UpsertDayReview(days []Day) error

func (*Store) UpsertIntentions

func (s *Store) UpsertIntentions(items []Intention) error

func (*Store) UpsertWhys

func (s *Store) UpsertWhys(items []Why) error

type Why

type Why struct {
	ID        uint
	CreatedAt time.Time

	Name        string
	Description string

	Number   int
	Color    lipgloss.Color
	Archived bool

	Intentions []*Intention `gorm:"many2many:whys_intentions;"`
}

func (Why) TableName

func (Why) TableName() string

TableName overrides the gorm table name used by Why to "whys"

type WhyStatusEnum

type WhyStatusEnum int
const (
	Active WhyStatusEnum = iota
	Archived
	All
)

Jump to

Keyboard shortcuts

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