db

package
v3.34.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 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 added in v3.6.0

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

func BatchCreateSearchNodes added in v3.6.0

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

func ClearSearchNodes added in v3.6.0

func ClearSearchNodes() error

func Close added in v3.28.0

func Close()

func CreateMeta

func CreateMeta(u *model.Meta) error

func CreateSearchNode added in v3.6.0

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 added in v3.6.0

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 added in v3.9.0

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 added in v3.6.0

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 added in v3.13.2

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 added in v3.7.1

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

func GetUserBySSOID added in v3.13.0

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 added in v3.26.0

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

func RemoveAuthn added in v3.26.0

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 added in v3.6.0

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

func UpdateAuthn added in v3.26.0

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