Help us shape the future of Go! Take the 2026 Go Developer Survey

delete

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBatchSize = 400

MaxBatchSize bounds the private cleanup contract, not ordinary payload writes.

View Source
const ModeEnvironment = "AGENTLY_DELETE_PAYLOAD_MODE"
View Source
const WriterDatlyResourceNamespace = "datly_payload_delete_writer"

DatlyResourceNamespace identifies this package's generated resource filesystem.

Variables

View Source
var BulkDeleteDatly = new(BulkDeleteComponent)
View Source
var WriterDatly = new(WriterComponent)

The public value supports explicit component wiring.

View Source
var WriterDatlyResources embed.FS

Functions

func PinMode

func PinMode(ctx context.Context) (context.Context, error)

PinMode selects once before the enclosing deletion transaction begins. Nested graph/chunk invocations inherit it; invalid settings never fall back.

func WriterDatlyType

func WriterDatlyType() reflect.Type

WriterDatlyType returns the public component type.

func WriterHandlerCurrentWriterIndexByIdKey

func WriterHandlerCurrentWriterIndexByIdKey(value *CurrentWriterView) (string, bool)

Types

type BulkDelete

type BulkDelete struct{}

func (*BulkDelete) Execute

func (*BulkDelete) Execute(ctx context.Context, invocation rh.Invocation) (_ any, retErr error)

func (*BulkDelete) InputType

func (*BulkDelete) InputType() reflect.Type

func (*BulkDelete) OutputType

func (*BulkDelete) OutputType() reflect.Type

func (*BulkDelete) RequiresPreBindingTransaction

func (*BulkDelete) RequiresPreBindingTransaction() bool

type BulkDeleteComponent

type BulkDeleteComponent struct {
	Contract xdatly.Component[Input, Output] `` /* 196-byte string literal not displayed */
}

BulkDeleteComponent is authored, not generated. It shares the row writer's trusted contract and key-only pre-read; one guarded row anchors the flush.

func (BulkDeleteComponent) DatlyHandler

func (BulkDeleteComponent) DatlyHandler(name string) func() (rh.TypedHandler, error)

func (BulkDeleteComponent) EmbedFS

func (BulkDeleteComponent) EmbedFS() *embed.FS

func (BulkDeleteComponent) EmbedNamespace

func (BulkDeleteComponent) EmbedNamespace() string

type CurrentWriterView

type CurrentWriterView struct {
	Id string `validate:"required" sqlx:"id,primaryKey" json:"id"`
}

CurrentWriterView is generated canonical view metadata for writer.

type Input

type Input struct {
	DeleteUnreferenced bool                 `` /* 976-byte string literal not displayed */
	Payloads           []*PayloadDelete     `` /* 189-byte string literal not displayed */
	WriterKeys         []WriterKeysRow      `` /* 133-byte string literal not displayed */
	CurrentWriter      []*CurrentWriterView `` /* 170-byte string literal not displayed */

	Has *InputHas `setMarker:"true" typeName:"InputHas" json:"-" sqlx:"-"`
	// contains filtered or unexported fields
}

Input is the generated input scaffold for writer.

func (*Input) Init

func (input *Input) Init(ctx context.Context) error

Init restricts this private key-only writer to explicitly marked deletions authorized by the trusted payloadaccess provider. Ordinary payload mutations still use payload/write. Reference predicates are also enforced by DELETE, so a reference arriving after the pre-read aborts the caller's transaction.

func (*Input) PrepareReadIndexes

func (input *Input) PrepareReadIndexes(ctx context.Context) error

func (*Input) ReadIndexes

func (input *Input) ReadIndexes(ctx context.Context) (*WriterHandlerReadIndexes, error)

func (*Input) SetCurrentWriter

func (input *Input) SetCurrentWriter(value []*CurrentWriterView)

func (*Input) SetDeleteUnreferenced

func (input *Input) SetDeleteUnreferenced(value bool)

func (*Input) SetPayloads

func (input *Input) SetPayloads(value []*PayloadDelete)

func (*Input) SetWriterKeys

func (input *Input) SetWriterKeys(value []WriterKeysRow)

type InputHas

type InputHas struct {
	DeleteUnreferenced bool
	Payloads           bool
	WriterKeys         bool
	CurrentWriter      bool
}

type Mode

type Mode string
const (
	RowMode  Mode = "row"
	BulkMode Mode = "bulk"
)

func PinnedMode

func PinnedMode(ctx context.Context) Mode

PinnedMode is only consumed after PinMode at a deletion entry point.

type Output

type Output struct {
	Data []*PayloadDelete `parameter:"Data,kind=output,in=body,dataType=[]*PayloadDelete" json:"data,omitempty"`
}

Output is the generated output scaffold for writer.

type PayloadDelete

type PayloadDelete struct {
	ShouldDelete bool              `sqlx:"-" writer:"delete" json:"shouldDelete,omitempty"`
	Id           string            `validate:"required" sqlx:"id,primaryKey" json:"id"`
	Has          *PayloadDeleteHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-" typeName:"PayloadDeleteHas"`
}

PayloadDelete is generated canonical view metadata for writer.

func (*PayloadDelete) GetId

func (entity *PayloadDelete) GetId() string

func (*PayloadDelete) GetShouldDelete

func (entity *PayloadDelete) GetShouldDelete() bool

func (*PayloadDelete) SetId

func (entity *PayloadDelete) SetId(value string)

func (*PayloadDelete) SetShouldDelete

func (entity *PayloadDelete) SetShouldDelete(value bool)

type PayloadDeleteHas

type PayloadDeleteHas struct {
	ShouldDelete bool
	Id           bool
}

type WriterComponent

type WriterComponent struct {
	Contract xdatly.Component[Input, Output] "" /* 176-byte string literal not displayed */
}

Component is the generated component scaffold for writer.

func (WriterComponent) EmbedFS

func (WriterComponent) EmbedFS() *embed.FS

func (WriterComponent) EmbedNamespace

func (WriterComponent) EmbedNamespace() string

type WriterHandlerCurrentWriterGroupedById

type WriterHandlerCurrentWriterGroupedById map[string][]*CurrentWriterView

func (WriterHandlerCurrentWriterGroupedById) Has

type WriterHandlerCurrentWriterIndexedById

type WriterHandlerCurrentWriterIndexedById map[string]*CurrentWriterView

func (WriterHandlerCurrentWriterIndexedById) Has

type WriterHandlerCurrentWriterSlice

type WriterHandlerCurrentWriterSlice []*CurrentWriterView

func (WriterHandlerCurrentWriterSlice) GroupById

func (WriterHandlerCurrentWriterSlice) IndexById

type WriterHandlerReadIndexes

type WriterHandlerReadIndexes struct {
	CurrentWriter     WriterHandlerCurrentWriterSlice
	CurrentWriterById WriterHandlerCurrentWriterIndexedById
}

func BuildWriterHandlerReadIndexes

func BuildWriterHandlerReadIndexes(ctx context.Context, input *Input) (*WriterHandlerReadIndexes, error)

type WriterKeysRow

type WriterKeysRow struct {
	Id string `sqlx:"id"`
}

Jump to

Keyboard shortcuts

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