Documentation
¶
Index ¶
- Constants
- func MakeStatusMessage(context string, state State, URL, description string) message.Composer
- func MakeStatusMessageWithRepo(status Status) message.Composer
- func NewCommentSender(name string, issueID int, opts *GithubOptions) (send.Sender, error)
- func NewIssueSender(name string, opts *GithubOptions) (send.Sender, error)
- func NewStatusMessage(p level.Priority, context string, state State, URL, description string) message.Composer
- func NewStatusMessageWithRepo(p level.Priority, status Status) message.Composer
- func NewStatusSender(name string, opts *GithubOptions, ref string) send.Sender
- type GithubOptions
- type State
- type Status
Constants ¶
const ( StatePending = State("pending") StateSuccess = State("success") StateError = State("error") StateFailure = State("failure") )
The list of valid states for Github Status API requests
Variables ¶
This section is empty.
Functions ¶
func MakeStatusMessage ¶
MakeStatusMessage creates a composer for sending payloads to the Github Status API without setting a priority
func MakeStatusMessageWithRepo ¶
MakeStatusMessageWithRepo creates a composer for sending payloads to the Github Status API, with the repository and ref stored in the composer
func NewCommentSender ¶
NewCommentSender creates a new Sender implementation that adds a comment to a github issue (or pull request) for every log message sent.
Specify the credentials to use the GitHub via the GithubOptions structure, and the issue number as an argument to the constructor.
func NewIssueSender ¶
func NewIssueSender(name string, opts *GithubOptions) (send.Sender, error)
NewIssuesLogger builds a sender implementation that creates a new issue in a Github Project for each log message.
func NewStatusMessage ¶
func NewStatusMessage(p level.Priority, context string, state State, URL, description string) message.Composer
NewStatusMessage creates a composer for sending payloads to the Github Status API.
func NewStatusMessageWithRepo ¶
NewStatusMessageWithRepo creates a composer for sending payloads to the Github Status API, with the repository and ref stored in the composer
func NewStatusSender ¶
func NewStatusSender(name string, opts *GithubOptions, ref string) send.Sender
NewStatusSender returns a Sender to send payloads to the Github Status API. Statuses will be attached to the given ref.
Types ¶
type GithubOptions ¶
GithubOptions contains information about a github account and repository, used in the GithubIssuesLogger and the GithubCommentLogger Sender implementations.
type State ¶
type State string
State represents the 4 valid states for the Github State API in a safer way
type Status ¶
type Status struct { Owner string `bson:"owner,omitempty" json:"owner,omitempty" yaml:"owner,omitempty"` Repo string `bson:"repo,omitempty" json:"repo,omitempty" yaml:"repo,omitempty"` Ref string `bson:"ref,omitempty" json:"ref,omitempty" yaml:"ref,omitempty"` Context string `bson:"context" json:"context" yaml:"context"` State State `bson:"state" json:"state" yaml:"state"` URL string `bson:"url" json:"url" yaml:"url"` Description string `bson:"description" json:"description" yaml:"description"` }
Status is a message to be posted to Github's Status API