biz

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("echo record not found")
View Source
var ProviderSet = wire.NewSet(NewEchoCase)

ProviderSet provided NewEchoCase.

Functions

This section is empty.

Types

type Echo

type Echo struct {
	ID          int
	Message     string
	EchoMessage string
	CreateTime  *time.Time
}

Echo is a domain object that handle an echo.

type EchoCase

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

EchoCase handle EchoRepo interface.

func NewEchoCase

func NewEchoCase(ctx context.Context, repo EchoRepo) *EchoCase

NewEchoCase creates a new EchoCase.

func (*EchoCase) CreateEcho

func (uc *EchoCase) CreateEcho(ctx context.Context, message string) (*Echo, error)

func (*EchoCase) DeleteEcho

func (uc *EchoCase) DeleteEcho(ctx context.Context, id int64) error

func (*EchoCase) GetEcho

func (uc *EchoCase) GetEcho(ctx context.Context, id int64) (*Echo, error)

func (*EchoCase) ListEcho

func (uc *EchoCase) ListEcho(ctx context.Context, offset, limit int64) ([]*Echo, error)

func (*EchoCase) UpdateEcho

func (uc *EchoCase) UpdateEcho(ctx context.Context, id int64, message string) (*Echo, error)

type EchoRepo

type EchoRepo interface {
	CreateEcho(ctx context.Context, echo *Echo) (*Echo, error)
	ListEcho(ctx context.Context, offset, limit int64) ([]*Echo, error)
	UpdateEcho(ctx context.Context, echo *Echo) (*Echo, error)
	DeleteEcho(ctx context.Context, ID int64) error
	GetEcho(ctx context.Context, ID int64) (*Echo, error)
}

EchoRepo is a interface to access dao.

Jump to

Keyboard shortcuts

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