svc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject[T any](provider do.Provider[T])

func Migrate added in v1.0.1

func Migrate(sqls ...string) error

func Use

func Use[T any]() T

Types

type DataSvc

type DataSvc[M any] struct {
	*Svc[M]
}

func NewDataSvc

func NewDataSvc[M any](prefix string) *DataSvc[M]

func (*DataSvc[M]) Get added in v1.0.1

func (s *DataSvc[M]) Get(conds ...any) (*M, error)

func (*DataSvc[M]) GetLocal

func (s *DataSvc[M]) GetLocal(expiration time.Duration, conds ...any) (*M, error)

func (*DataSvc[M]) GetRedis

func (s *DataSvc[M]) GetRedis(expiration time.Duration, conds ...any) (*M, error)

func (*DataSvc[M]) List added in v1.0.1

func (s *DataSvc[M]) List(conds ...any) ([]M, int64, error)

func (*DataSvc[M]) ListLocal

func (s *DataSvc[M]) ListLocal(expiration time.Duration, conds ...any) ([]M, error)

func (*DataSvc[M]) ListRedis

func (s *DataSvc[M]) ListRedis(expiration time.Duration, conds ...any) ([]M, error)

func (*DataSvc[M]) Make added in v1.0.1

func (s *DataSvc[M]) Make(conds ...any) *gorm.DB

func (*DataSvc[M]) Purge added in v1.0.1

func (s *DataSvc[M]) Purge(conds ...any) error

func (*DataSvc[M]) Remove added in v1.0.1

func (s *DataSvc[M]) Remove(conds ...any) error

func (*DataSvc[M]) Save added in v1.0.1

func (s *DataSvc[M]) Save(m M, confs ...clause.Expression) error

func (*DataSvc[M]) Saves added in v1.0.1

func (s *DataSvc[M]) Saves(ms []M, confs ...clause.Expression) error

func (*DataSvc[M]) Trans added in v1.0.1

func (s *DataSvc[M]) Trans(funcs ...func(tx *gorm.DB) error) error

func (*DataSvc[M]) Update added in v1.0.1

func (s *DataSvc[M]) Update(values map[string]any, conds ...any) error

type Svc

type Svc[M any] struct {
	*internal.Cache
	// contains filtered or unexported fields
}

func NewSvc

func NewSvc[M any](prefix string) *Svc[M]

func (*Svc[M]) GetFullKey

func (s *Svc[M]) GetFullKey(keys ...any) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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