persistence

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(value interface{}) error

Create

func DeleteByID

func DeleteByID(model interface{}, id uint64) (count int64, err error)

Delete

func DeleteByIDS

func DeleteByIDS(model interface{}, ids []uint64) (count int64, err error)

Delete

func DeleteByModel

func DeleteByModel(model interface{}) (count int64, err error)

Delete

func DeleteByWhere

func DeleteByWhere(model, where interface{}) (count int64, err error)

Delete

func Find

func Find(where interface{}, out interface{}, associations []string, orders ...string) error

Find

func First

func First(where interface{}, out interface{}, associations []string) (notFound bool, err error)

First

func FirstByID

func FirstByID(out interface{}, id string) (notFound bool, err error)

First

func Save

func Save(value interface{}) error

Save

func Scan

func Scan(model, where interface{}, out interface{}) (notFound bool, err error)

Scan

func ScanList

func ScanList(model, where interface{}, out interface{}, orders ...string) error

ScanList

func Updates

func Updates(where interface{}, value interface{}) error

Updates

Types

type Alias2dataRepository

type Alias2dataRepository struct{}

func GetAlias2dataRepository

func GetAlias2dataRepository() *Alias2dataRepository

func (*Alias2dataRepository) Add

func (r *Alias2dataRepository) Add(alias2data *models.Alias2data) error

func (*Alias2dataRepository) CountByAlias added in v1.2.0

func (r *Alias2dataRepository) CountByAlias(alias string) (int, error)

func (*Alias2dataRepository) Get

type DockerRepository added in v1.2.0

type DockerRepository struct{}

func GetDockerRepository added in v1.2.0

func GetDockerRepository() *DockerRepository

func (*DockerRepository) GetTagName added in v1.2.0

func (r *DockerRepository) GetTagName(namespace string, repository string, includedStr string) (string, error)

type SiteStatus

type SiteStatus struct {
	Name string
	Code int
}

type Sites

type Sites struct {
	List map[string]SiteStatus
}

func GetRobotRepository

func GetRobotRepository() *Sites

func (*Sites) ClearCheckResult

func (r *Sites) ClearCheckResult(WebSites *[]models.WebSite) (*wxworkbot.Markdown, error)

type TaskRepository

type TaskRepository struct{}

func GetTaskRepository

func GetTaskRepository() *TaskRepository

func (*TaskRepository) Add

func (r *TaskRepository) Add(task *models.Task) error

func (*TaskRepository) All

func (r *TaskRepository) All() (*[]models.Task, error)

func (*TaskRepository) Delete

func (r *TaskRepository) Delete(task *models.Task) error

func (*TaskRepository) Get

func (r *TaskRepository) Get(id string) (*models.Task, error)

func (*TaskRepository) Query

func (r *TaskRepository) Query(q *models.Task) (*[]models.Task, error)

func (*TaskRepository) Update

func (r *TaskRepository) Update(task *models.Task) error

type TinyRepository added in v1.2.0

type TinyRepository struct{}

func GetTinyRepository added in v1.2.0

func GetTinyRepository() *TinyRepository

func (*TinyRepository) QueryOriLinkByOriMd5 added in v1.2.0

func (r *TinyRepository) QueryOriLinkByOriMd5(OriMd5 string) (*models.Tiny, error)

func (*TinyRepository) QueryOriLinkByTinyKey added in v1.2.0

func (r *TinyRepository) QueryOriLinkByTinyKey(TinyKey string) (string, error)
func (r *TinyRepository) SaveOriLink(OriLink string, addBaseUrl string) (string, error)
func (r *TinyRepository) SaveTinyLink(TinyId uint64, TinyLink string, TinyKey string) (bool, error)

type UserRepository

type UserRepository struct{}

func GetUserRepository

func GetUserRepository() *UserRepository

func (*UserRepository) Add

func (r *UserRepository) Add(user *models.User) error

func (*UserRepository) All

func (r *UserRepository) All() (*[]models.User, error)

func (*UserRepository) Delete

func (r *UserRepository) Delete(user *models.User) error

func (*UserRepository) Get

func (r *UserRepository) Get(id string) (*models.User, error)

func (*UserRepository) GetByUsername

func (r *UserRepository) GetByUsername(username string) (*models.User, error)

func (*UserRepository) Query

func (r *UserRepository) Query(q *models.User) (*[]models.User, error)

func (*UserRepository) Update

func (r *UserRepository) Update(user *models.User) error

Jump to

Keyboard shortcuts

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