dao

package
v0.0.0-...-13800eb Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewMySQL

func NewMySQL(c *common.DataConfig, logger log.Logger) (*gorm.DB, func(), error)

func NewRedis

func NewRedis(c *common.DataConfig, logger log.Logger) (*redis.Client, func(), error)

func NewRedisCache

func NewRedisCache(redisClient *redis.Client) (goCache.Cache, error)

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(db *gorm.DB) *Application

func (*Application) Add

func (s *Application) Add(ctx context.Context, in *models.Application, opts ...igorm.Option) error

func (*Application) CountByName

func (s *Application) CountByName(ctx context.Context, name string, opts ...igorm.Option) (int64, error)

func (*Application) CountByNameWithInclude

func (s *Application) CountByNameWithInclude(ctx context.Context, name, excludeId string, opts ...igorm.Option) (int64, error)

func (*Application) Delete

func (s *Application) Delete(ctx context.Context, id string, opts ...igorm.Option) error

func (*Application) Find

func (s *Application) Find(ctx context.Context, size int, offset string, opts ...igorm.Option) ([]*models.Application, string, error)

func (*Application) Get

func (s *Application) Get(ctx context.Context, id string, opts ...igorm.Option) (*models.Application, error)

func (*Application) Session

func (s *Application) Session(ctx context.Context, opts ...igorm.Option) *gorm.DB

func (*Application) Update

func (s *Application) Update(ctx context.Context, in *models.Application, opts ...igorm.Option) error

func (*Application) UpdateSecret

func (s *Application) UpdateSecret(ctx context.Context, id, secret string, opts ...igorm.Option) error

func (*Application) UpdateStatus

func (s *Application) UpdateStatus(ctx context.Context, id string, status v1.ApplicationStatus, opts ...igorm.Option) error

type TimerCallback

type TimerCallback struct {
	// contains filtered or unexported fields
}

func NewTimerCallback

func NewTimerCallback(db *gorm.DB) *TimerCallback

func (*TimerCallback) Add

func (s *TimerCallback) Add(ctx context.Context, in *models.TimerCallback, opts ...igorm.Option) error

func (*TimerCallback) FindByTime

func (s *TimerCallback) FindByTime(ctx context.Context, start, end time.Time, status v1.TimerCallbackStatus, opts ...igorm.Option) ([]*models.TimerCallback, error)

func (*TimerCallback) FindByTimerId

func (s *TimerCallback) FindByTimerId(ctx context.Context, timerId, offset string, size int, opts ...igorm.Option) ([]*models.TimerCallback, string, error)

func (*TimerCallback) Session

func (s *TimerCallback) Session(ctx context.Context, opts ...igorm.Option) *gorm.DB

type TimerRecord

type TimerRecord struct {
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer(db *gorm.DB) *TimerRecord

func (*TimerRecord) Add

func (s *TimerRecord) Add(ctx context.Context, in *models.Timer, opts ...igorm.Option) error

func (*TimerRecord) Delete

func (s *TimerRecord) Delete(ctx context.Context, id string, opts ...igorm.Option) error

func (*TimerRecord) Find

func (s *TimerRecord) Find(ctx context.Context, size int, offset string, opts ...igorm.Option) ([]*models.Timer, string, error)

func (*TimerRecord) Get

func (s *TimerRecord) Get(ctx context.Context, id string, opts ...igorm.Option) (*models.Timer, error)

func (*TimerRecord) Session

func (s *TimerRecord) Session(ctx context.Context, opts ...igorm.Option) *gorm.DB

func (*TimerRecord) Update

func (s *TimerRecord) Update(ctx context.Context, in *models.Timer, opts ...igorm.Option) error

func (*TimerRecord) UpdateStatus

func (s *TimerRecord) UpdateStatus(ctx context.Context, id string, status v1.TimerStatus, opts ...igorm.Option) error

type Token

type Token struct {
	// contains filtered or unexported fields
}

func NewToken

func NewToken(db *gorm.DB) *Token

func (*Token) Add

func (s *Token) Add(ctx context.Context, in *models.Token, opts ...igorm.Option) error

func (*Token) Token

func (s *Token) Token(ctx context.Context, opts ...igorm.Option) *gorm.DB

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(mysql *gorm.DB, redisClient *redis.Client) *User

func (*User) Add

func (s *User) Add(ctx context.Context, in *models.User, opts ...igorm.Option) error

func (*User) CountByName

func (s *User) CountByName(ctx context.Context, name string, opts ...igorm.Option) (int64, error)

func (*User) CountByNameWithInclude

func (s *User) CountByNameWithInclude(ctx context.Context, name, excludeId string, opts ...igorm.Option) (int64, error)

func (*User) Delete

func (s *User) Delete(ctx context.Context, id int64, opts ...igorm.Option) error

func (*User) FindByOffset

func (s *User) FindByOffset(ctx context.Context, size int, offset string, opts ...igorm.Option) ([]*models.User, string, error)

func (*User) FindByPage

func (s *User) FindByPage(ctx context.Context, page, size int, opts ...igorm.Option) ([]*models.User, error)

func (*User) Get

func (s *User) Get(ctx context.Context, id string, opts ...igorm.Option) (*models.User, error)

func (*User) Session

func (s *User) Session(ctx context.Context, opts ...igorm.Option) *gorm.DB

func (*User) Update

func (s *User) Update(ctx context.Context, in *models.User, opts ...igorm.Option) error

func (*User) UpdateStatus

func (s *User) UpdateStatus(ctx context.Context, id string, status v1.UserStatus, opts ...igorm.Option) error

Jump to

Keyboard shortcuts

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