domain

package
v0.0.0-...-984c388 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventActionMap = map[EventAction]string{
	UnknownAction:    "UNKNOWN",
	CreateAction:     "CREATE",
	UpdateAction:     "UPDATE",
	HardDeleteAction: "HARD_DELETE",
	SoftDeleteAction: "SOFT_DELETE",
}
View Source
var EventActionMapStr = map[string]EventAction{
	"UNKNOWN":     UnknownAction,
	"CREATE":      CreateAction,
	"UPDATE":      UpdateAction,
	"HARD_DELETE": HardDeleteAction,
	"SOFT_DELETE": SoftDeleteAction,
}
View Source
var (
	Validate *validator.Validate
)

Functions

This section is empty.

Types

type Aggregate

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

func (*Aggregate) PullEvents

func (a *Aggregate) PullEvents() []Event

func (*Aggregate) PushEvents

func (a *Aggregate) PushEvents(events ...Event)

type BasicService

type BasicService[T any] interface {
	Create(ctx context.Context, args any) error
	Update(ctx context.Context, args any) error
	Delete(ctx context.Context, id string) error
	GetByID(ctx context.Context, id string) (T, error)
	List(ctx context.Context, cr storage.Criteria) ([]T, storage.PageToken, error)
}

type Event

type Event interface {
	GetKey() string
}

type EventAction

type EventAction int
const (
	UnknownAction EventAction = iota
	CreateAction
	UpdateAction
	HardDeleteAction
	SoftDeleteAction
)

func (EventAction) String

func (e EventAction) String() string

type ViewList

type ViewList struct {
	Items         any    `json:"items"`
	Count         int    `json:"count"`
	NextPageToken string `json:"next_page_token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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