webhook

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIdleConns        int = 100
	MaxIdleConnsPerHost int = 100
	IdleConnTimeout     int = 60
)
View Source
const EventName = "webhook"
View Source
const QueueWebhook = "webhook"

Variables

This section is empty.

Functions

func Process

func Process(msg *message.Message) error

func PublishEventDeployment

func PublishEventDeployment(namespaceId int64, appId int64, user string, ip string, action Action, deployment response.Resource)

func PublishEventIngress

func PublishEventIngress(namespaceId int64, appId int64, user string, ip string, action Action, ingress response.Resource)

func PublishEventMember

func PublishEventMember(namespaceId int64, appId int64, user string, ip string, action Action, member models.User)

func PublishEventService

func PublishEventService(namespaceId int64, appId int64, user string, ip string, action Action, service response.Resource)

func RegisterHookHandler

func RegisterHookHandler() error

Types

type Action

type Action string
const (
	AddMember         Action = "AddMember"
	DeleteMember      Action = "DeleteMember"
	UpdateMember      Action = "UpdateMember"
	UpgradeDeployment Action = "UpgradeDeployment"
	DeleteDeployment  Action = "OfflineDeployment"
	OnlineService     Action = "OnlineService"
	OfflineService    Action = "OfflineService"
	OnlineIngress     Action = "OnlineIngress"
	OfflineIngress    Action = "OfflineIngress"
)

type ClientPool

type ClientPool struct {
	Window chan struct{}
	Client *http.Client
}

type EventDeploymentPayload

type EventDeploymentPayload struct {
	Action     Action            `json:"action"`
	Deployment response.Resource `json:"deployment"`
}

type EventIngressPayload

type EventIngressPayload struct {
	Action  Action            `json:"action"`
	Ingress response.Resource `json:"ingress"`
}

type EventMemberPayload

type EventMemberPayload struct {
	Action Action        `json:"action"`
	Member response.User `json:"member"`
}

type EventServicePayload

type EventServicePayload struct {
	Action  Action            `json:"action"`
	Service response.Resource `json:"service"`
}

type Request

type Request struct {
	EventKey  string             `json:"event"`
	Namespace response.Namespace `json:"namespace"`
	App       response.App       `json:"app"`
	User      string             `json:"user"`
	IP        string             `json:"ip"`
	Datetime  time.Time          `json:"datetime"`
	Payload   interface{}        `json:"payload"`
}

type WebhookWorker

type WebhookWorker struct {
	*workers.BaseMessageWorker
	ClientPool *ClientPool
}

func NewWebhookWorker

func NewWebhookWorker(b *bus.Bus) (*WebhookWorker, error)

func (*WebhookWorker) Process

func (w *WebhookWorker) Process(msg *message.Message) error

Jump to

Keyboard shortcuts

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