Types
HubCommitMeta = object url*: Uri author*: HubContact committer*: HubContact message*: string commentCount*: int tree*: HubTree
- Source Edit
HubContact = object name*: string email*: string date*: DateTime
- Source Edit
HubKind = enum HubRelease, HubTag, HubCommit, HubRepo, HubIssue, HubPull, HubUser, HubCode
- Source Edit
HubResult = ref object htmlUrl*: Uri id*: int number*: int title*: string body*: string state*: string name*: string user*: HubResult tagName*: string targetCommitish*: string sha*: string created*: DateTime updated*: DateTime case kind*: HubKind of HubCommit: tree*: HubTree author*: HubResult committer*: HubResult parents*: seq[HubTree] commit*: HubCommitMeta of HubTag: tagger*: HubContact `object`*: HubTree of HubRelease: draft*: bool prerelease*: bool of HubUser: login*: string of HubIssue: closedBy*: HubResult of HubPull: mergedBy*: HubResult merged*: bool of HubCode: path*: string repository*: HubResult of HubRepo: fullname*: string description*: string watchers*: int stars*: int forks*: int owner*: string size*: int pushed*: DateTime issues*: int clone*: Uri git*: Uri ssh*: Uri web*: Uri license*: string branch*: string original*: bool score*: float
- Source Edit
HubSortBy {.pure.} = enum Best = "", Stars = "stars", Forks = "forks", Updated = "updated"
- Source Edit
HubVerification = object verified*: bool reason*: string signature*: string payload*: string
- Source Edit
Procs
proc findGithubToken(): Option[string] {....raises: [Exception, IOError], tags: [ReadEnvEffect, ReadIOEffect, RootEffect, ReadDirEffect].}
- find a github token in one of several places Source Edit
proc forkHub(owner: string; repo: string): Option[HubResult] {....raises: [ KeyError, Exception, IOError, ValueError, RestError, OSError, JsonParsingError, TimeParseError], tags: [RootEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect, TimeEffect, WriteIOEffect].}
- attempt to fork an existing repository Source Edit
proc getGitHubUser(): Option[HubResult] {....raises: [Exception, IOError, KeyError, RestError, ValueError, OSError, JsonParsingError, TimeParseError], tags: [ RootEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect, TimeEffect, WriteIOEffect].}
- attempt to retrieve the authorized user Source Edit
proc init(result: var HubResult; js: JsonNode) {....raises: [KeyError, Exception], tags: [RootEffect].}
- instantiate a new hub object using a jsonnode Source Edit
proc newHubCommitMeta(js: JsonNode): HubCommitMeta {. ...raises: [KeyError, TimeParseError], tags: [TimeEffect].}
- collect some ingredients found in a typical commit Source Edit
proc newHubContact(js: JsonNode): HubContact {. ...raises: [KeyError, TimeParseError], tags: [TimeEffect].}
- parse some json into a simple contact record Source Edit
proc newHubGroup(flags: set[Flag] = defaultFlags): HubGroup {....raises: [], tags: [].}
- Source Edit
proc newHubResult(kind: HubKind; js: JsonNode): HubResult {. ...raises: [KeyError, TimeParseError, Exception], tags: [TimeEffect, RootEffect].}
- Source Edit
proc newHubTree(js: JsonNode): HubTree {....raises: [KeyError], tags: [].}
- parse something like a commit tree Source Edit
proc renderShortly(r: HubResult): string {....raises: [ValueError], tags: [].}
- Source Edit
proc searchHub(keywords: seq[string]; sort = Best; order = Descending): Option[ HubGroup] {....raises: [Exception, IOError, ValueError, KeyError, RestError, OSError, JsonParsingError], tags: [RootEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect, TimeEffect, WriteIOEffect].}
- search github for packages Source Edit