Documentation
¶
Index ¶
- Constants
- func CollectTargetLabels(labels []string) []string
- func CollectTargetLikeLabels(labels []string) []string
- func HasExactTarget(labels []string, nodeName string) bool
- func ParseTargetLabel(label string) (string, bool)
- func TargetLabelForNode(nodeName string) string
- func ValidateCompatibility(protocolVersion, daemonVersion, minDaemonVersion string) error
- func ValidateNodeName(value string) error
- type AuditEnvelope
- type CoordinatorLease
- type CoordinatorLeaseAcquireRequest
- type CoordinatorLeaseHandoffRequest
- type CoordinatorLeaseRenewRequest
- type CoordinatorLeaseRevalidateRequest
- type ExactTargetPlan
- type GitHubIdentity
- type HeartbeatRequest
- type HeartbeatResponse
- type JoinRequest
- type JoinResponse
- type Membership
- type NodeCapabilities
- type NodeStatusResponse
- type ReviewerProjectCapability
- type StatusResponse
- type WebhookHealth
Constants ¶
View Source
const ( CurrentVersion = "loopernet/v1" DefaultLeaseName = "coordinator" DefaultLeaseTTL = 30 * time.Second MinimumDaemonField = "daemonVersion" TargetLabelPrefix = "looper:target:" )
Variables ¶
This section is empty.
Functions ¶
func CollectTargetLabels ¶
func CollectTargetLikeLabels ¶
func HasExactTarget ¶
func ParseTargetLabel ¶
func TargetLabelForNode ¶
func ValidateCompatibility ¶
func ValidateNodeName ¶
Types ¶
type AuditEnvelope ¶
type AuditEnvelope struct {
Event string `json:"event"`
Actor string `json:"actor"`
OccurredAt time.Time `json:"occurredAt"`
NetworkID string `json:"networkId,omitempty"`
NodeID string `json:"nodeId,omitempty"`
LeaseName string `json:"leaseName,omitempty"`
LeaseToken int64 `json:"leaseToken,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
WarningText []string `json:"warnings,omitempty"`
}
type CoordinatorLease ¶
type CoordinatorLeaseAcquireRequest ¶
type CoordinatorLeaseAcquireRequest struct {
TTLSeconds int `json:"ttlSeconds,omitempty"`
}
type ExactTargetPlan ¶
type ExactTargetPlan struct {
DesiredLabel string `json:"desiredLabel,omitempty"`
Current []string `json:"current,omitempty"`
Add []string `json:"add,omitempty"`
Remove []string `json:"remove,omitempty"`
}
func PlanExactTarget ¶
func PlanExactTarget(labels []string, nodeName string) (ExactTargetPlan, error)
type GitHubIdentity ¶
type HeartbeatRequest ¶
type HeartbeatRequest struct {
ProtocolVersion string `json:"protocolVersion"`
DaemonVersion string `json:"daemonVersion"`
NodeName string `json:"nodeName"`
GitHub GitHubIdentity `json:"github"`
Capabilities NodeCapabilities `json:"capabilities"`
}
type HeartbeatResponse ¶
type JoinRequest ¶
type JoinResponse ¶
type Membership ¶
type Membership struct {
NodeID string `json:"nodeId"`
NodeName string `json:"nodeName"`
GitHub GitHubIdentity `json:"github"`
Capabilities NodeCapabilities `json:"capabilities"`
TargetLabels []string `json:"targetLabels,omitempty"`
JoinedAt time.Time `json:"joinedAt"`
LastHeartbeatAt *time.Time `json:"lastHeartbeatAt,omitempty"`
DuplicateWarning bool `json:"duplicateGithubIdentityWarning,omitempty"`
}
type NodeCapabilities ¶
type NodeCapabilities struct {
Roles []string `json:"roles,omitempty"`
CoordinatorEligible bool `json:"coordinatorEligible"`
RoutedProjects int `json:"routedProjects"`
RoutedProjectIDs []string `json:"routedProjectIds,omitempty"`
ReviewerProjects []ReviewerProjectCapability `json:"reviewerProjects,omitempty"`
LocalProjects int `json:"localProjects"`
DynamicLoad int `json:"dynamicLoad"`
IdentityDrift bool `json:"identityDrift"`
DriftReason string `json:"driftReason,omitempty"`
}
type NodeStatusResponse ¶
type NodeStatusResponse struct {
NetworkID string `json:"networkId"`
Membership Membership `json:"membership"`
Memberships []Membership `json:"memberships,omitempty"`
Lease CoordinatorLease `json:"lease"`
Webhook WebhookHealth `json:"webhook"`
Warnings []string `json:"warnings,omitempty"`
CloudReachable bool `json:"cloudReachable"`
CurrentGitHub GitHubIdentity `json:"currentGithub"`
IdentityDrift bool `json:"identityDrift"`
IdentityDriftReason string `json:"identityDriftReason,omitempty"`
}
type ReviewerProjectCapability ¶
type ReviewerProjectCapability struct {
ProjectID string `json:"projectId"`
IncludeDrafts bool `json:"includeDrafts"`
RequireReviewRequest *bool `json:"requireReviewRequest,omitempty"`
EnableSelfReview bool `json:"enableSelfReview"`
Labels []string `json:"labels,omitempty"`
LabelMode string `json:"labelMode,omitempty"`
}
type StatusResponse ¶
type StatusResponse struct {
NetworkID string `json:"networkId"`
Lease CoordinatorLease `json:"lease"`
Memberships []Membership `json:"memberships"`
Webhook WebhookHealth `json:"webhook"`
Warnings []string `json:"warnings,omitempty"`
}
type WebhookHealth ¶
type WebhookHealth struct {
DeliveriesReceived int `json:"deliveriesReceived"`
LastDeliveryAt *time.Time `json:"lastDeliveryAt,omitempty"`
LastDeliveryID string `json:"lastDeliveryId,omitempty"`
LastEvent string `json:"lastEvent,omitempty"`
LastRepo string `json:"lastRepo,omitempty"`
EventSubscribers int `json:"eventSubscribers"`
}
Click to show internal directories.
Click to hide internal directories.