owner
.uverse.addressValue
<gnolang.StringValue>
prefix
untyped stringValue
"gno.land/r/moul/x/upgrade/schema/impl/"
sep
untyped stringsep is the payload separator. A single byte, because the point here is the shape of the boundary and not the encoding: a real one would need escaping, and choosing it is a decision this pattern does not make for you.
Value
"|"
Handler
typeHandler is the whole interface an implementation satisfies. It never changes, because everything that would have changed it is in Schema instead.
Value
v0.Handler
verb
typeValue
v0.verb
Ownable
*v0.Ownable- OID
- 08daae…5bc2:4
Ownable details
candidates
*v0.Tree// pkgpath -> Handler
- OID
- 08daae…5bc2:7
candidates details
live
<nil>Value
nil
livePath
stringValue
""
liveVerbs
*v0.Tree// verb name -> \*verb, for lookup
- OID
- 08daae…5bc2:12
liveVerbs details
liveOrder
[]string// the same verbs in DECLARATION order, for listing
Value
<zero>
Propose
func(h v0.Handler)Propose nominates the calling realm, exactly as in pattern F. Its schema is parsed here so a malformed one is rejected at proposal rather than at accept.
- OID
- 08daae…5bc2:15
Propose details
Accept
func(pkgPath string)Accept promotes a candidate, and refuses one that would break an existing caller. This is the check a Go interface cannot express.
- OID
- 08daae…5bc2:17
Accept details
AcceptBreaking
func(pkgPath string)AcceptBreaking promotes a candidate that Accept refuses. It exists because the diff is SYMMETRIC, which is not obvious until it bites: once v1 has added a verb, rolling back to v0 drops that verb and is a regression by exactly the same rule that protects callers going forward. A pattern that can only move forward is worse than one with no diff at all, so the escape hatch is required, and making it a separate function is the point: the owner has to type a different word, and the audit log shows which one. Use it to roll back, and to retire a verb nobody calls any more. Not to make an upgrade go through.
- OID
- 08daae…5bc2:18
AcceptBreaking details
resolve
func(pkgPath string) (v0.Handler, *v0.Tree, []string)resolve is the owner check and the lookup both accepts share.
- OID
- 08daae…5bc2:19
resolve details
assertNoRegression
func(next *v0.Tree)assertNoRegression is the upgrade diff. A new schema may ADD verbs and may not remove one or change its arity, because a caller compiled against the old one is still out there calling it.
- OID
- 08daae…5bc2:20
assertNoRegression details
Call
func(verbName string, payload string) stringCall is the one signature this realm is committed to forever.
- OID
- 08daae…5bc2:21
Call details
Verbs
func() []stringVerbs lists the accepted API in DECLARATION order, which is the order the handler wrote it in and the order a reader of the schema expects. Iterating the avl tree instead would list them alphabetically, silently: caught by a test, not by a compiler.
- OID
- 08daae…5bc2:22
Verbs details
Signature
func(name string) stringSignature is one verb's shape, as a caller would write it.
- OID
- 08daae…5bc2:23
Signature details
SchemaText
func() stringSchemaText is the whole accepted API in the declaration format, so a client can read back exactly what the handler declared.
- OID
- 08daae…5bc2:24
SchemaText details
Live
func() stringLive is the package path currently serving, or "" before the first Accept.
- OID
- 08daae…5bc2:25
Live details
Candidates
func() []stringCandidates lists every path that has nominated itself, in order.
- OID
- 08daae…5bc2:26
Candidates details
assertLive
func()- OID
- 08daae…5bc2:27
assertLive details
parseSchema
func(text string) (*v0.Tree, []string)parseSchema turns the declaration text into verbs, and is the only validation of a name that Render later echoes.
- OID
- 08daae…5bc2:28
parseSchema details
assertIdent
func(s string)- OID
- 08daae…5bc2:29
assertIdent details
Render
func(string) string- OID
- 08daae…5bc2:30