pet

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: Artistic-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PetName                       petValidKey = "name"
	PetLatestInteractionTimestamp petValidKey = "latestinteractiontime"
	PetHunger                     petValidKey = "hunger"
	PetSickness                   petValidKey = "sickness"
	SlackWebhook                  petValidKey = "slackwebhooj"
)
View Source
const (
	SECOND = 1
	MINUTE = 60 * SECOND
	HOUR   = MINUTE * 60
	DAY    = HOUR * 24
	WEEK   = DAY * 7
)
View Source
const STARVATION = 24 * 2

Variables

View Source
var SayContent string = ""

Functions

func GetCurrentUnixTimestampString

func GetCurrentUnixTimestampString() string

func GetK

func GetK(key petValidKey) (string, error)

func GetKNoUpdate

func GetKNoUpdate(key petValidKey) (string, error)

func GetName

func GetName() (name string, err error)

func ParseWithC

func ParseWithC(text string, v ...any) (string, error)

func Say

func Say(text string, v ...any)

Adds each say to a bucket of say things to print with sayln on exit

func Sayln

func Sayln(text string, v ...any) error

func SetK

func SetK[T string | int](key petValidKey, val T) error

func UpdateHunger

func UpdateHunger() error

func UpdateLatestInteractionTime

func UpdateLatestInteractionTime() error

func YellowLn

func YellowLn(text string, v ...any)

Types

type PetData

type PetData struct {
	Name                       string
	LatestInteractionTimestamp string
	Hunger                     int
	Sickness                   string
	SlackWebhook               string
}

func GetPet

func GetPet() (pd PetData, err error)

func (PetData) Save

func (p PetData) Save() error

func (*PetData) UpdateLatestInteractionTime

func (p *PetData) UpdateLatestInteractionTime()

Jump to

Keyboard shortcuts

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