amqp

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b *[]byte) *string

Types

type AmqpClient

type AmqpClient interface {
	Close() error
	PublishOnQueue(queueName QueueName, data func() []byte) (err error)
	SubscribeToQueue(ctx context.Context, logger log.Logger, call func(ctx context.Context, data string) error)
}

func NewAmqp

func NewAmqp(cf *config.Config) (AmqpClient, error)

type BuildPublishData

type BuildPublishData struct {
	Name           string `json:"name"`             // name
	Namespace      string `json:"namespace"`        // namespace
	JenkinJobName  string `json:"jenkin_job_name"`  // jenkins job name
	BuildId        int64  `json:"build_id"`         // build id
	JenkinsBuildId int64  `json:"jenkins_build_id"` // jenkins build id
	Builder        int64  `json:"builder"`          // 操作人
	Timestamp      int64  `json:"timestamp"`        //创建时间的时间戳
	Version        string `json:"version"`
}

type PublishData

type PublishData struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type QueueName

type QueueName string
const (
	CronJobTopic   QueueName = "cronjob.kplcloud"
	BuildTopic     QueueName = "build.kplcloud"
	AlarmTopic     QueueName = "alarm.kplcloud"
	NoticeTopic    QueueName = "notice.kplcloud"
	ProclaimTopic  QueueName = "proclaim.kplcloud"
	MsgWechatTopic QueueName = "msg.wechat.kplcloud"
	HookTopic      QueueName = "hook.kplcloud"
)

func (QueueName) String

func (c QueueName) String() string

Jump to

Keyboard shortcuts

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