goal

package
v0.4.21 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 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 Goal

type Goal struct {
	ID          string     `json:"id"`
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Status      Status     `json:"status"`
	Progress    int        `json:"progress"` // 0-100
	SessionIDs  []string   `json:"session_ids"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	CompletedAt *time.Time `json:"completed_at,omitempty"`
}

Goal represents a user goal

type Manager

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

Manager manages goals

func NewManager

func NewManager(dir string) (*Manager, error)

NewManager creates a new goal manager

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, title, description string) (*Goal, error)

Create creates a new goal

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context, id string) error

Delete deletes a goal

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, id string) (*Goal, error)

Get gets a goal by ID

func (*Manager) GetGoalsBySession

func (m *Manager) GetGoalsBySession(ctx context.Context, sessionID string) ([]*Goal, error)

GetGoalsBySession gets all goals linked to a session

func (*Manager) LinkSession

func (m *Manager) LinkSession(ctx context.Context, goalID, sessionID string) error

LinkSession links a session to a goal

func (*Manager) List

func (m *Manager) List(ctx context.Context, status Status) ([]*Goal, error)

List lists all goals

func (*Manager) UnlinkSession

func (m *Manager) UnlinkSession(ctx context.Context, goalID, sessionID string) error

UnlinkSession unlinks a session from a goal

func (*Manager) Update

func (m *Manager) Update(ctx context.Context, id string, updates map[string]interface{}) (*Goal, error)

Update updates a goal

type Status

type Status string

Status represents goal status

const (
	StatusActive    Status = "active"
	StatusCompleted Status = "completed"
	StatusAbandoned Status = "abandoned"
)

Jump to

Keyboard shortcuts

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