Documentation
¶
Overview ¶
Package nodeid encodes and decodes the opaque identifiers Githome uses for the GraphQL `id` field and the REST `node_id` field.
Two formats are supported. The legacy format is base64(standard) of "<lenprefix>:<TypeName><dbid>", matching the historical GitHub scheme. The new format is "<prefix>_" followed by base64(url, no padding) of a compact binary payload. Clients treat node IDs as opaque, so the only hard contract is that Decode inverts Encode for both formats:
Decode(Encode(kind, dbID, format)) == (kind, dbID)
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("nodeid: invalid node id")
ErrInvalid is returned when a node ID cannot be decoded.
Functions ¶
func DecodeGitObject ¶
DecodeGitObject recovers the type tag, repository database id, and object id from a git-object node ID.
Types ¶
type Kind ¶
type Kind int
Kind enumerates the node-bearing resource types.
const ( KindUser Kind = iota KindOrganization KindRepository KindIssue KindPullRequest KindIssueComment KindPullRequestReview KindPullRequestReviewComment KindPullRequestReviewThread KindCheckRun KindCheckSuite KindStatusContext KindLabel KindMilestone KindCommit KindReaction KindRelease KindReleaseAsset KindGist KindGistComment KindTeam KindApp KindIssueEvent )
The node-bearing resource kinds, in registry order.