Documentation
¶
Overview ¶
Package std implements the OpenFlange portable standard library (`std:<name>`, version 0.1) as in-process Go pipes. Every pipe ships its OPENFLANGE.md manifest and portable tests, embedded under manifests/<name>/.
Call Register to add all std pipes to an adapter.Registry.
Index ¶
- Constants
- Variables
- func CompileJSONSchema(schema any) (*jsonschema.Schema, error)
- func Manifest(name string) (*manifest.Manifest, error)
- func Manifests() fs.FS
- func Names() []string
- func ParseArrowSchema(v any) (*arrow.Schema, error)
- func ParseArrowType(name string) (arrow.DataType, error)
- func Register(reg *adapter.Registry) error
- type SchemaError
Constants ¶
const ( MaxArrowMetadataBytes = 16 << 20 // one message's metadata MaxArrowMessageBytes = 256 << 20 // one message's body (a record batch) )
Limits std:arrow-to-ndjson enforces on an (untrusted) IPC stream before the Arrow decoder sees it; the decoder allocates what a message header claims.
const ArrowAvailable = true
ArrowAvailable reports whether std:ndjson-to-arrow / std:arrow-to-ndjson are implemented in this build.
const DefaultHTTPTimeoutMs = 30000
DefaultHTTPTimeoutMs is the default of std:http-source's `timeoutMs`.
const MaxArrowBatchSize = 1_000_000
MaxArrowBatchSize bounds the rows held by std:ndjson-to-arrow.
const MaxGroupSize = 1_000_000
MaxGroupSize bounds `size` of std:batch and std:window (bounded state).
const MaxPartitions = 8
MaxPartitions is the number of outputs of std:partition (p0..p7).
const Version = "0.1.0"
Version is the version of the standard library implemented here.
Variables ¶
Stdin and Stdout are the streams used by std:stdin and std:stdout. They default to the process streams and can be replaced by embedding applications and tests (not concurrently with a run).
Functions ¶
func CompileJSONSchema ¶
func CompileJSONSchema(schema any) (*jsonschema.Schema, error)
CompileJSONSchema compiles a JSON Schema (dialect 2020-12 unless `$schema` says otherwise) given as generic Go values. External references are refused.
func Manifests ¶
Manifests returns the embedded std manifests and tests, rooted so that `<name>/OPENFLANGE.md` and `<name>/tests/*.test.yaml` are the entries.
func Names ¶
func Names() []string
Names lists the std pipes of this build (without the `std:` prefix), sorted.
func ParseArrowSchema ¶
ParseArrowSchema converts the JSON form {fields: [{name, type, nullable}]} (nullable defaults to true) into an Arrow schema.
func ParseArrowType ¶
ParseArrowType parses a type name of the OpenFlange Arrow schema form.
Types ¶
type SchemaError ¶
SchemaError is one violation: a JSON Pointer into the item and a message.
func SchemaErrors ¶
func SchemaErrors(sch *jsonschema.Schema, it stream.Item) []SchemaError
SchemaErrors validates one JSON item and returns the violations sorted by path, empty when the item is valid.