wlgenerator

package
v0.0.0-...-6cdb919 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebhookSecretHeader      = "X-Horizon-Webhook-Secret"
	WebhookContentTypeHeader = "Content-Type"
	WebhookContentType       = "application/json;charset=utf-8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInfo

type ApplicationInfo struct {
	ResourceCommonInfo
	Priority string `json:"priority,omitempty"`
}

ApplicationInfo contains basic info of application

type ClusterInfo

type ClusterInfo struct {
	ResourceCommonInfo
	ApplicationName string `json:"applicationName,omitempty"`
	Env             string `json:"env,omitempty"`
}

ClusterInfo contains basic info of cluster

type MemberInfo

type MemberInfo struct {
	ResourceCommonInfo
	ResourceID   uint                      `json:"resourceID"`
	ResourceType membermodels.ResourceType `json:"resourceType"`
	Role         string                    `json:"role"`
	MemberNameID uint                      `json:"memberNameID"`
	MemberName   string                    `json:"memberName"`
}

MemberInfo contains basic info of member

type MessageContent

type MessageContent struct {
	ID          uint                  `json:"id,omitempty"`
	EventID     uint                  `json:"eventID,omitempty"`
	WebhookID   uint                  `json:"webhookID,omitempty"`
	Application *ApplicationInfo      `json:"application,omitempty"`
	Cluster     *ClusterInfo          `json:"cluster,omitempty"`
	Pipelinerun *PipelinerunInfo      `json:"pipelinerun,omitempty"`
	Member      *MemberInfo           `json:"member,omitempty"`
	EventType   string                `json:"eventType,omitempty"`
	User        *usermodels.UserBasic `json:"user,omitempty"`
	Extra       *string               `json:"extra,omitempty"`
}

MessageContent will be marshaled as webhook request body

type PipelinerunInfo

type PipelinerunInfo struct {
	ResourceCommonInfo
	ClusterID   uint   `json:"clusterID,omitempty"`
	ClusterName string `json:"clusterName,omitempty"`
	Action      string `json:"action,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	GitRef      string `json:"gitRef,omitempty"`
	GitRefType  string `json:"gitRefType,omitempty"`
}

PipelinerunInfo contains basic info of pipelinerun

type ResourceCommonInfo

type ResourceCommonInfo struct {
	ID   uint   `json:"id"`
	Name string `json:"name,omitempty"`
}

type WebhookLogGenerator

type WebhookLogGenerator struct {
	// contains filtered or unexported fields
}

WebhookLogGenerator generates webhook logs by events

func NewWebhookLogGenerator

func NewWebhookLogGenerator(manager *managerparam.Manager) *WebhookLogGenerator

func (*WebhookLogGenerator) Process

func (w *WebhookLogGenerator) Process(ctx context.Context, events []*models.Event,
	resume bool) error

Process processes all the webhook logs that are in waiting status and send webhook requests

Jump to

Keyboard shortcuts

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