db

package
v3.35.3-8Mi Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(dst ...interface{}) error

func BatchCreateSearchNodes

func BatchCreateSearchNodes(nodes *[]model.SearchNode) error

func ClearSearchNodes

func ClearSearchNodes() error

func Close

func Close()

func CreateMeta

func CreateMeta(u *model.Meta) error

func CreateSearchNode

func CreateSearchNode(node *model.SearchNode) error

func CreateStorage

func CreateStorage(storage *model.Storage) error

CreateStorage just insert storage to database

func CreateUser

func CreateUser(u *model.User) error

func DeleteMetaById

func DeleteMetaById(id uint) error

func DeleteSearchNodesByParent

func DeleteSearchNodesByParent(path string) error

func DeleteSettingItemByKey

func DeleteSettingItemByKey(key string) error

func DeleteStorageById

func DeleteStorageById(id uint) error

DeleteStorageById just delete storage from database by id

func DeleteUserById

func DeleteUserById(id uint) error

func GetDb

func GetDb() *gorm.DB

func GetEnabledStorages

func GetEnabledStorages() ([]model.Storage, error)

func GetMetaById

func GetMetaById(id uint) (*model.Meta, error)

func GetMetaByPath

func GetMetaByPath(path string) (*model.Meta, error)

func GetMetas

func GetMetas(pageIndex, pageSize int) (metas []model.Meta, count int64, err error)

func GetPublicSettingItems

func GetPublicSettingItems() ([]model.SettingItem, error)

func GetSearchNodesByParent

func GetSearchNodesByParent(parent string) ([]model.SearchNode, error)

func GetSettingItemByKey

func GetSettingItemByKey(key string) (*model.SettingItem, error)

func GetSettingItems

func GetSettingItems() ([]model.SettingItem, error)

func GetSettingItemsByGroup

func GetSettingItemsByGroup(group int) ([]model.SettingItem, error)

func GetSettingItemsInGroups

func GetSettingItemsInGroups(groups []int) ([]model.SettingItem, error)

func GetStorageById

func GetStorageById(id uint) (*model.Storage, error)

GetStorageById Get Storage by id, used to update storage usually

func GetStorageByMountPath

func GetStorageByMountPath(mountPath string) (*model.Storage, error)

GetStorageByMountPath Get Storage by mountPath, used to update storage usually

func GetStorages

func GetStorages(pageIndex, pageSize int) ([]model.Storage, int64, error)

GetStorages Get all storages from database order by index

func GetUserById

func GetUserById(id uint) (*model.User, error)

func GetUserByName

func GetUserByName(username string) (*model.User, error)

func GetUserByRole

func GetUserByRole(role int) (*model.User, error)

func GetUserBySSOID

func GetUserBySSOID(ssoID string) (*model.User, error)

func GetUsers

func GetUsers(pageIndex, pageSize int) (users []model.User, count int64, err error)

func Init

func Init(d *gorm.DB)

func RegisterAuthn

func RegisterAuthn(u *model.User, credential *webauthn.Credential) error

func RemoveAuthn

func RemoveAuthn(u *model.User, id string) error

func SaveSettingItem

func SaveSettingItem(item *model.SettingItem) error

func SaveSettingItems

func SaveSettingItems(items []model.SettingItem) (err error)

func SearchNode

func SearchNode(req model.SearchReq, useFullText bool) ([]model.SearchNode, int64, error)

func UpdateAuthn

func UpdateAuthn(userID uint, authn string) error

func UpdateMeta

func UpdateMeta(u *model.Meta) error

func UpdateStorage

func UpdateStorage(storage *model.Storage) error

UpdateStorage just update storage in database

func UpdateUser

func UpdateUser(u *model.User) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL