Documentation
¶
Index ¶
- type Account
- type Calendar
- type Database
- func (data Database) AddAccount(user *User, account Account) (id int, err error)
- func (data Database) AddCalendarsRelation(user *User, parentCalendarUUID string, calendarIDs []string) (err error)
- func (data Database) AddCalendarsToAccount(user *User, account Account, values []string) (err error)
- func (data Database) Close() error
- func (data Database) DeleteCalendar(user *User, id string) (err error)
- func (data Database) FindAccount(user *User, ID int) (account Account, err error)
- func (data Database) FindCalendars(account *Account) (err error)
- func (data Database) FindOrCreateUser(user *User) (err error)
- func (data Database) RetrieveUser(uuid string) (user *User, err error)
- func (data Database) SetUserAccounts(user *User) (err error)
- func (data Database) UpdateCalendar(user *User, calendarID string, parentID string) (err error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// User that account belongs to
User *User
// TokenType of the account
TokenType string
// Refresh token of the account
RefreshToken string
// Email associated to the account
Email string
// Kind of the account
Kind int
// AccessToken of the account
AccessToken string
// InternalID of the account
ID int
// Whether if the account is the principal one
Principal bool
// List of all calendars associated to the account on DB
Calendars []Calendar
}
Account mapped from db
type Calendar ¶
type Calendar struct {
// UUID of the calendar
UUID uuid.UUID
// Email associated to the account
AccountEmail string
// Account which the calendar belongs to
Account Account
// Name of the calendar
Name string
// ID of the calendar
ID string
// Parent calendar of the calendar
ParentUUID uuid.UUID
// Subscription uuid of the calendar
SubscriptionUUID uuid.UUID
// List of calendars that are related to this one
Calendars []Calendar
}
Calendar mapped from db
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database object for the frontend
func (Database) AddAccount ¶
Method that saves an account to the user on db
func (Database) AddCalendarsRelation ¶
func (data Database) AddCalendarsRelation(user *User, parentCalendarUUID string, calendarIDs []string) (err error)
Method that creates the relations between calendars
func (Database) AddCalendarsToAccount ¶
func (data Database) AddCalendarsToAccount(user *User, account Account, values []string) (err error)
Method that saves calendars to an account
func (Database) DeleteCalendar ¶
Method that removes a calendar from the db
func (Database) FindAccount ¶
Method that finds an account by its id that belongs to a user
func (Database) FindCalendars ¶
Gets calendars from an account
func (Database) FindOrCreateUser ¶
Method that finds an user or creates one if it is not stored
func (Database) RetrieveUser ¶
Method that retrieves the user from the db
func (Database) SetUserAccounts ¶
Method that retrieves all accounts of the user
Click to show internal directories.
Click to hide internal directories.