api

package
v0.0.0-...-3434b8a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Happy  Mood = "Happy"
	Normal Mood = "Normal"
	Sad    Mood = "Sad"

	Week MoodTimeRange = iota
	Month
	Year
	All
)

Variables

View Source
var (
	UserSettingLocaleValue   = []string{"en", "es", "hi"}
	UserSettingThemeValue    = []string{"system", "light", "dark"}
	UserSettingMoodViewValue = []string{"list", "grid"}
)

Functions

This section is empty.

Types

type CreateMood

type CreateMood struct {
	ID          int       `json:"id"`
	Mood        Mood      `json:"mood"`
	UserId      int       `json:"user_id"`
	Description string    `json:"description"`
	Date        time.Time `json:"date"`
}

type FindMood

type FindMood struct {
	Mood      Mood
	TimeRange MoodTimeRange
	UserId    *int
}

type FindUser

type FindUser struct {
	ID          *int
	UserName    *string
	DisplayName *string
	Email       *string
}

type Mood

type Mood string

func (Mood) String

func (m Mood) String() string

func (Mood) Validate

func (m Mood) Validate() error

type MoodTimeRange

type MoodTimeRange int

func ParseMoodTimeRange

func ParseMoodTimeRange(s string) MoodTimeRange

type PatchUserRequest

type PatchUserRequest struct {
	Username    *string `json:"username"`
	UpdatedAt   *int64  `json:"updated_at"`
	DisplayName *string `json:"display_name"`
	Email       *string `json:"email"`
	AvatarURL   *string `json:"avatar_url"`
}

func (*PatchUserRequest) UpdateUser

func (p *PatchUserRequest) UpdateUser(userId *int) *UpdateUser

func (*PatchUserRequest) Validate

func (p *PatchUserRequest) Validate() error

type SignIn

type SignIn struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SignUp

type SignUp struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UpdateUser

type UpdateUser struct {
	ID          *int
	Username    *string
	UpdatedAt   *int64
	DisplayName *string
	Email       *string
	AvatarURL   *string
}

type UpsertUserSetting

type UpsertUserSetting struct {
	UserId       int            `json:"_"`
	SettingKey   UserSettingKey `json:"setting_key"`
	SettingValue string         `json:"setting_value"`
}

func (*UpsertUserSetting) Validate

func (u *UpsertUserSetting) Validate() error

type User

type User struct {
	ID           int    `json:"id"`
	CreatedAt    int64  `json:"created_at"`
	UpdatedAt    int64  `json:"updated_at"`
	Username     string `json:"username"`
	DisplayName  string `json:"display_name"`
	Email        string `json:"email"`
	PasswordHash string `json:"-"`
	AvatarURL    string `json:"avatar_url"`
}

type UserSetting

type UserSetting struct {
	UserId       int    `json:"user_id"`
	SettingKey   string `json:"setting_key"`
	SettingValue string `json:"setting_value"`
}

type UserSettingKey

type UserSettingKey string
const (
	UserSettingLocaleKey   UserSettingKey = "locale"
	UserSettingThemeKey    UserSettingKey = "theme"
	UserSettingMoodViewKey UserSettingKey = "mood_view"
)

func (UserSettingKey) String

func (k UserSettingKey) String() string

Jump to

Keyboard shortcuts

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