Documentation
¶
Overview ¶
Package pluginfetch implements the knot plugin's fetcher: the source of truth for knot:// scheme sources served to the scriptling CLI. The embedded knot.* libraries come from the binary; user and global libraries and scripts come from the knot server API on demand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
Entry mirrors plugin.FetchEntry without importing the scriptling module here (the command wires them together).
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher serves knot:// sources for the scriptling plugin protocol.
The layout is the standard one: modules under lib/, scripts as bare knot://name sources. Under lib/ sit two populations side by side:
lib/knot/<module>.py — the embedded knot.* API libraries (the embedded
copy of apiclient.py is swapped for the
plugin-transport variant, so API calls route
through this plugin instead of direct HTTP)
lib/<name>.py — the user's own and global library scripts,
fetched from the server on demand
func NewFetcher ¶
NewFetcher creates a fetcher backed by the given API client.
func (*Fetcher) Read ¶
Read implements plugin.Fetcher. An empty path means the source itself is a single script file: knot://myscript fetches the script of that name.
func (*Fetcher) Tree ¶
Tree enumerates the served tree with full slash paths, directories included: lib/, lib/knot/ with the embedded modules, and lib/<name>.py for the user's and global library scripts. The command filters it against fetch glob patterns, so one enumeration answers existence probes, listings and subtree matches alike.