{"modulePath":"github.com/intentdriven/abcd","version":"v0.17.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package githubpagestest\n\nPackage githubpagestest is an in-process fake of the slice of the GitHub REST API the github-pages hosting adapter calls, for tests only. The adapter speaks through the forge the way the site setup's forge stage does — \\`gh api\\` as the person who invoked the verb, never a token abcd holds — so the fake answers the adapter's API calls directly rather than over a socket, and fails them the way \\`gh api\\` does: an error naming the HTTP status.\n\nIt answers exactly these routes, and anything else is a 404:\n\n\tGET  repos/{owner}/{repo}         the repository: private, has_pages\n\tGET  repos/{owner}/{repo}/pages   the Pages site: build_type, cname, html_url\n\tPOST repos/{owner}/{repo}/pages   create the Pages site\n\tPUT  repos/{owner}/{repo}/pages   change its source or custom domain\n\n## Constants\n\n```go\nconst (\n\tGetRepo     = \"GET repo\"\n\tGetPages    = \"GET pages\"\n\tCreatePages = \"POST pages\"\n\tUpdatePages = \"PUT pages\"\n)\n```\nRoute keys name a route for Fail and for the call log.\n\n## Types\n\n```go\ntype Pages struct {\n\tBuildType string\n\tCNAME     string\n\t// HTMLURL, when set, is the address the site reports in place of the one\n\t// GitHub would derive from its domain or its repository.\n\tHTMLURL string\n}\n```\nPages is one repository's Pages site.\n\n```go\ntype Repo struct {\n\tPrivate bool\n\t// Pages is nil while the repository has no Pages site.\n\tPages *Pages\n}\n```\nRepo is one repository the fake holds.\n\n```go\ntype Server struct {\n\tMu    sync.Mutex\n\tRepos map[string]*Repo\n\t// Fail makes a route answer with this error.\n\tFail map[string]error\n\t// Calls logs each call as \"\u003croute key\u003e \u003cbody\u003e\".\n\tCalls []string\n}\n```\nServer is the fake. Its fields are the forge's state; lock Mu to read them while a call may be in flight.\n\n```go\nfunc New() *Server\n```\nNew is a fake holding one public repository, acme/widgets, with no Pages site yet.\n\n```go\nfunc (s *Server) API(_ context.Context, method, path string, body []byte) ([]byte, error)\n```\nAPI answers one call, shaped as the adapter's API.\n\n```go\nfunc (s *Server) CallLog() []string\n```\nCallLog is a copy of the calls made so far.\n\n","path":"github.com/intentdriven/abcd/internal/adapter/hosting/githubpages/githubpagestest","name":"githubpagestest","synopsis":"Package githubpagestest is an in-process fake of the slice of the GitHub REST API the github-pages hosting adapter calls, for tests only.","isRedistributable":true}
