Documentation ¶
Index ¶
- func AccInfo(ctx context.Context) map[string]interface{}
- func DeleteAccount(ctx context.Context) map[string]interface{}
- func DeleteAllNotes(ctx context.Context) map[string]interface{}
- func DeleteNote(ctx context.Context, noteID uint) map[string]interface{}
- func GetDB() *gorm.DB
- func ListNotes(ctx context.Context) map[string]interface{}
- func Login(email, pass string) map[string]interface{}
- func LoginUsername(username, pass string) map[string]interface{}
- func ModifyPassword(ctx context.Context, password string) map[string]interface{}
- func ModifyUsername(ctx context.Context, username string) map[string]interface{}
- func SaveAccImage(ctx context.Context, imageURL string) map[string]interface{}
- func Stats() map[string]interface{}
- type Account
- type Notes
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAccount ¶
DeleteAccount delete an existing account
func DeleteAllNotes ¶
DeleteAllNotes Deletes all notes belonging to a user
func DeleteNote ¶
DeleteNote Delete a single note belonging to a user
func LoginUsername ¶
LoginUsername login with a username instead of an email address
func ModifyPassword ¶
ModifyPassword modify the password for an already existing account
func ModifyUsername ¶
ModifyUsername modify the username for an already existing account
func SaveAccImage ¶
SaveAccImage save the image url for the account profile picture
Types ¶
type Account ¶
type Account struct { gorm.Model Email string `json:"email"` Username string `json:"username"` Password string `json:"password"` Token string `gorm:"-" json:"token"` ImageURL string `json:"image_url"` Notes []Notes `gorm:"foreignkey:AccountID" json:"-"` }
Account Represents a user account
type Notes ¶
type Notes struct { NoteID uint `gorm:"primary_key" json:"note_id"` AccountID uint `gorm:"column:account_id" json:"id"` Title string `json:"title"` Content string `json:"content"` ImageURL string `json:"image_url"` ListParseString string `json:"list_parse_string"` Reminders string `json:"reminders"` Date time.Time `json:"date"` Color int `json:"color"` HideContent bool `json:"hide_content"` IsDeleted bool `json:"is_deleted"` IsArchived bool `json:"is_archived"` IsList bool `json:"is_list"` IsStarred bool `json:"is_starred"` Pin string `json:"pin"` Password string `json:"password"` }
Notes Represents a note in the database
Click to show internal directories.
Click to hide internal directories.