Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProwEventType = "prow.k8s.io/pubsub.EventType" PeriodicProwJobEvent = "prow.k8s.io/pubsub.PeriodicProwJobEvent" PresubmitProwJobEvent = "prow.k8s.io/pubsub.PresubmitProwJobEvent" PostsubmitProwJobEvent = "prow.k8s.io/pubsub.PostsubmitProwJobEvent" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct { // Common MessageCounter *prometheus.CounterVec ErrorCounter *prometheus.CounterVec // Pull Server ACKMessageCounter *prometheus.CounterVec NACKMessageCounter *prometheus.CounterVec // Push Server ResponseCounter *prometheus.CounterVec }
func NewMetrics ¶
func NewMetrics() *Metrics
type ProwJobEvent ¶
type ProwJobEvent struct { Name string `json:"name"` // Refs are used by presubmit and postsubmit jobs supplying baseSHA and SHA Refs *prowcrd.Refs `json:"refs,omitempty"` Envs map[string]string `json:"envs,omitempty"` Labels map[string]string `json:"labels,omitempty"` Annotations map[string]string `json:"annotations,omitempty"` }
ProwJobEvent contains the minimum information required to start a ProwJob.
func (*ProwJobEvent) FromPayload ¶
func (pe *ProwJobEvent) FromPayload(data []byte) error
FromPayload set the ProwJobEvent from the PubSub message payload.
func (*ProwJobEvent) ToMessage ¶
func (pe *ProwJobEvent) ToMessage() (*pubsub.Message, error)
ToMessage generates a PubSub Message from a ProwJobEvent.
func (*ProwJobEvent) ToMessageOfType ¶
func (pe *ProwJobEvent) ToMessageOfType(t string) (*pubsub.Message, error)
ToMessage generates a PubSub Message from a ProwJobEvent.
type PullServer ¶
type PullServer struct { Subscriber *Subscriber Client pubsubClientInterface }
PullServer listen to Pull Pub/Sub subscriptions and handle them.
func NewPullServer ¶
func NewPullServer(s *Subscriber) *PullServer
NewPullServer creates a new PullServer
type Subscriber ¶
type Subscriber struct { ConfigAgent *config.Agent Metrics *Metrics ProwJobClient gangway.ProwJobClient Reporter reportClient InRepoConfigGetter config.InRepoConfigGetter }
Subscriber handles Pub/Sub subscriptions, update metrics, validates them using Prow Configuration and use a ProwJobClient to create Prow Jobs.
Click to show internal directories.
Click to hide internal directories.