app

package
v0.0.0-...-2885a4d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHabitsToDB

func AddHabitsToDB(ctx context.Context, habitRepo iface.HabitRepo, reminderRepo iface.ReminderRepo, userID int64, config Config, l *slog.Logger) error

func ParseYAMLConfigToDB

func ParseYAMLConfigToDB(ctx context.Context, cfg config.Config, userID int64, filePath string, l *slog.Logger) error

Types

type Bot

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

func NewBot

func NewBot(cfg config.Config, logger *slog.Logger, handler handler) *Bot

func (*Bot) Run

func (b *Bot) Run(ctx context.Context) error

type Config

type Config struct {
	Habits []HabitConfig `yaml:"habits"`
}

type HabitConfig

type HabitConfig struct {
	Name           string   `yaml:"name"`
	Type           string   `yaml:"type"`
	Target         int64    `yaml:"target"`
	TargetTime     string   `yaml:"target_time"`
	MaxTime        string   `yaml:"max_time"`
	TargetDuration string   `yaml:"target_duration"`
	Points         int64    `yaml:"points"`
	PointsMode     string   `yaml:"points_mode"`
	Unit           string   `yaml:"unit"`
	IntervalDays   int64    `yaml:"interval_days"`
	Tasks          []string `yaml:"tasks"`
	Options        []string `yaml:"options"`
	Reminder       struct {
		Time string   `yaml:"time"`
		Days []string `yaml:"days"`
	} `yaml:"reminder"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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