Documentation
¶
Index ¶
Constants ¶
const StatusID string = "flux-status"
StatusID is a project specific identifier to avoid conflicts in the commit status.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureDevops ¶
type AzureDevops struct {
// contains filtered or unexported fields
}
AzureDevops handles events for AzureDevops repositories.
func NewAzureDevops ¶
func NewAzureDevops(inst string, url string, pat string) (*AzureDevops, error)
NewAzureDevops creates and returns an AzureDevops instance.
func (AzureDevops) Get ¶
func (azdo AzureDevops) Get(commitID string, action string) (*Status, error)
Get returns the status of a given commit id in a AzureDevops repository.
func (AzureDevops) Send ¶
func (azdo AzureDevops) Send(ctx context.Context, e Event) error
Send sets the status for a given commit id in a AzureDevops repository.
func (AzureDevops) String ¶
func (AzureDevops) String() string
String returns the name of the struct.
type Event ¶
type Event struct {
Type EventType
Message string
CommitID string
State EventState
}
Event wraps information about a specific event occurence.
type EventState ¶
type EventState string
EventState represents the different states an event can be in.
const ( // EventStateFailed occurs when an action has failed. EventStateFailed EventState = "failed" // EventStatePending occurs when an event is not yet completed. EventStatePending EventState = "pending" // EventStateSucceeded occurs when an event has completed successfully. EventStateSucceeded EventState = "succeeded" // EventStateCanceled occurs when an event has been preemptively canceled. EventStateCanceled EventState = "canceled" )
These constants represents all valid EventState values.
type EventType ¶
type EventType string
EventType represents the different types of actions an event can occur for.
type GitHub ¶ added in v0.2.0
GitHub handles events for Github repositories.
func (GitHub) Get ¶ added in v0.2.0
Get returns the status of a given commit id in a Github repository.
type Gitlab ¶
type Gitlab struct {
// contains filtered or unexported fields
}
Gitlab handles events for Gitlab repositories.
type Mock ¶
type Mock struct {
Events chan Event
}
Mock implements a dummy notifier that doesn nothing.
type Notifier ¶
type Notifier interface {
Send(context.Context, Event) error
Get(string, string) (*Status, error)
String() string
}
Notifier is the interface that wraps the required methods to send events to a git provider.
func GetNotifier ¶
func GetNotifier(inst string, url string, azdoPat string, glToken string, ghToken string) (Notifier, error)
GetNotifier returns the best matching notifier given the configuration data. It works by attempting to create each available notifier one by one, and returns the first one that succeededs.
type Status ¶
type Status struct {
Name string `json:"name"`
State EventState `json:"state"`
}
Status represents the current status of a commit id.