Documentation ¶
Index ¶
- func IsValidEmail(email string) bool
- func MatchesHash(password, hash string) bool
- type AuthCredentials
- type AuthRepository
- type AuthService
- type Character
- type CharacterRepository
- type DailyQuest
- type DailyQuestRepository
- type Item
- type ItemRepository
- type Quiz
- type QuizRepository
- type Reward
- type RewardRepository
- type Task
- type TaskRepository
- type User
- type UserKid
- type UserKidRepository
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthCredentials ¶
type AuthRepository ¶
type AuthService ¶
type Character ¶
type Character struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` Name string `json:"name" gorm:"type:varchar(255)"` Description string `json:"description" gorm:"type:text"` FruitMultipliers utils.JSONMap `json:"fruit_multipliers" gorm:"type:jsonb"` // JSONB for PostgreSQL LevelImages utils.JSONMap `json:"level_images" gorm:"type:jsonb"` // JSONB for PostgreSQL CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type CharacterRepository ¶
type CharacterRepository interface { GetMany(ctx context.Context) ([]*Character, error) GetOne(ctx context.Context, characterId uuid.UUID) (*Character, error) CreateOne(ctx context.Context, character *Character) (*Character, error) UpdateOne(ctx context.Context, characterId uuid.UUID, updateData map[string]interface{}) (*Character, error) DeleteOne(ctx context.Context, characterId uuid.UUID) error }
type DailyQuest ¶
type DailyQuest struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` RewardID uuid.UUID `json:"rewardId" gorm:"type:uuid;not null;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;references:ID"` Name string `json:"name" gorm:"type:text; not null"` Description string `json:"description" gorm:"type:text"` Requirements utils.NestedJSONMap `json:"requirements" gorm:"type:jsonb; not null"` Type string `json:"type" gorm:"type:text"` QuestDate string `json:"quest_date" gorm:"type:text"` Reward Reward `gorm:"foreignKey:RewardID;references:ID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type DailyQuestRepository ¶
type DailyQuestRepository interface { GetMany(ctx context.Context) ([]*DailyQuest, error) GetOne(ctx context.Context, dailyQuestId uuid.UUID) (*DailyQuest, error) CreateOne(ctx context.Context, dailyQuest *DailyQuest) (*DailyQuest, error) UpdateOne(ctx context.Context, dailyQuestId uuid.UUID, updateData map[string]interface{}) (*DailyQuest, error) DeleteOne(ctx context.Context, dailyQuestId uuid.UUID) error GetByDate(ctx context.Context, questDate string) ([]*DailyQuest, error) }
type Item ¶
type Item struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` Name string `json:"name" gorm:"type:varchar(255)"` Description string `json:"description" gorm:"type:text"` ItemType string `json:"item_type" gorm:"type:text"` UnlockConditions utils.JSONMap `json:"unlock_conditions" gorm:"type:jsonb"` LevelImages utils.JSONMap `json:"level_images" gorm:"type:jsonb"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ItemRepository ¶
type Quiz ¶
type Quiz struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` Title string `json:"title" gorm:"type:text"` Description string `json:"description" gorm:"type:text"` Content utils.NestedJSONMap `json:"content" gorm:"type:jsonb"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type QuizRepository ¶
type QuizRepository interface { GetMany(ctx context.Context) ([]*Quiz, error) GetOne(ctx context.Context, quizId uuid.UUID) (*Quiz, error) CreateOne(ctx context.Context, quiz *Quiz) (*Quiz, error) UpdateOne(ctx context.Context, quizId uuid.UUID, updateData map[string]interface{}) (*Quiz, error) DeleteOne(ctx context.Context, quizId uuid.UUID) error }
type Reward ¶
type Reward struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` Name string `json:"name" gorm:"type:text; not null"` Description string `json:"description" gorm:"type:text; not null"` Type string `json:"type" gorm:"type:text; not null"` Details utils.NestedJSONMap `json:"details" gorm:"type:jsonb"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type RewardRepository ¶
type RewardRepository interface { GetMany(ctx context.Context) ([]*Reward, error) GetOne(ctx context.Context, rewardId uuid.UUID) (*Reward, error) CreateOne(ctx context.Context, reward *Reward) (*Reward, error) UpdateOne(ctx context.Context, rewardId uuid.UUID, updateData map[string]interface{}) (*Reward, error) DeleteOne(ctx context.Context, rewardId uuid.UUID) error }
type Task ¶
type Task struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` RewardID uuid.UUID `json:"rewardId" gorm:"type:uuid;not null;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;references:ID"` Name string `json:"name" gorm:"type:text; not null"` Description string `json:"description" gorm:"type:text"` Requirements utils.NestedJSONMap `json:"requirements" gorm:"type:jsonb; not null"` Type string `json:"type" gorm:"type:text"` Reward Reward `gorm:"foreignKey:RewardID;references:ID"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type TaskRepository ¶
type TaskRepository interface { GetMany(ctx context.Context) ([]*Task, error) GetOne(ctx context.Context, taskId uuid.UUID) (*Task, error) CreateOne(ctx context.Context, task *Task) (*Task, error) UpdateOne(ctx context.Context, taskId uuid.UUID, updateData map[string]interface{}) (*Task, error) DeleteOne(ctx context.Context, taskId uuid.UUID) error }
type User ¶
type User struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` Username string `json:"username" gorm:"unique; not null"` Email string `json:"email" gorm:"unique"` Name string `json:"name" gorm:"not null"` Role UserRole `json:"role" gorm:"text;default:player"` Password string `json:"-"` // Do not compute the password in json CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type UserKid ¶
type UserKid struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"` UserID uuid.UUID `json:"userId" gorm:"type:uuid;not null;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;references:ID"` // Kid's user ID ParentID uuid.UUID `json:"parentId" gorm:"type:uuid;not null;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;references:ID"` // Parent's user ID CurrentFruitStats utils.JSONMap `json:"current_fruit_stats" gorm:"type:jsonb"` BibleProgress utils.JSONMap `json:"bible_progress" gorm:"type:jsonb"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` User User `gorm:"foreignKey:UserID;references:ID"` // Establish relation to User for UserID Parent User `gorm:"foreignKey:ParentID;references:ID"` // Establish relation to User for ParentID }
type UserKidRepository ¶
type UserKidRepository interface { GetAllParentKids(ctx context.Context, parentId uuid.UUID) ([]*UserKid, error) GetOne(ctx context.Context, userKidId uuid.UUID) (*UserKid, error) CreateOne(ctx context.Context, userKid *UserKid) (*UserKid, error) UpdateOne(ctx context.Context, userKidId uuid.UUID, updateData map[string]interface{}) (*UserKid, error) DeleteOne(ctx context.Context, userKidId uuid.UUID) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.