Documentation
¶
Overview ¶
Package model contains GraphQL models and helpers for API v2.
Package model contains GraphQL models and helpers for API v2.
Index ¶
- Variables
- type Collection
- type Mutation
- type Notification
- type NotificationType
- func (t *NotificationType) FromCommon(data common.NotificationType)
- func (e NotificationType) IsValid() bool
- func (e NotificationType) MarshalGQL(w io.Writer)
- func (e NotificationType) MarshalJSON() ([]byte, error)
- func (e NotificationType) String() string
- func (e *NotificationType) UnmarshalGQL(v any) error
- func (e *NotificationType) UnmarshalJSON(b []byte) error
- type QRRecord
- type QRRecordData
- type Query
- type Session
- type Subscription
- type Tag
- type TagCategory
- type Tea
- type TeaData
- type TeaOfTheDay
- type Type
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var AllNotificationType = []NotificationType{ NotificationTypeUnknown, NotificationTypeTeaExpiration, NotificationTypeTeaRecommendation, }
View Source
var AllType = []Type{ TypeUnknown, TypeTea, TypeCoffee, TypeHerb, TypeOther, }
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Notification ¶
type Notification struct {
Type NotificationType `json:"type"`
}
type NotificationType ¶
type NotificationType string
const ( NotificationTypeUnknown NotificationType = "unknown" NotificationTypeTeaExpiration NotificationType = "teaExpiration" NotificationTypeTeaRecommendation NotificationType = "teaRecommendation" )
func (*NotificationType) FromCommon ¶
func (t *NotificationType) FromCommon(data common.NotificationType)
FromCommon converts a common.NotificationType to the GraphQL NotificationType.
func (NotificationType) IsValid ¶
func (e NotificationType) IsValid() bool
func (NotificationType) MarshalGQL ¶
func (e NotificationType) MarshalGQL(w io.Writer)
func (NotificationType) MarshalJSON ¶ added in v1.3.0
func (e NotificationType) MarshalJSON() ([]byte, error)
func (NotificationType) String ¶
func (e NotificationType) String() string
func (*NotificationType) UnmarshalGQL ¶
func (e *NotificationType) UnmarshalGQL(v any) error
func (*NotificationType) UnmarshalJSON ¶ added in v1.3.0
func (e *NotificationType) UnmarshalJSON(b []byte) error
type QRRecordData ¶
type Subscription ¶ added in v1.3.0
type Subscription struct {
}
type Tag ¶
type Tag struct {
ID common.ID `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Category *TagCategory `json:"category"`
}
type TagCategory ¶
type Tea ¶
type Tea struct {
ID common.ID `json:"id"`
Name string `json:"name"`
Type Type `json:"type"`
Description string `json:"description"`
Tags []*Tag `json:"tags"`
}
func FromCommonTea ¶
FromCommonTea converts a common.Tea into a GraphQL Tea.
func (*Tea) ToCommonTea ¶
ToCommonTea converts a GraphQL Tea into a common.Tea.
type TeaData ¶
type TeaData struct {
Name string `json:"name"`
Type Type `json:"type"`
Description string `json:"description"`
}
func (*TeaData) ToCommonTeaData ¶
ToCommonTeaData converts GraphQL TeaData into a common.TeaData.
type TeaOfTheDay ¶ added in v1.3.0
type Type ¶
type Type string
func FromBeverageType ¶
func FromBeverageType(bt common.BeverageType) Type
FromBeverageType maps a common.BeverageType to the GraphQL Type.
func (Type) MarshalGQL ¶
func (Type) MarshalJSON ¶ added in v1.3.0
func (Type) ToBeverageType ¶
func (t Type) ToBeverageType() common.BeverageType
ToBeverageType maps GraphQL Type to a common.BeverageType.
func (*Type) UnmarshalGQL ¶
func (*Type) UnmarshalJSON ¶ added in v1.3.0
type User ¶
type User struct {
TokenExpiredAt time.Time `json:"tokenExpiredAt"`
Collections []*Collection `json:"collections"`
Notifications []*Notification `json:"notifications"`
}
Click to show internal directories.
Click to hide internal directories.