Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 state

Back to all declarations

errForeignNamespace

*errors.errorString

errForeignNamespace is the one rule this realm adds on top of the library: a namespace is yours or it is not.

Open
OID
0cf8c3…d559:4
errForeignNamespace details

Inspect pointer

repo

func(id string) *v0.Repo

repo resolves a repo id or aborts. Read paths use f.Repo directly and return a rendered "not found" instead.

Open
OID
0cf8c3…d559:14
repo details

Inspect func

requireNamespace

func(a .uverse.address, id string)

requireNamespace enforces the ownership rule. Two namespaces exist and they cannot collide, since an address is 40 characters and a name caps at 39: - an address namespace ("g1.../forge") belongs to that account, always, with nothing to register and nothing to lose; - a name namespace ("moul/forge") belongs to whoever holds that name in r/sys/users, including through a rename, since the lookup resolves aliases to the same record. A realm caller passes the same way a user does, which is what makes a DAO-owned repo possible: the DAO's address is its namespace.

Open
OID
0cf8c3…d559:15
requireNamespace details

Inspect func

splitList

func(s string) []string

splitList parses the comma-separated lists the transaction API has to use: gnokey can only pass strings, so a \[]string parameter would not be callable.

Open
OID
0cf8c3…d559:17
splitList details

Inspect func

CreateRepo

func(id string, description string, defaultRef string)

CreateRepo registers "\<namespace>/\<name>" with the caller as owner. defaultRef may be empty for refs/heads/main. The namespace must be one the caller owns: an r/sys/users name registered to their address, or their own bech32 address. Nobody squats anybody.

Open
OID
0cf8c3…d559:18
CreateRepo details

Inspect func

Fork

func(srcID string, newID string)

Fork registers newID as a fork of srcID, snapshotting the parent's current refs into the fork's log so the lineage records exactly what was forked.

Open
OID
0cf8c3…d559:19
Fork details

Inspect func

SetDescription

func(repoID string, description string)

SetDescription updates the repo description (admin).

Open
OID
0cf8c3…d559:20
SetDescription details

Inspect func

SetMirrors

func(repoID string, mirrors string)

SetMirrors replaces the fetch locators, comma-separated, first one canonical (maintainer). The chain records them; it never fetches.

Open
OID
0cf8c3…d559:21
SetMirrors details

Inspect func

SetDefaultRef

func(repoID string, name string)

SetDefaultRef points the repo at another default branch (maintainer).

Open
OID
0cf8c3…d559:22
SetDefaultRef details

Inspect func

SetPolicy

func(repoID string, requiredApprovals int, allowSelfApproval bool)

SetPolicy sets how many writer approvals a change needs, and whether the author's own approval counts (admin).

Open
OID
0cf8c3…d559:23
SetPolicy details

Inspect func

SetMember

func(repoID string, member .uverse.address, role string)

SetMember grants a role: none, reader, writer, maintainer, admin, owner.

Open
OID
0cf8c3…d559:24
SetMember details

Inspect func

SetArchived

func(repoID string, archived bool)

SetArchived freezes or unfreezes a repo (admin). The log stays readable.

Open
OID
0cf8c3…d559:25
SetArchived details

Inspect func

SetRef

func(repoID string, name string, expectedOID string, newOID string, note string)

SetRef moves a ref by compare-and-swap (writer). expectedOID is the tip the caller last saw, empty to create. A stale expectation aborts instead of overwriting: git's --force-with-lease, with consensus holding the lease.

Open
OID
0cf8c3…d559:26
SetRef details

Inspect func

ForceSetRef

func(repoID string, name string, newOID string, note string)

ForceSetRef moves a ref with no expectation (maintainer). It is not forbidden, it is recorded as a force, in a log nobody can rewrite.

Open
OID
0cf8c3…d559:27
ForceSetRef details

Inspect func

DeleteRef

func(repoID string, name string, expectedOID string, note string)

DeleteRef removes a ref by compare-and-swap (maintainer). The default branch is not deletable.

Open
OID
0cf8c3…d559:28
DeleteRef details

Inspect func

emitRef

func(repoID string, e *v0.LogEntry)
Open
OID
0cf8c3…d559:29
emitRef details

Inspect func

OpenIssue

func(repoID string, title string, body string, labels string) int64

OpenIssue files an issue. Permissionless: the author pays for their bytes. labels is comma-separated. Returns the issue id.

Open
OID
0cf8c3…d559:30
OpenIssue details

Inspect func

CommentIssue

func(repoID string, issueID int64, body string)

CommentIssue appends a reply.

Open
OID
0cf8c3…d559:31
CommentIssue details

Inspect func

CloseIssue

func(repoID string, issueID int64)

CloseIssue closes an issue (author or maintainer).

Open
OID
0cf8c3…d559:32
CloseIssue details

Inspect func

ReopenIssue

func(repoID string, issueID int64)

ReopenIssue reopens an issue (author or maintainer).

Open
OID
0cf8c3…d559:33
ReopenIssue details

Inspect func

SetIssueLabels

func(repoID string, issueID int64, labels string)

SetIssueLabels replaces an issue's labels, comma-separated (maintainer).

Open
OID
0cf8c3…d559:34
SetIssueLabels details

Inspect func

OpenChange

func(repoID string, title string, body string, sourceRepo string, sourceRef string, headOID string, targetRef string) int64

OpenChange proposes moving targetRef to include headOID. sourceRepo may be another forge repo id, a mirror locator, or empty for this repo. Returns the change id.

Open
OID
0cf8c3…d559:35
OpenChange details

Inspect func

UpdateChangeHead

func(repoID string, changeID int64, headOID string)

UpdateChangeHead repoints an open change at a new object (author or writer). Every approval of the previous head stops counting, by construction.

Open
OID
0cf8c3…d559:36
UpdateChangeHead details

Inspect func

ReviewChange

func(repoID string, changeID int64, verdict string, body string)

ReviewChange records a verdict: approve, request-changes, comment: against the change's current head. Anyone may review; a writer's approval counts.

Open
OID
0cf8c3…d559:37
ReviewChange details

Inspect func

CommentChange

func(repoID string, changeID int64, body string)

CommentChange appends a reply to a change request.

Open
OID
0cf8c3…d559:38
CommentChange details

Inspect func

CloseChange

func(repoID string, changeID int64)

CloseChange withdraws or rejects a change (author or maintainer).

Open
OID
0cf8c3…d559:39
CloseChange details

Inspect func

MergeChange

func(repoID string, changeID int64, expectedTargetOID string, mergedOID string, note string)

MergeChange moves the target ref to mergedOID and records the move as a merge entry naming the change (maintainer). expectedTargetOID is a compare-and-swap on the target: a change approved against a base that has moved is refused, not silently rebased.

Open
OID
0cf8c3…d559:40
MergeChange details

Inspect func

RefOID

func(repoID string, name string) string

RefOID returns the object a ref points at, or "" if there is no such ref.

Open
OID
0cf8c3…d559:41
RefOID details

Inspect func

LogHead

func(repoID string) string

LogHead returns the repo's chain digest: pin it off chain and the whole history of every ref becomes falsifiable.

Open
OID
0cf8c3…d559:42
LogHead details

Inspect func

HasRepo

func(repoID string) bool

HasRepo reports whether a repo id is registered.

Open
OID
0cf8c3…d559:43
HasRepo details

Inspect func

RepoCount

func() int

RepoCount is the number of repos on this forge.

Open
OID
0cf8c3…d559:44
RepoCount details

Inspect func

pageSize

untyped bigint

pageSize bounds every listing: a Render that walks unbounded state is a Render that eventually stops rendering.

Value

(20 <untyped> bigint)

Render

func(path string) string

Render routes gnoweb paths: / the forge: every repo /<ns>/<name> repo overview /<ns>/<name>/log the full reference log (?page=N) /<ns>/<name>/issues issues (?page=N) /<ns>/<name>/issues/<id> one issue and its replies /<ns>/<name>/changes change requests (?page=N) /<ns>/<name>/changes/<id> one change, its reviews and its replies /help what this realm is and how to call it

Open
OID
0cf8c3…d559:45
Render details

Inspect func

renderRepo

func(r *v0.Repo) string
Open
OID
0cf8c3…d559:48
renderRepo details

Inspect func

renderLog

func(r *v0.Repo, page int) string
Open
OID
0cf8c3…d559:49
renderLog details

Inspect func

renderIssues

func(r *v0.Repo, page int) string
Open
OID
0cf8c3…d559:50
renderIssues details

Inspect func

renderIssue

func(r *v0.Repo, raw string) string
Open
OID
0cf8c3…d559:51
renderIssue details

Inspect func

renderChanges

func(r *v0.Repo, page int) string
Open
OID
0cf8c3…d559:52
renderChanges details

Inspect func

renderChange

func(r *v0.Repo, raw string) string
Open
OID
0cf8c3…d559:53
renderChange details

Inspect func

logList

func(r *v0.Repo, offset int, count int) string
Open
OID
0cf8c3…d559:55
logList details

Inspect func

issueList

func(r *v0.Repo, offset int, count int, openOnly bool) string
Open
OID
0cf8c3…d559:56
issueList details

Inspect func

changeList

func(r *v0.Repo, offset int, count int, openOnly bool) string
Open
OID
0cf8c3…d559:57
changeList details

Inspect func

pager

func(total int, page int, path string) string
Open
OID
0cf8c3…d559:58
pager details

Inspect func

issueURL

func(id string, n int64) string
Open
OID
0cf8c3…d559:61
issueURL details

Inspect func

changeURL

func(id string, n int64) string
Open
OID
0cf8c3…d559:62
changeURL details

Inspect func

notFound

func(why string) string
Open
OID
0cf8c3…d559:65
notFound details

Inspect func

state

func(ok bool, yes string, no string) string
Open
OID
0cf8c3…d559:66
state details

Inspect func

refOID

func(r *v0.Repo, name string) string
Open
OID
0cf8c3…d559:68
refOID details

Inspect func

oidCode

func(oid string) string

oidCode shows the short object id, code-spanned. An empty id renders as "(none)": that is a ref being created or deleted, not a zero object.

Open
OID
0cf8c3…d559:69
oidCode details

Inspect func

shortDigest

func(d string) string
Open
OID
0cf8c3…d559:70
shortDigest details

Inspect func

mirrorRest

func(mirrors []string) string
Open
OID
0cf8c3…d559:71
mirrorRest details

Inspect func

refSuffix

func(ref string) string
Open
OID
0cf8c3…d559:72
refSuffix details

Inspect func

codeList

func(items []string) string
Open
OID
0cf8c3…d559:73
codeList details

Inspect func
errForeignNamespace : *errors.errorString Inspect
f : *v0.Forge Inspect
caller : func() .uverse.address Inspect
height : func() int64 Inspect
repo : func(id string) *v0.Repo Inspect
requireNamespace : func(a .uverse.address, id string) Inspect
must : func(err .uverse.error) Inspect
splitList : func(s string) []string Inspect
CreateRepo : func(id string, description string, defaultRef string) Inspect
Fork : func(srcID string, newID string) Inspect
SetDescription : func(repoID string, description string) Inspect
SetMirrors : func(repoID string, mirrors string) Inspect
SetDefaultRef : func(repoID string, name string) Inspect
SetPolicy : func(repoID string, requiredApprovals int, allowSelfApproval bool) Inspect
SetMember : func(repoID string, member .uverse.address, role string) Inspect
SetArchived : func(repoID string, archived bool) Inspect
SetRef : func(repoID string, name string, expectedOID string, newOID string, note string) Inspect
ForceSetRef : func(repoID string, name string, newOID string, note string) Inspect
DeleteRef : func(repoID string, name string, expectedOID string, note string) Inspect
emitRef : func(repoID string, e *v0.LogEntry) Inspect
OpenIssue : func(repoID string, title string, body string, labels string) int64 Inspect
CommentIssue : func(repoID string, issueID int64, body string) Inspect
CloseIssue : func(repoID string, issueID int64) Inspect
ReopenIssue : func(repoID string, issueID int64) Inspect
SetIssueLabels : func(repoID string, issueID int64, labels string) Inspect
OpenChange : func(repoID string, title string, body string, sourceRepo string, sourceRef string, headOID string, targetRef string) int64 Inspect
UpdateChangeHead : func(repoID string, changeID int64, headOID string) Inspect
ReviewChange : func(repoID string, changeID int64, verdict string, body string) Inspect
CommentChange : func(repoID string, changeID int64, body string) Inspect
CloseChange : func(repoID string, changeID int64) Inspect
MergeChange : func(repoID string, changeID int64, expectedTargetOID string, mergedOID string, note string) Inspect
RefOID : func(repoID string, name string) string Inspect
LogHead : func(repoID string) string Inspect
HasRepo : func(repoID string) bool Inspect
RepoCount : func() int Inspect
pageSize : untyped bigint =(20 <untyped> bigint)
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderRepo : func(r *v0.Repo) string Inspect
renderLog : func(r *v0.Repo, page int) string Inspect
renderIssues : func(r *v0.Repo, page int) string Inspect
renderIssue : func(r *v0.Repo, raw string) string Inspect
renderChanges : func(r *v0.Repo, page int) string Inspect
renderChange : func(r *v0.Repo, raw string) string Inspect
renderHelp : func() string Inspect
logList : func(r *v0.Repo, offset int, count int) string Inspect
issueList : func(r *v0.Repo, offset int, count int, openOnly bool) string Inspect
changeList : func(r *v0.Repo, offset int, count int, openOnly bool) string Inspect
pager : func(total int, page int, path string) string Inspect
base : func() string Inspect
repoURL : func(id string) string Inspect
issueURL : func(id string, n int64) string Inspect
changeURL : func(id string, n int64) string Inspect
notFound : func(why string) string Inspect
state : func(ok bool, yes string, no string) string Inspect
onOff : func(b bool) string Inspect
refOID : func(r *v0.Repo, name string) string Inspect
oidCode : func(oid string) string Inspect
shortDigest : func(d string) string Inspect
mirrorRest : func(mirrors []string) string Inspect
refSuffix : func(ref string) string Inspect
codeList : func(items []string) string Inspect
pageOf : func(req *v0.Request) int Inspect
itoa : func(n int64) string Inspect