dao

package
v0.0.0-...-b532d83 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Q        = new(Query)
	Auth     *auth
	Config   *config
	Provider *provider
	Proxy    *proxy
	Tunnel   *tunnel
)

Functions

func SetDefault

func SetDefault(db *gorm.DB, opts ...gen.DOOption)

Types

type IAuthDo

type IAuthDo interface {
	gen.SubQuery
	Debug() IAuthDo
	WithContext(ctx context.Context) IAuthDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() IAuthDo
	WriteDB() IAuthDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) IAuthDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) IAuthDo
	Not(conds ...gen.Condition) IAuthDo
	Or(conds ...gen.Condition) IAuthDo
	Select(conds ...field.Expr) IAuthDo
	Where(conds ...gen.Condition) IAuthDo
	Order(conds ...field.Expr) IAuthDo
	Distinct(cols ...field.Expr) IAuthDo
	Omit(cols ...field.Expr) IAuthDo
	Join(table schema.Tabler, on ...field.Expr) IAuthDo
	LeftJoin(table schema.Tabler, on ...field.Expr) IAuthDo
	RightJoin(table schema.Tabler, on ...field.Expr) IAuthDo
	Group(cols ...field.Expr) IAuthDo
	Having(conds ...gen.Condition) IAuthDo
	Limit(limit int) IAuthDo
	Offset(offset int) IAuthDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) IAuthDo
	Unscoped() IAuthDo
	Create(values ...*models.Auth) error
	CreateInBatches(values []*models.Auth, batchSize int) error
	Save(values ...*models.Auth) error
	First() (*models.Auth, error)
	Take() (*models.Auth, error)
	Last() (*models.Auth, error)
	Find() ([]*models.Auth, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.Auth, err error)
	FindInBatches(result *[]*models.Auth, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*models.Auth) (info gen.ResultInfo, err error)
	Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	Updates(value interface{}) (info gen.ResultInfo, err error)
	UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
	UpdateFrom(q gen.SubQuery) gen.Dao
	Attrs(attrs ...field.AssignExpr) IAuthDo
	Assign(attrs ...field.AssignExpr) IAuthDo
	Joins(fields ...field.RelationField) IAuthDo
	Preload(fields ...field.RelationField) IAuthDo
	FirstOrInit() (*models.Auth, error)
	FirstOrCreate() (*models.Auth, error)
	FindByPage(offset int, limit int) (result []*models.Auth, count int64, err error)
	ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
	Scan(result interface{}) (err error)
	Returning(value interface{}, columns ...string) IAuthDo
	UnderlyingDB() *gorm.DB
	schema.Tabler
}

type IConfigDo

type IConfigDo interface {
	gen.SubQuery
	Debug() IConfigDo
	WithContext(ctx context.Context) IConfigDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() IConfigDo
	WriteDB() IConfigDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) IConfigDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) IConfigDo
	Not(conds ...gen.Condition) IConfigDo
	Or(conds ...gen.Condition) IConfigDo
	Select(conds ...field.Expr) IConfigDo
	Where(conds ...gen.Condition) IConfigDo
	Order(conds ...field.Expr) IConfigDo
	Distinct(cols ...field.Expr) IConfigDo
	Omit(cols ...field.Expr) IConfigDo
	Join(table schema.Tabler, on ...field.Expr) IConfigDo
	LeftJoin(table schema.Tabler, on ...field.Expr) IConfigDo
	RightJoin(table schema.Tabler, on ...field.Expr) IConfigDo
	Group(cols ...field.Expr) IConfigDo
	Having(conds ...gen.Condition) IConfigDo
	Limit(limit int) IConfigDo
	Offset(offset int) IConfigDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) IConfigDo
	Unscoped() IConfigDo
	Create(values ...*models.Config) error
	CreateInBatches(values []*models.Config, batchSize int) error
	Save(values ...*models.Config) error
	First() (*models.Config, error)
	Take() (*models.Config, error)
	Last() (*models.Config, error)
	Find() ([]*models.Config, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.Config, err error)
	FindInBatches(result *[]*models.Config, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*models.Config) (info gen.ResultInfo, err error)
	Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	Updates(value interface{}) (info gen.ResultInfo, err error)
	UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
	UpdateFrom(q gen.SubQuery) gen.Dao
	Attrs(attrs ...field.AssignExpr) IConfigDo
	Assign(attrs ...field.AssignExpr) IConfigDo
	Joins(fields ...field.RelationField) IConfigDo
	Preload(fields ...field.RelationField) IConfigDo
	FirstOrInit() (*models.Config, error)
	FirstOrCreate() (*models.Config, error)
	FindByPage(offset int, limit int) (result []*models.Config, count int64, err error)
	ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
	Scan(result interface{}) (err error)
	Returning(value interface{}, columns ...string) IConfigDo
	UnderlyingDB() *gorm.DB
	schema.Tabler
}

type IProviderDo

type IProviderDo interface {
	gen.SubQuery
	Debug() IProviderDo
	WithContext(ctx context.Context) IProviderDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() IProviderDo
	WriteDB() IProviderDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) IProviderDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) IProviderDo
	Not(conds ...gen.Condition) IProviderDo
	Or(conds ...gen.Condition) IProviderDo
	Select(conds ...field.Expr) IProviderDo
	Where(conds ...gen.Condition) IProviderDo
	Order(conds ...field.Expr) IProviderDo
	Distinct(cols ...field.Expr) IProviderDo
	Omit(cols ...field.Expr) IProviderDo
	Join(table schema.Tabler, on ...field.Expr) IProviderDo
	LeftJoin(table schema.Tabler, on ...field.Expr) IProviderDo
	RightJoin(table schema.Tabler, on ...field.Expr) IProviderDo
	Group(cols ...field.Expr) IProviderDo
	Having(conds ...gen.Condition) IProviderDo
	Limit(limit int) IProviderDo
	Offset(offset int) IProviderDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) IProviderDo
	Unscoped() IProviderDo
	Create(values ...*models.Provider) error
	CreateInBatches(values []*models.Provider, batchSize int) error
	Save(values ...*models.Provider) error
	First() (*models.Provider, error)
	Take() (*models.Provider, error)
	Last() (*models.Provider, error)
	Find() ([]*models.Provider, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.Provider, err error)
	FindInBatches(result *[]*models.Provider, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*models.Provider) (info gen.ResultInfo, err error)
	Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	Updates(value interface{}) (info gen.ResultInfo, err error)
	UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
	UpdateFrom(q gen.SubQuery) gen.Dao
	Attrs(attrs ...field.AssignExpr) IProviderDo
	Assign(attrs ...field.AssignExpr) IProviderDo
	Joins(fields ...field.RelationField) IProviderDo
	Preload(fields ...field.RelationField) IProviderDo
	FirstOrInit() (*models.Provider, error)
	FirstOrCreate() (*models.Provider, error)
	FindByPage(offset int, limit int) (result []*models.Provider, count int64, err error)
	ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
	Scan(result interface{}) (err error)
	Returning(value interface{}, columns ...string) IProviderDo
	UnderlyingDB() *gorm.DB
	schema.Tabler
}

type IProxyDo

type IProxyDo interface {
	gen.SubQuery
	Debug() IProxyDo
	WithContext(ctx context.Context) IProxyDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() IProxyDo
	WriteDB() IProxyDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) IProxyDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) IProxyDo
	Not(conds ...gen.Condition) IProxyDo
	Or(conds ...gen.Condition) IProxyDo
	Select(conds ...field.Expr) IProxyDo
	Where(conds ...gen.Condition) IProxyDo
	Order(conds ...field.Expr) IProxyDo
	Distinct(cols ...field.Expr) IProxyDo
	Omit(cols ...field.Expr) IProxyDo
	Join(table schema.Tabler, on ...field.Expr) IProxyDo
	LeftJoin(table schema.Tabler, on ...field.Expr) IProxyDo
	RightJoin(table schema.Tabler, on ...field.Expr) IProxyDo
	Group(cols ...field.Expr) IProxyDo
	Having(conds ...gen.Condition) IProxyDo
	Limit(limit int) IProxyDo
	Offset(offset int) IProxyDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) IProxyDo
	Unscoped() IProxyDo
	Create(values ...*models.Proxy) error
	CreateInBatches(values []*models.Proxy, batchSize int) error
	Save(values ...*models.Proxy) error
	First() (*models.Proxy, error)
	Take() (*models.Proxy, error)
	Last() (*models.Proxy, error)
	Find() ([]*models.Proxy, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.Proxy, err error)
	FindInBatches(result *[]*models.Proxy, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*models.Proxy) (info gen.ResultInfo, err error)
	Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	Updates(value interface{}) (info gen.ResultInfo, err error)
	UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
	UpdateFrom(q gen.SubQuery) gen.Dao
	Attrs(attrs ...field.AssignExpr) IProxyDo
	Assign(attrs ...field.AssignExpr) IProxyDo
	Joins(fields ...field.RelationField) IProxyDo
	Preload(fields ...field.RelationField) IProxyDo
	FirstOrInit() (*models.Proxy, error)
	FirstOrCreate() (*models.Proxy, error)
	FindByPage(offset int, limit int) (result []*models.Proxy, count int64, err error)
	ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
	Scan(result interface{}) (err error)
	Returning(value interface{}, columns ...string) IProxyDo
	UnderlyingDB() *gorm.DB
	schema.Tabler
}

type ITunnelDo

type ITunnelDo interface {
	gen.SubQuery
	Debug() ITunnelDo
	WithContext(ctx context.Context) ITunnelDo
	WithResult(fc func(tx gen.Dao)) gen.ResultInfo
	ReplaceDB(db *gorm.DB)
	ReadDB() ITunnelDo
	WriteDB() ITunnelDo
	As(alias string) gen.Dao
	Session(config *gorm.Session) ITunnelDo
	Columns(cols ...field.Expr) gen.Columns
	Clauses(conds ...clause.Expression) ITunnelDo
	Not(conds ...gen.Condition) ITunnelDo
	Or(conds ...gen.Condition) ITunnelDo
	Select(conds ...field.Expr) ITunnelDo
	Where(conds ...gen.Condition) ITunnelDo
	Order(conds ...field.Expr) ITunnelDo
	Distinct(cols ...field.Expr) ITunnelDo
	Omit(cols ...field.Expr) ITunnelDo
	Join(table schema.Tabler, on ...field.Expr) ITunnelDo
	LeftJoin(table schema.Tabler, on ...field.Expr) ITunnelDo
	RightJoin(table schema.Tabler, on ...field.Expr) ITunnelDo
	Group(cols ...field.Expr) ITunnelDo
	Having(conds ...gen.Condition) ITunnelDo
	Limit(limit int) ITunnelDo
	Offset(offset int) ITunnelDo
	Count() (count int64, err error)
	Scopes(funcs ...func(gen.Dao) gen.Dao) ITunnelDo
	Unscoped() ITunnelDo
	Create(values ...*models.Tunnel) error
	CreateInBatches(values []*models.Tunnel, batchSize int) error
	Save(values ...*models.Tunnel) error
	First() (*models.Tunnel, error)
	Take() (*models.Tunnel, error)
	Last() (*models.Tunnel, error)
	Find() ([]*models.Tunnel, error)
	FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*models.Tunnel, err error)
	FindInBatches(result *[]*models.Tunnel, batchSize int, fc func(tx gen.Dao, batch int) error) error
	Pluck(column field.Expr, dest interface{}) error
	Delete(...*models.Tunnel) (info gen.ResultInfo, err error)
	Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	Updates(value interface{}) (info gen.ResultInfo, err error)
	UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
	UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
	UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
	UpdateFrom(q gen.SubQuery) gen.Dao
	Attrs(attrs ...field.AssignExpr) ITunnelDo
	Assign(attrs ...field.AssignExpr) ITunnelDo
	Joins(fields ...field.RelationField) ITunnelDo
	Preload(fields ...field.RelationField) ITunnelDo
	FirstOrInit() (*models.Tunnel, error)
	FirstOrCreate() (*models.Tunnel, error)
	FindByPage(offset int, limit int) (result []*models.Tunnel, count int64, err error)
	ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
	Scan(result interface{}) (err error)
	Returning(value interface{}, columns ...string) ITunnelDo
	UnderlyingDB() *gorm.DB
	schema.Tabler
}

type Query

type Query struct {
	Auth     auth
	Config   config
	Provider provider
	Proxy    proxy
	Tunnel   tunnel
	// contains filtered or unexported fields
}

func Use

func Use(db *gorm.DB, opts ...gen.DOOption) *Query

func (*Query) Available

func (q *Query) Available() bool

func (*Query) Begin

func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx

func (*Query) ReadDB

func (q *Query) ReadDB() *Query

func (*Query) ReplaceDB

func (q *Query) ReplaceDB(db *gorm.DB) *Query

func (*Query) Transaction

func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error

func (*Query) WithContext

func (q *Query) WithContext(ctx context.Context) *queryCtx

func (*Query) WriteDB

func (q *Query) WriteDB() *Query

type QueryTx

type QueryTx struct {
	*Query
	Error error
}

func (*QueryTx) Commit

func (q *QueryTx) Commit() error

func (*QueryTx) Rollback

func (q *QueryTx) Rollback() error

func (*QueryTx) RollbackTo

func (q *QueryTx) RollbackTo(name string) error

func (*QueryTx) SavePoint

func (q *QueryTx) SavePoint(name string) error

Jump to

Keyboard shortcuts

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