Documentation ¶
Index ¶
- type Avatar
- type AvatarService
- type Chat
- type ChatService
- type Entry
- type EntryServices
- func (es *EntryServices) CreateEntry(user int, typ string, status string, value float64, month, day, year int) error
- func (es *EntryServices) DeleteEntry(id int) error
- func (es *EntryServices) GetAllEntriesByDate(id int, month, day, year int) ([]Entry, error)
- func (es *EntryServices) GetAllEntriesByMonth(id int, month, year int) ([]Entry, error)
- func (es *EntryServices) GetAllEntriesByUser(id int) ([]Entry, error)
- func (es *EntryServices) GetEntryByID(id int) (Entry, error)
- func (es *EntryServices) GetFormattedEntriesByUser(userID int) (string, error)
- type FormattedEntry
- type Profile
- type ProfileService
- func (ps *ProfileService) CreateDefaultProfile(u User) error
- func (ps *ProfileService) GetProfileByUserId(id int) (Profile, error)
- func (ps *ProfileService) UpdateProfile(userid int, height float64, weight float64, dob string, heightunit string, ...) error
- func (ps *ProfileService) UpdateProfileHeight(u int, height int) error
- func (ps *ProfileService) UpdateProfilePicture(u User, pfp string) error
- func (ps *ProfileService) UpdateProfileWeight(u int, weight int) error
- type User
- type UserService
- func (us *UserService) CheckEmail(email string) (User, error)
- func (us *UserService) CheckID(usr int) (User, error)
- func (us *UserService) CheckUsername(usr string) (User, error)
- func (us *UserService) CreateUser(u User) (User, error)
- func (us *UserService) UpdateEmail(email string, id int) error
- func (us *UserService) UpdateUser(email string, username string, id int) error
- func (us *UserService) UpdateUsername(username string, id int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarService ¶
type AvatarService struct { Avatar Avatar AvatarStore database.DatabaseStore }
func NewAvatarService ¶
func NewAvatarService(avatar Avatar, avatarStore database.DatabaseStore) *AvatarService
func (*AvatarService) GenerateGradient ¶
func (as *AvatarService) GenerateGradient(username string) map[string]string
type ChatService ¶
type ChatService struct { Client *genai.Client Context context.Context Chat Chat ChatStore database.DatabaseStore AI *genai.ChatSession }
func NewChatService ¶
func NewChatService(chat Chat, store database.DatabaseStore) (*ChatService, error)
func (*ChatService) GenerateResponse ¶
func (cs *ChatService) GenerateResponse(id int, ud string, profile Profile) error
func (*ChatService) GetAllChatsByUserId ¶
func (cs *ChatService) GetAllChatsByUserId(userid int) ([]Chat, error)
func (*ChatService) NewUserChat ¶
func (cs *ChatService) NewUserChat(userid int, message string) error
type EntryServices ¶
type EntryServices struct { Entry Entry EntryStore database.DatabaseStore }
func NewEntryService ¶
func NewEntryService(entry Entry, store database.DatabaseStore) *EntryServices
func (*EntryServices) CreateEntry ¶
func (*EntryServices) DeleteEntry ¶
func (es *EntryServices) DeleteEntry(id int) error
func (*EntryServices) GetAllEntriesByDate ¶
func (es *EntryServices) GetAllEntriesByDate(id int, month, day, year int) ([]Entry, error)
func (*EntryServices) GetAllEntriesByMonth ¶
func (es *EntryServices) GetAllEntriesByMonth(id int, month, year int) ([]Entry, error)
func (*EntryServices) GetAllEntriesByUser ¶
func (es *EntryServices) GetAllEntriesByUser(id int) ([]Entry, error)
func (*EntryServices) GetEntryByID ¶
func (es *EntryServices) GetEntryByID(id int) (Entry, error)
func (*EntryServices) GetFormattedEntriesByUser ¶
func (es *EntryServices) GetFormattedEntriesByUser(userID int) (string, error)
type FormattedEntry ¶
type Profile ¶
type Profile struct { ID int `json:"id"` Level int `json:"level"` ProfilePicture string `json:"profile_picture"` Weight float64 `json:"weight"` Height float64 `json:"height"` Birthday string `json:"birthday"` Streak int `json:"streak"` Bio string `json:"bio"` HeightUnit string `json:"height_unit"` WeightUnit string `json:"weight_unit"` ProfileOf int `json:"profile_of"` }
type ProfileService ¶
type ProfileService struct { Profile Profile ProfileStore database.DatabaseStore }
func NewProfileService ¶
func NewProfileService(profile Profile, profileStore database.DatabaseStore) *ProfileService
func (*ProfileService) CreateDefaultProfile ¶
func (ps *ProfileService) CreateDefaultProfile(u User) error
func (*ProfileService) GetProfileByUserId ¶
func (ps *ProfileService) GetProfileByUserId(id int) (Profile, error)
func (*ProfileService) UpdateProfile ¶
func (*ProfileService) UpdateProfileHeight ¶
func (ps *ProfileService) UpdateProfileHeight(u int, height int) error
func (*ProfileService) UpdateProfilePicture ¶
func (ps *ProfileService) UpdateProfilePicture(u User, pfp string) error
func (*ProfileService) UpdateProfileWeight ¶
func (ps *ProfileService) UpdateProfileWeight(u int, weight int) error
type UserService ¶
type UserService struct { User User UserStore database.DatabaseStore }
func NewUserService ¶
func NewUserService(user User, userStore database.DatabaseStore) *UserService
func (*UserService) CheckEmail ¶
func (us *UserService) CheckEmail(email string) (User, error)
func (*UserService) CheckUsername ¶
func (us *UserService) CheckUsername(usr string) (User, error)
func (*UserService) CreateUser ¶
func (us *UserService) CreateUser(u User) (User, error)
func (*UserService) UpdateEmail ¶
func (us *UserService) UpdateEmail(email string, id int) error
func (*UserService) UpdateUser ¶
func (us *UserService) UpdateUser(email string, username string, id int) error
func (*UserService) UpdateUsername ¶
func (us *UserService) UpdateUsername(username string, id int) error
Click to show internal directories.
Click to hide internal directories.