{"modulePath":"github.com/ozontech/file.d","version":"v0.88.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stdlib\n\n## Types\n\n```go\ntype CompiledFunc struct {\n\t// contains filtered or unexported fields\n}\n```\nCompiledFunc is a Function paired with its parameter signature precomputed once at registration. Argument resolution reads the cached signature instead of recomputing it, so nothing about the (static) parameter list is derived per call.\n\n```go\nfunc (c *CompiledFunc) Call(args map[string]core.Value) (core.Value, error)\n```\n\n```go\nfunc (c *CompiledFunc) Name() string\n```\n\n```go\nfunc (c *CompiledFunc) Params() []Parameter\n```\n\n```go\nfunc (c *CompiledFunc) Resolve(\n\tpositional []core.Value,\n\tnamed map[string]core.Value,\n) (map[string]core.Value, error)\n```\nResolve binds evaluated call arguments to the function's parameters and returns them keyed by parameter name.\n\nBinding is strict (Python keyword-only style): positional arguments fill positional parameters by position, named arguments fill named parameters by name. A positional parameter cannot be supplied by name, and a named parameter cannot be supplied positionally.\n\n```go\ntype Function interface {\n\t// Returns the function name as it appears in source code.\n\tName() string\n\n\t// Returns the ordered list of parameter descriptors.\n\t// Order matters for positional argument binding.\n\tParams() []Parameter\n\n\t// Call executes the function with fully-resolved, validated arguments.\n\t// args is keyed by parameter name and always contains every parameter\n\t// (required args + provided optional args + defaults).\n\tCall(args map[string]core.Value) (core.Value, error)\n}\n```\nFunction is the interface every built-in function must implement.\n\nLifecycle during a call:\n\n 1. Interpreter evaluates all argument expressions -\u003e positional \\[]Value + named map\\[string]Value\n 2. CompiledFunc.Resolve validates and maps them to the parameter list -\u003e map\\[string]Value\n 3. Function.Call receives the resolved map and returns a Value\n\n```go\ntype Parameter struct {\n\t// Name is the parameter name. For named parameters it is the keyword used\n\t// at the call site: fn(name: value). For positional parameters it is used\n\t// as the key in the resolved argument map.\n\tName string\n\n\t// Description documents the parameter for help output and generated docs.\n\tDescription string\n\n\t// Default is the value substituted when a named parameter is omitted.\n\t// Its presence is what makes a parameter named (keyword-only) and optional;\n\t// a nil Default makes the parameter positional and required.\n\tDefault core.Value\n\n\t// AcceptedKinds lists the value kinds this parameter accepts.\n\t// An empty slice means any kind is accepted.\n\tAcceptedKinds []core.ValueKind\n}\n```\nDescribes a single parameter of a built-in function.\n\nWhether a parameter is positional or named is derived from Default, mirroring the Python/PHP model:\n\n  - Positional (Default == nil): supplied by position - fn(value) - always required.\n  - Named (Default != nil): supplied by name - fn(name: value) - always optional, falling back to Default when omitted.\n\nAll positional parameters must be declared before any named parameter.\n\n```go\nfunc (p Parameter) Named() bool\n```\nNamed reports whether the parameter is keyword-only (bound by name).\n\n```go\nfunc (p Parameter) Required() bool\n```\nRequired reports whether the parameter must be supplied by the caller. Positional parameters are always required; named parameters never are.\n\n```go\ntype Registry struct {\n\t// contains filtered or unexported fields\n}\n```\nRegistry holds all built-in functions available during program execution. It is built once at startup and shared across all Program.Run calls.\n\n```go\nfunc GetRegistry() *Registry\n```\n\n```go\nfunc (r *Registry) Get(name string) (*CompiledFunc, bool)\n```\n\n","path":"github.com/ozontech/file.d/plugin/action/transform/stdlib","name":"stdlib","synopsis":"","isRedistributable":true}
