dao

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(driver, dsn string) error

func Ready

func Ready() bool

func Transaction

func Transaction(fc func(tx *gorm.DB) error) error

Types

type Matter

type Matter struct {
}

func NewMatter

func NewMatter() *Matter

func (*Matter) Copy

func (ms *Matter) Copy(alias, parent string) error

func (*Matter) Create

func (ms *Matter) Create(matter *model.Matter) error

func (*Matter) Exist

func (ms *Matter) Exist(uid int64, name, parent string) (*model.Matter, bool)

func (*Matter) Find

func (ms *Matter) Find(alias string) (*model.Matter, error)

func (*Matter) FindAll

func (ms *Matter) FindAll(query *Query) (list []model.Matter, total int64, err error)

func (*Matter) FindChildren

func (ms *Matter) FindChildren(uid int64, parent string) (children []model.Matter, err error)

func (*Matter) FindUserMatter

func (ms *Matter) FindUserMatter(uid int64, alias string) (*model.Matter, error)

func (*Matter) Move

func (ms *Matter) Move(alias, parent string) error

func (*Matter) ParentExist

func (ms *Matter) ParentExist(uid int64, parentDir string) bool

func (*Matter) Recovery

func (ms *Matter) Recovery(m *model.Recycle) error

func (*Matter) Remove

func (ms *Matter) Remove(mid int64, trashedBy string) error

func (*Matter) RemoveToRecycle

func (ms *Matter) RemoveToRecycle(m *model.Matter) error

func (*Matter) Rename

func (ms *Matter) Rename(alias, name string) error

func (*Matter) RenameChildren

func (ms *Matter) RenameChildren(m *model.Matter, newName string) error

func (*Matter) UnscopedChildren

func (ms *Matter) UnscopedChildren(uid int64, recycleAlias string) (children []model.Matter, err error)

func (*Matter) Uploaded

func (ms *Matter) Uploaded(matter *model.Matter, incrUsed bool) error

type Option

type Option struct {
}

func NewOption

func NewOption() *Option

func (*Option) Get

func (o *Option) Get(name string) (model.Opts, error)

func (*Option) Init

func (o *Option) Init() error

func (*Option) Set

func (o *Option) Set(name string, opts model.Opts) error

type Query

type Query struct {
	Params []interface{}
	Offset int
	Limit  int
	// contains filtered or unexported fields
}

func NewQuery

func NewQuery() *Query

func (*Query) SQL

func (q *Query) SQL() string

func (*Query) WithEq

func (q *Query) WithEq(k, v interface{})

func (*Query) WithGt

func (q *Query) WithGt(k, v interface{})

func (*Query) WithGte

func (q *Query) WithGte(k, v interface{})

func (*Query) WithIn

func (q *Query) WithIn(k, v interface{})

todo test me

func (*Query) WithLike

func (q *Query) WithLike(k, v interface{})

func (*Query) WithLt

func (q *Query) WithLt(k, v interface{})

func (*Query) WithLte

func (q *Query) WithLte(k, v interface{})

func (*Query) WithNe

func (q *Query) WithNe(k, v interface{})

func (*Query) WithNin

func (q *Query) WithNin(k, v interface{})

todo test me

func (*Query) WithPage

func (q *Query) WithPage(pageNo, pageSize int64)

type RecycleBin

type RecycleBin struct {
}

func NewRecycleBin

func NewRecycleBin() *RecycleBin

func (*RecycleBin) Find

func (rb *RecycleBin) Find(uid int64, alias string) (*model.Recycle, error)

func (*RecycleBin) FindAll

func (rb *RecycleBin) FindAll(q *Query) (list []model.Recycle, total int64, err error)

func (*RecycleBin) Release

func (rb *RecycleBin) Release(uid, size int64, query interface{}, args ...interface{}) error

type Share

type Share struct {
}

func NewShare

func NewShare() *Share

func (*Share) Create

func (s *Share) Create(share *model.Share) error

func (*Share) Delete

func (s *Share) Delete(id int64) error

func (*Share) Find

func (s *Share) Find(id int64) (share *model.Share, err error)

func (*Share) FindAll

func (s *Share) FindAll(uid int64) (list []*model.Share, total int64, err error)

func (*Share) FindByAlias

func (s *Share) FindByAlias(alias string) (share *model.Share, err error)

func (*Share) Update

func (s *Share) Update(id int64, share *model.Share) error

type Storage

type Storage struct {
}

func NewStorage

func NewStorage() *Storage

func (*Storage) Create

func (s *Storage) Create(storage *model.Storage) error

func (*Storage) Delete

func (s *Storage) Delete(id string) error

func (*Storage) Find

func (s *Storage) Find(id interface{}) (*model.Storage, error)

func (*Storage) FindAll

func (s *Storage) FindAll(offset, limit int) (storages []model.Storage, total int64, err error)

func (*Storage) Update

func (s *Storage) Update(id string, storage *model.Storage) error

type User

type User struct {
}

func NewUser

func NewUser() *User

func (*User) Activate

func (u *User) Activate(uid int64) error

func (*User) Create

func (u *User) Create(user *model.User, storageMax uint64) (*model.User, error)

func (*User) Delete added in v1.6.0

func (u *User) Delete(user *model.User) error

func (*User) EmailExist

func (u *User) EmailExist(email string) (*model.User, bool)

func (*User) Find

func (u *User) Find(uid int64) (*model.User, error)

func (*User) FindAll

func (u *User) FindAll(query *Query) (list []*model.User, total int64, err error)

func (*User) FindByUsername

func (u *User) FindByUsername(username string) (*model.User, error)

func (*User) PasswordReset

func (u *User) PasswordReset(uid int64, newPwd string) error

PasswordReset update the new password

func (*User) TicketExist

func (u *User) TicketExist(ticket string) (*model.User, bool)

func (*User) Update

func (u *User) Update(user *model.User) error

func (*User) UpdateProfile

func (u *User) UpdateProfile(uid int64, up *model.UserProfile) error

func (*User) UpdateStatus added in v1.6.0

func (u *User) UpdateStatus(uid int64, status uint8) error

func (*User) UpdateStorage

func (u *User) UpdateStorage(uid int64, quota uint64) error

func (*User) UsernameExist

func (u *User) UsernameExist(username string) (*model.User, bool)

type UserKey added in v1.6.0

type UserKey struct {
}

func NewUserKey added in v1.6.0

func NewUserKey() *UserKey

func (*UserKey) Create added in v1.6.0

func (u *UserKey) Create(uk *model.UserKey) (*model.UserKey, error)

func (*UserKey) Delete added in v1.6.0

func (u *UserKey) Delete(user *model.UserKey) error

func (*UserKey) Find added in v1.6.0

func (u *UserKey) Find(uid int64, name string) (*model.UserKey, error)

func (*UserKey) FindAll added in v1.6.0

func (u *UserKey) FindAll(query *Query) (list []*model.UserKey, total int64, err error)

func (*UserKey) FindByClientID added in v1.6.0

func (u *UserKey) FindByClientID(clientID string) (*model.UserKey, error)

func (*UserKey) Update added in v1.6.0

func (u *UserKey) Update(user *model.UserKey) error

Jump to

Keyboard shortcuts

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