app

package
v0.0.0-...-d6dd280 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DayLayout = "02/01/2006"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(repo Repo, userID int64, apiSecret string) *App

func (*App) Auth

func (a *App) Auth(userID int64) bool

func (*App) CheckSettings

func (a *App) CheckSettings() (isUserID, isSheet, isSecret bool)

func (*App) SetValue

func (a *App) SetValue(day time.Time, category string, val bool) error

func (*App) Shedule

func (a *App) Shedule(tgAsk func(user int64, category string, day time.Time)) error

type Appl

type Appl interface {
	Auth(userID int64) bool
	CheckSettings() (isUserID, isSheet, isSecret bool)
	SetValue(day time.Time, category string, vval bool) error
	Shedule(tgAsk func(user int64, category string, day time.Time)) error
}

type Repo

type Repo interface {
	Columns() ([]string, error)
	GetLastDay() (time.Time, error)
	AddNewDay(day time.Time) error
	SetValue(day time.Time, column string, value bool) error
}

type Telegram

type Telegram interface {
	Start()
	ProcessUpdate(u tb.Update)
	Ask(user int64, category string, day time.Time)
}

Jump to

Keyboard shortcuts

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