clients

package
v0.0.0-...-ea9d009 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: Apache-2.0 Imports: 17 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubClient

type GitHubClient interface {
	ListIssues() ([]github.Issue, error)
	ListComments(issue github.Issue) ([]*github.IssueComment, error)
	GetUser(login string) (github.User, error)
	GetRateLimits() (github.RateLimits, error)
}

GitHubClient is a wrapper around the GitHub API Client library we use. It allows us to swap in other implementations, such as a dry run clients, or mock clients for testing.

func NewGitHubClient

func NewGitHubClient(config cfg.Config) (GitHubClient, error)

NewGitHubClient creates a GitHubClient and returns it; which implementation it uses depends on the configuration of this run. For example, a dry-run clients may be created which does not make any requests that would change anything on the server, but instead simply prints out the actions that it's asked to take.

type JIRAClient

type JIRAClient interface {
	ListIssues(ids []int) ([]jira.Issue, error)
	GetIssue(key string) (jira.Issue, error)
	CreateIssue(issue jira.Issue) (jira.Issue, error)
	UpdateIssue(issue jira.Issue) (jira.Issue, error)
	CreateComment(issue jira.Issue, comment github.IssueComment, github GitHubClient) (jira.Comment, error)
	UpdateComment(issue jira.Issue, id string, comment github.IssueComment, github GitHubClient) (jira.Comment, error)
}

JIRAClient is a wrapper around the JIRA API clients library we use. It allows us to hide implementation details such as backoff as well as swap in other implementations, such as for dry run or test mocking.

func NewJIRAClient

func NewJIRAClient(config *cfg.Config) (JIRAClient, error)

NewJIRAClient creates a new JIRAClient and configures it with the config object provided. The type of clients created depends on the configuration; currently, it creates either a standard clients, or a dry-run clients.

Jump to

Keyboard shortcuts

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