Documentation
¶
Index ¶
- func AddListToCollection(collectionId int, listId int) error
- func AdminUserExists() bool
- func CollectionNameTaken(userId int, name string) (bool, error)
- func CreateCollection(userId int, name string, description string) (int, error)
- func CreateItem(item constants.ItemInsert) error
- func CreateList(userId int, name string, description string) (int, error)
- func CreateOIDCUser(email, name, provider, subject, oidcEmail string) (int, error)
- func CreateOrUpdateOIDCUser(email, name, provider, subject, oidcEmail string) (int, error)
- func CreatePasswordResetToken(email string) (string, error)
- func DeleteCollection(collectionId int, confirmationName string) (bool, error)
- func DeleteItem(itemId int) error
- func DeleteList(listId int, confirmationName string) (bool, error)
- func DeleteUser(userId int) error
- func GenerateCollectionShareCode(collectionId int) (string, error)
- func GenerateShareCode(listId int) (string, error)
- func GetAllGroupAdmins() ([]constants.UserRead, error)
- func GetAllUsers() ([]constants.UserRead, error)
- func GetCollection(collectionId int) (constants.Collection, error)
- func GetCollectionFromShareCode(shareCode string) (constants.Collection, error)
- func GetCollectionListIds(collectionId int) ([]uint64, error)
- func GetCollectionLists(collectionId int) ([]constants.ListWithAuthor, error)
- func GetCollections(userId int) ([]constants.Collection, error)
- func GetGroupSharingEnabled(groupId int) (bool, error)
- func GetItem(itemId int) (constants.Item, error)
- func GetList(listId int) (constants.List, error)
- func GetListFromShareCode(shareCode string) (constants.List, error)
- func GetListGroupSharing(listId int) (shareWithGroup bool, groupCanEdit bool, err error)
- func GetListIdsWithShareCode(userId int) ([]uint64, error)
- func GetListItems(listId int) ([]constants.Item, error)
- func GetLists(userId int) ([]constants.List, error)
- func GetListsSharedWithGroup(userId int) ([]constants.ListSharedWithGroup, error)
- func GetNextAvailableGroupId() (int, error)
- func GetUser(userId int) (constants.UserRead, error)
- func GetUserByEmail(email string) (int, error)
- func GetUserByEmailForOIDCLinking(email string) (int, bool, error)
- func GetUserByOIDC(provider, subject string) (int, error)
- func GetUserGroupId(userId int) (int, error)
- func GetUserOIDCInfo(userID int) (string, string, string, error)
- func GetUsersInSameGroupAsUser(userId int) ([]constants.UserRead, error)
- func InvalidatePasswordResetToken(token string) error
- func LinkOIDCToExistingUser(userID int, provider, subject, oidcEmail string) error
- func ListInCollection(collectionId int, listId int) (bool, error)
- func ListNameTaken(userId int, name string) (bool, error)
- func LoginUser(email, password string) (int, error)
- func RegisterUser(user constants.UserRegister) error
- func RemoveListFromCollection(collectionId int, listId int) error
- func SetGroupSharingEnabled(groupId int, enabled bool) error
- func SetListGroupSharing(listId int, shareWithGroup bool, groupCanEdit bool) error
- func SetUserAdmin(userId int, admin bool) error
- func SetUserInstanceAdmin(userId int, instanceAdmin bool) error
- func UnlinkOIDCFromUser(userID int) error
- func UnpublishCollectionShareCode(collectionId int) error
- func UnpublishShareCode(listId int) error
- func UpdateCollection(collectionId int, params constants.CollectionPostParams) error
- func UpdateItem(itemId int, item constants.ItemInsert) error
- func UpdateList(listId int, params constants.ListPostParams) error
- func UpdateUserPassword(email, newPassword string) error
- func UserCanEditList(userId int, listId int) (bool, error)
- func UserCanViewList(userId int, listId int) (bool, error)
- func UserIsAdmin(userId int) (bool, error)
- func UserIsInstanceAdmin(userId int) (bool, error)
- func UserOwnsCollection(userId int, collectionId int) (bool, error)
- func UserOwnsList(userId int, listId int) (bool, error)
- func ValidatePasswordResetToken(token string) (string, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddListToCollection ¶ added in v1.10.0
AddListToCollection adds a list to a collection
func AdminUserExists ¶
func AdminUserExists() bool
func CollectionNameTaken ¶ added in v1.10.0
CollectionNameTaken checks if a collection name already exists for a user
func CreateCollection ¶ added in v1.10.0
CreateCollection creates a new collection for a user
func CreateItem ¶
func CreateItem(item constants.ItemInsert) error
func CreateOIDCUser ¶ added in v1.15.0
CreateOIDCUser creates a new user with OIDC authentication
func CreateOrUpdateOIDCUser ¶ added in v1.15.0
CreateOrUpdateOIDCUser creates a new OIDC user or updates existing one
func CreatePasswordResetToken ¶ added in v1.9.0
CreatePasswordResetToken generates a new reset token for the given email
func DeleteCollection ¶ added in v1.10.0
DeleteCollection deletes a collection after confirming the name matches
func DeleteItem ¶
func DeleteUser ¶ added in v1.7.0
func GenerateCollectionShareCode ¶ added in v1.10.0
GenerateCollectionShareCode generates a unique share code for a collection and ensures all lists within the collection have share codes as well
func GenerateShareCode ¶
func GetAllGroupAdmins ¶ added in v1.8.0
func GetAllUsers ¶
func GetCollection ¶ added in v1.10.0
func GetCollection(collectionId int) (constants.Collection, error)
GetCollection retrieves a collection by its ID
func GetCollectionFromShareCode ¶ added in v1.10.0
func GetCollectionFromShareCode(shareCode string) (constants.Collection, error)
GetCollectionFromShareCode retrieves a collection by its share code
func GetCollectionListIds ¶ added in v1.10.0
GetCollectionListIds retrieves all list ids in a collection
func GetCollectionLists ¶ added in v1.10.0
func GetCollectionLists(collectionId int) ([]constants.ListWithAuthor, error)
GetCollectionLists retrieves all lists in a collection with item counts and author information
func GetCollections ¶ added in v1.10.0
func GetCollections(userId int) ([]constants.Collection, error)
GetCollections retrieves all collections owned by a specific user
func GetGroupSharingEnabled ¶ added in v1.16.0
GetGroupSharingEnabled returns whether group sharing is enabled for a given group
func GetListGroupSharing ¶ added in v1.16.0
GetListGroupSharing returns the group sharing settings for a list
func GetListIdsWithShareCode ¶ added in v1.10.0
GetListIdsWithShareCode retrieves all list IDs for a user that have share codes
func GetListsSharedWithGroup ¶ added in v1.16.0
func GetListsSharedWithGroup(userId int) ([]constants.ListSharedWithGroup, error)
GetListsSharedWithGroup returns all lists shared with a user's group Returns list ID, list name, sharecode, owner user ID, owner name, and whether the group can edit
func GetNextAvailableGroupId ¶ added in v1.8.0
GetNextAvailableGroupId returns the next available group ID (max + 1)
func GetUserByEmail ¶ added in v1.9.0
GetUserByEmail returns the user ID if the email exists, -1 if not found
func GetUserByEmailForOIDCLinking ¶ added in v1.15.0
GetUserByEmailForOIDCLinking retrieves a user by email for OIDC account linking
func GetUserByOIDC ¶ added in v1.15.0
GetUserByOIDC retrieves a user by OIDC provider and subject
func GetUserGroupId ¶ added in v1.7.0
func GetUserOIDCInfo ¶ added in v1.15.0
GetUserOIDCInfo retrieves OIDC information for a user
func GetUsersInSameGroupAsUser ¶ added in v1.7.0
func InvalidatePasswordResetToken ¶ added in v1.9.0
InvalidatePasswordResetToken removes a token from the database
func LinkOIDCToExistingUser ¶ added in v1.15.0
LinkOIDCToExistingUser links OIDC authentication to an existing user account
func ListInCollection ¶ added in v1.10.0
ListInCollection checks if a list is already in a collection
func RegisterUser ¶
func RegisterUser(user constants.UserRegister) error
func RemoveListFromCollection ¶ added in v1.10.0
RemoveListFromCollection removes a list from a collection
func SetGroupSharingEnabled ¶ added in v1.16.0
SetGroupSharingEnabled sets whether group sharing is enabled for a given group
func SetListGroupSharing ¶ added in v1.16.0
SetListGroupSharing sets the group sharing settings for a list
func SetUserAdmin ¶ added in v1.7.0
func SetUserInstanceAdmin ¶ added in v1.8.0
func UnlinkOIDCFromUser ¶ added in v1.15.0
UnlinkOIDCFromUser removes OIDC authentication from a user account
func UnpublishCollectionShareCode ¶ added in v1.10.0
UnpublishCollectionShareCode removes the share code from a collection
func UnpublishShareCode ¶
func UpdateCollection ¶ added in v1.10.0
func UpdateCollection(collectionId int, params constants.CollectionPostParams) error
UpdateCollection updates a collection's details
func UpdateItem ¶
func UpdateItem(itemId int, item constants.ItemInsert) error
func UpdateList ¶
func UpdateList(listId int, params constants.ListPostParams) error
func UpdateUserPassword ¶ added in v1.9.0
UpdateUserPassword updates a user's password given their email
func UserCanEditList ¶ added in v1.16.0
UserCanEditList returns true if the user can edit the list This is true if the user owns the list OR if the list is shared with their group with edit permissions
func UserCanViewList ¶ added in v1.16.0
UserCanViewList returns true if the user can view the list This is true if the user owns the list OR if the list is shared with their group
func UserIsAdmin ¶
func UserIsInstanceAdmin ¶ added in v1.8.0
func UserOwnsCollection ¶ added in v1.10.0
UserOwnsCollection checks if a user owns a specific collection
Types ¶
This section is empty.