data

package
v0.0.0-...-a7b145a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewEnt, NewData, NewCache)

ProviderSet provided NewData and NewEnt.

Functions

func NewCache

NewCache creates a new cache.

func NewData

func NewData(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.EchoRepo

NewData creates a new data which is a biz.EchoRepo.

func NewEnt

func NewEnt(ctx context.Context, c *conf.Bootstrap) (*ent.Client, error)

NewEnt create an ent client.

Types

type Data

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

Data handle db connection and implemented biz.EchoRepo.

func (*Data) CreateEcho

func (r *Data) CreateEcho(ctx context.Context, echo *biz.Echo) (*biz.Echo, error)

CreateEcho creates a new echo record and cache it by key id.

func (*Data) DeleteEcho

func (r *Data) DeleteEcho(ctx context.Context, ID int64) error

DeleteEcho delete echo record.

func (*Data) GetEcho

func (r *Data) GetEcho(ctx context.Context, ID int64) (*biz.Echo, error)

GetEcho get echo record by id.

func (*Data) ListEcho

func (r *Data) ListEcho(ctx context.Context, offset int64, limit int64) ([]*biz.Echo, error)

ListEcho returns a list of Echo.

func (*Data) UpdateEcho

func (r *Data) UpdateEcho(ctx context.Context, echo *biz.Echo) (*biz.Echo, error)

UpdateEcho updates the echo and set cache.

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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