{"modulePath":"github.com/alexgorbatchev/issue-tracker-cli","version":"v1.9.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package fakegithub\n\nPackage fakegithub is an in-process GitHub for tests. It answers requests by substring match and records them, so tests can assert API call budgets.\n\n## Types\n\n```go\ntype GitHub struct {\n\t// contains filtered or unexported fields\n}\n```\nGitHub implements http.RoundTripper.\n\n```go\nfunc New(routes ...Route) *GitHub\n```\nNew returns a GitHub answering with routes, checked in order.\n\n```go\nfunc (g *GitHub) Add(routes ...Route)\n```\nAdd appends routes.\n\n```go\nfunc (g *GitHub) Count() int\n```\nCount returns how many calls were made.\n\n```go\nfunc (g *GitHub) Requests() []Request\n```\nRequests returns every recorded call.\n\n```go\nfunc (g *GitHub) RoundTrip(req *http.Request) (*http.Response, error)\n```\nRoundTrip records the request and returns the first matching route's response.\n\n```go\ntype Request struct {\n\tDescription string\n\tVariables   map[string]any\n\tHeader      http.Header\n\tBody        string\n}\n```\nRequest is one recorded call.\n\n```go\ntype Route struct {\n\tMatch   string\n\tStatus  int\n\tBody    string\n\tHeaders map[string]string\n\t// Times limits how often the route answers; zero means without limit.\n\tTimes int\n}\n```\nRoute answers requests whose description contains Match. The description is the GraphQL query for GraphQL calls, and \"METHOD host/path\" for everything else.\n\n","path":"github.com/alexgorbatchev/issue-tracker-cli/internal/fakegithub","name":"fakegithub","synopsis":"Package fakegithub is an in-process GitHub for tests.","isRedistributable":true}
