Documentation
¶
Index ¶
- type FakeGitHubRESTClient
- func (f *FakeGitHubRESTClient) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ghrest.ListOptions) (*ghrest.CommitsComparison, *ghrest.Response, error)
- func (f *FakeGitHubRESTClient) RegisterCommitComparison(queryKey RESTCommitComparisonQueryKey, response *RESTCommitComparisonResponse)
- type FakeGraphQLClient
- type GraphQLQueryKey
- type GraphQLQueryKeyExtra
- type GraphQLResponse
- type RESTCommitComparisonQueryKey
- type RESTCommitComparisonResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeGitHubRESTClient ¶
type FakeGitHubRESTClient struct {
// contains filtered or unexported fields
}
FakeGitHubRESTClient is a mock REST API client that stores responses in-memory.
func NewFakeGitHubRESTClient ¶
func NewFakeGitHubRESTClient() *FakeGitHubRESTClient
NewFakeGitHubRESTClient initializes an in-memory fake REST client.
func (*FakeGitHubRESTClient) CompareCommits ¶
func (f *FakeGitHubRESTClient) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ghrest.ListOptions) (*ghrest.CommitsComparison, *ghrest.Response, error)
CompareCommits returns the registered response or an error.
func (*FakeGitHubRESTClient) RegisterCommitComparison ¶
func (f *FakeGitHubRESTClient) RegisterCommitComparison(queryKey RESTCommitComparisonQueryKey, response *RESTCommitComparisonResponse)
RegisterCommitComparison registers a commit comparison response.
type FakeGraphQLClient ¶
type FakeGraphQLClient struct {
// contains filtered or unexported fields
}
FakeGraphQLClient is a mock implementation of the GitHub GraphQL API client.
func NewFakeGraphQLClient ¶
func NewFakeGraphQLClient() *FakeGraphQLClient
NewFakeGraphQLClient initializes an in-memory fake GraphQL client.
func (*FakeGraphQLClient) Query ¶
func (c *FakeGraphQLClient) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error
Query returns the registered response or an error.
func (*FakeGraphQLClient) RegisterResponse ¶
func (c *FakeGraphQLClient) RegisterResponse(queryKey GraphQLQueryKey, response *GraphQLResponse)
RegisterResponse registers a GraphQL response for a query type.
type GraphQLQueryKey ¶
type GraphQLQueryKey struct {
QueryType string
RepoOwner string
RepoName string
EndCursor string
Extra GraphQLQueryKeyExtra
}
GraphQLQueryKey uniquely identifies a GraphQL query request.
type GraphQLQueryKeyExtra ¶
type GraphQLQueryKeyExtra struct {
Environments string
}
GraphQLQueryKeyExtra holds extra request query variables.
type GraphQLResponse ¶
GraphQLResponse represents a stored response for a GraphQL query, containing the raw JSON content and any associated error.
type RESTCommitComparisonQueryKey ¶
type RESTCommitComparisonQueryKey struct {
RepoOwner string
RepoName string
Base string
Head string
Page int
}
RESTCommitComparisonQueryKey uniquely identifies a CompareCommits request.
type RESTCommitComparisonResponse ¶
type RESTCommitComparisonResponse struct {
Comparison *ghrest.CommitsComparison
APIResponse *ghrest.Response
Err error
}
CommitComparisonResponse stores the API response for CompareCommits.