Documentation
¶
Index ¶
- func CleanupFile(ctx context.Context, files FileDeleter, ...) bool
- func CleanupFileFromRouter(ctx context.Context, router FileRouter, ...) bool
- func CleanupSupersededFile(ctx context.Context, files FileDeleter, ...) bool
- func CleanupSupersededFileFromRouter(ctx context.Context, router FileRouter, ...) bool
- func MergeEndpointHints(left, right map[string]string) map[string]string
- func RecordPreparation(ctx context.Context, original, rewritten *core.BatchRequest)
- func RecordResult(ctx context.Context, result *core.BatchRewriteResult)
- func ShouldCleanupSupersededFile(ctx context.Context, fileID string) bool
- type FileDeleter
- type FileRouter
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 ¶
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.
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.