1package forge23import"strings"45// MaxPkgPathLen bounds a published package path. gno.land's own paths are far6// shorter; the cap exists because every stored byte is a storage deposit7// somebody pays.8
Functions
not supported for pure packages by the node (vm/qfuncs)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
const MaxPkgPathLen = 256
9
10// Package is the claim that a repo publishes a deployed package path.
11//
12// This is the join nothing else in the forge could express. A repo id is
13// "<namespace>/<name>", exactly two parts, so `r/moul/home` can never be one:
14// there was no way to ask "which repo publishes this package path", which is
15// the first question a reader arriving from an explorer has.
16//
17// The claim is deliberately one-directional and unverified. A realm cannot ask
18// the chain who deployed a path, so the forge cannot check that the repo really
19// is the source of the package. What it can guarantee is that only someone with
20// write access to the repo said so, and that the namespace of the repo is
21// governed by r/sys/users. A reader weighs the claim the way they weigh a
22// go.mod: it says where the author says the source lives.
23type Package struct {
24 Path string// "gno.land/r/moul/home", the deployed package path
25 RepoID string
26 Ref string// the ref this was published from, "" if unstated
27 OID string// the object id, "" if unstated
28 Tag string// the release tag, "" if not published as part of one
29 PublishedAt int64// block height
30 PublishedBy address
31}
32
33// ValidPkgPath reports whether s is a plausible gno package path.
34//
35// Deliberately shallow: it checks shape, not existence, because a realm cannot
36// ask the chain whether a path is deployed and a check that only sometimes
37// works is worse than one that never claims to.