batchrewrite

package
v0.0.0-...-5fe9b4e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupFile

func CleanupFile(ctx context.Context, files FileDeleter, providerType, fileID, logMessage string, attrs ...any) bool

CleanupFile deletes a temporary rewritten batch input file. It returns true only when a non-empty file id was deleted successfully.

func CleanupFileFromRouter

func CleanupFileFromRouter(ctx context.Context, router FileRouter, providerType, fileID, logMessage string, attrs ...any) bool

CleanupFileFromRouter resolves the native file API only when there is a file id to delete.

func CleanupSupersededFile

func CleanupSupersededFile(ctx context.Context, files FileDeleter, providerType, fileID, logMessage string, attrs ...any) bool

CleanupSupersededFile deletes a local rewrite artifact only when a later rewrite has replaced it in the request-scoped batch metadata.

func CleanupSupersededFileFromRouter

func CleanupSupersededFileFromRouter(ctx context.Context, router FileRouter, providerType, fileID, logMessage string, attrs ...any) bool

CleanupSupersededFileFromRouter deletes a local rewrite artifact only when a later rewrite has replaced it in the request-scoped batch metadata.

func MergeEndpointHints

func MergeEndpointHints(left, right map[string]string) map[string]string

MergeEndpointHints returns a fresh map containing left hints overwritten by right hints. It preserves nil when both inputs are empty.

func RecordPreparation

func RecordPreparation(ctx context.Context, original, rewritten *core.BatchRequest)

RecordPreparation stores request-scoped rewrite metadata for persistence and later cleanup.

func RecordResult

func RecordResult(ctx context.Context, result *core.BatchRewriteResult)

RecordResult stores rewrite metadata produced by an explicit batch preparer.

func ShouldCleanupSupersededFile

func ShouldCleanupSupersededFile(ctx context.Context, fileID string) bool

ShouldCleanupSupersededFile reports whether fileID is a temporary rewrite artifact that has been superseded by a later rewrite stage.

Types

type FileDeleter

type FileDeleter interface {
	DeleteFile(ctx context.Context, providerType, id string) (*core.FileDeleteResponse, error)
}

FileDeleter is the native file API surface needed to remove temporary batch input files created during request rewriting.

type FileRouter

type FileRouter func() (core.NativeFileRoutableProvider, error)

FileRouter resolves a routed native file provider lazily.

Jump to

Keyboard shortcuts

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