test

package
v0.0.0-...-bb38180 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

type GraphQLResponse struct {
	Content string
	Err     error
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL