domain

package
v0.0.0-...-aef14cd Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Unlicense Imports: 1 Imported by: 0

Documentation

Overview

Package domain TODO.

Package domain TODO.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloneable

type Cloneable interface {
	Copy() Entity
}

type Dft

type Dft[S Suite] interface {
	DoDelete(ctx context.Context, entity S, scan func(Scanner)) error
	DoUpsert(ctx context.Context, entity S, scan func(Scanner)) error
}

type Entity

type Entity interface {
	Cloneable
	Serializable
	DeleteArgs() []any
	DeleteSQL() string
	GetArgs() []any
	GetByFilterArgs() []any
	GetByFilterSQL() string
	GetSQL() string
	InsertArgs() []any
	InsertSQL() string
	UpdateArgs() []any
	UpdateSQL() string
}

type Repo

type Repo[E Entity] interface {
	Delete(ctx context.Context, entity E, scan func(Scanner)) (E, error)
	Get(ctx context.Context, entity E, scan func(Scanner)) (E, error)
	GetByFilter(ctx context.Context, entity E, scan func(Scanner) E) ([]E, error)
	Insert(ctx context.Context, entity E, scan func(Scanner)) (E, error)
	Update(ctx context.Context, entity E, scan func(Scanner)) (E, error)
}

type Scanner

type Scanner interface {
	Scan(dest ...any) error
}

type Serializable

type Serializable interface {
	FromJSON(data []byte) (err error)
	Key() string
	ToJSON() ([]byte, error)
}

type Suite

type Suite interface {
	Entity
	DeleteTxArgs() TxArgs
	UpsertTxArgs() TxArgs
}

type TxArgs

type TxArgs struct {
	Args [][]any
	SQLs []string
}

Directories

Path Synopsis
Package batch TODO.
Package batch TODO.
Package entity TODO.
Package entity TODO.
Package memory Is a copy of the storage memory from the external storage packet as a purpose to test the behavior in the unittests when using a storages from these packets
Package memory Is a copy of the storage memory from the external storage packet as a purpose to test the behavior in the unittests when using a storages from these packets
Package mongo TODO.
Package mongo TODO.
Package repo TODO.
Package repo TODO.

Jump to

Keyboard shortcuts

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