inputfile

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package inputfile 为外部转换工具准备可取消、可限量的临时输入文件。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prepare

func Prepare(ctx context.Context, input any, options Options) (string, func(), error)

Prepare 保留路径输入,将 []byte 或 io.Reader 流式写入带格式后缀的临时文件。 成功后调用方负责调用 cleanup;失败时自动清理。取消错误原样返回 ctx.Err()。

Types

type Options

type Options struct {
	TempDir   string
	Extension string
	Limit     int64
}

Options 配置临时输入;Limit 为正时限制非路径输入的字节数,0 或负值不限制。

Jump to

Keyboard shortcuts

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