common

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCollectionNotFound = errors.New("collection not found")
	ErrUserNotFound       = errors.New("user not found")
	ErrExpiredToken       = errors.New("token already expired")
	ErrInvalidToken       = errors.New("token invalid")
	ErrQRRecordNotExist   = errors.New("qr record not exist")
	ErrJwtIncorrect       = errors.New("invalid jwt")
	ErrDeviceNotFound     = errors.New("device not found")
)
View Source
var BeverageTypeStringMap = map[BeverageType]string{
	TeaBeverageType:    "tea",
	HerbBeverageType:   "herb",
	CoffeeBeverageType: "coffee",
	OtherBeverageType:  "other",
}

Functions

This section is empty.

Types

type BeverageType

type BeverageType int
const (
	TeaBeverageType BeverageType = iota
	HerbBeverageType
	CoffeeBeverageType
	OtherBeverageType
)

func StringToBeverageType

func StringToBeverageType(str string) BeverageType

func (BeverageType) String

func (b BeverageType) String() string

type Collection

type Collection struct {
	ID   uuid.UUID
	Name string
}

type CollectionRecord

type CollectionRecord struct {
	ID             uuid.UUID
	Tea            *Tea
	BowlingTemp    int
	ExpirationDate time.Time
}

type Device

type Device struct {
	UserID uuid.UUID
	Token  string
}

type Notification

type Notification struct {
	UserID uuid.UUID
	Type   NotificationType
}

type NotificationType

type NotificationType int
const (
	NotificationTypeTeaExpiration NotificationType = iota
	NotificationTypeTeaRecommendation
)

type QR

type QR struct {
	Tea            uuid.UUID
	BowlingTemp    int
	ExpirationDate time.Time
}

type Rain

type Rain float64

func (Rain) String

func (r Rain) String() string

type Session

type Session struct {
	JWT       string
	User      *User
	ExpiredAt time.Time
}

type Tag

type Tag struct {
	ID uuid.UUID
	*TagData
}

type TagCategory

type TagCategory struct {
	ID   uuid.UUID
	Name string
}

type TagData

type TagData struct {
	Name       string
	Color      string
	CategoryID uuid.UUID
}

type Tea

type Tea struct {
	ID uuid.UUID
	*TeaData
}

type TeaData

type TeaData struct {
	Name        string       `json:"name"`
	Type        BeverageType `json:"type"`
	Description string       `json:"description"`
}

type User

type User struct {
	ID      uuid.UUID
	AppleID string
	Session
}

type Weather

type Weather struct {
	Temperature float64
	Clouds      int
	Rain        Rain
	Humidity    int
	WindSpeed   float64
	Visibility  int
}

func (Weather) String

func (w Weather) String() string

Directories

Path Synopsis
key_value

Jump to

Keyboard shortcuts

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