eventcache

package
v1.4.21 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(store event.Storer, cache conc.Cacher) *Cache

func (*Cache) Event

func (c *Cache) Event() event.EventStorer

Event implements event.EventStorer

type Event

type Event Cache

func (*Event) Count

func (c *Event) Count(ctx context.Context, opts ...orm.QueryOption) (int64, error)

Count implements event.EventStorer.

func (*Event) Create added in v1.4.21

func (c *Event) Create(ctx context.Context, model *event.Event) error

Create implements event.EventStorer.

func (*Event) Delete added in v1.4.21

func (c *Event) Delete(ctx context.Context, model *event.Event, opts ...orm.QueryOption) error

Delete implements event.EventStorer.

func (*Event) Get

func (c *Event) Get(ctx context.Context, model *event.Event, opts ...orm.QueryOption) error

Get implements event.EventStorer. 注意: 若想走缓存,则 model 的 CacheKey 必须实现且必须存在值 当 CacheKey 为 id 且出现 orm.Where("id=?",id) 时,查询条件会变成 SELECT * FROM `users` WHERE `id` = 1 AND `users`.`id` = 1 两个值一样则不会受到影响

func (*Event) List added in v1.4.21

func (c *Event) List(ctx context.Context, bs *[]*event.Event, page orm.Pager, opts ...orm.QueryOption) (int64, error)

List implements event.EventStorer.

func (*Event) Session

func (c *Event) Session(ctx context.Context, changeFns ...func(*gorm.DB) error) error

Session 事务组合

func (*Event) Update added in v1.4.21

func (c *Event) Update(ctx context.Context, model *event.Event, changeFn func(*event.Event), opts ...orm.QueryOption) error

Update implements event.EventStorer.

func (*Event) UpdateWithSession added in v1.4.21

func (c *Event) UpdateWithSession(tx *gorm.DB, model *event.Event, changeFn func(b *event.Event) error, opts ...orm.QueryOption) error

UpdateWithSession 修改事务

Jump to

Keyboard shortcuts

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