impl

package
v0.0.0-...-69b4764 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeTiupPublishRequest = "net.pingcap.tibuild.tiup-publish-request"
	EventTypeFsPublishRequest   = "net.pingcap.tibuild.fs-publish-request"

	FromTypeOci  = "oci"
	FromTypeHTTP = "http"

	PublishStateQueued     = "queued"
	PublishStateProcessing = "processing"
	PublishStateSuccess    = "success"
	PublishStateFailed     = "failed"
	PublishStateCanceled   = "canceled"

	DefaultStateTTL            = 12 * time.Hour
	DefaultTiupNightlyInternal = 12 * time.Hour
)

Variables

This section is empty.

Functions

func NewFileserver

func NewFileserver(logger *zerolog.Logger, kafkaWriter *kafka.Writer, redisClient redis.Cmdable, eventSrc string) fileserver.Service

NewFileserver returns the fileserver service implementation.

func NewFsWorker

func NewFsWorker(logger *zerolog.Logger, redisClient redis.Cmdable, options map[string]string) (*fsWorker, error)

func NewTiup

func NewTiup(logger *zerolog.Logger, kafkaWriter *kafka.Writer, redisClient redis.Cmdable, eventSrc string) gentiup.Service

NewTiup returns the tiup service implementation.

func NewTiupWorker

func NewTiupWorker(logger *zerolog.Logger, redisClient *redis.Client, options map[string]string) (*tiupWorker, error)

Types

type From

type From struct {
	Type string    `json:"type,omitempty"`
	Oci  *FromOci  `json:"oci,omitempty"`
	HTTP *FromHTTP `json:"http,omitempty"`
}

func (From) String

func (f From) String() string

type FromHTTP

type FromHTTP struct {
	URL string `json:"url,omitempty"`
}

type FromOci

type FromOci struct {
	Repo string `json:"repo,omitempty"`
	Tag  string `json:"tag,omitempty"`
	File string `json:"file,omitempty"`
}

func (FromOci) String

func (f FromOci) String() string

type PublishInfoFS

type PublishInfoFS struct {
	Repo            string            `json:"repo,omitempty"`
	Branch          string            `json:"branch,omitempty"`
	CommitSHA       string            `json:"commit_sha,omitempty"`
	FileTransferMap map[string]string `json:"file_transfer_map,omitempty"`
}

type PublishInfoTiUP

type PublishInfoTiUP struct {
	Name        string `json:"name,omitempty"`        // tiup pkg name or component name for fileserver
	OS          string `json:"os,omitempty"`          // ignore for `EventTypeFsPublishRequest`
	Arch        string `json:"arch,omitempty"`        // ignore for `EventTypeFsPublishRequest`
	Version     string `json:"version,omitempty"`     // SemVer format for `EventTypeTiupPublishRequest` and "<git-branch>#<git-commit-sha1>" for `EventTypeFsPublishRequest`
	Description string `json:"description,omitempty"` // ignore for `EventTypeFsPublishRequest`
	EntryPoint  string `json:"entry_point,omitempty"` // if event is `EventTypeFsPublishRequest`, the the value is the basename for store file, like tidb-server.tar.gz
	Standalone  bool   `json:"standalone,omitempty"`  // ignore for `EventTypeFsPublishRequest`
}

type PublishRequestFS

type PublishRequestFS struct {
	From    From          `json:"from,omitempty"`
	Publish PublishInfoFS `json:"publish,omitempty"`
}

type PublishRequestTiUP

type PublishRequestTiUP struct {
	From    From            `json:"from,omitempty"`
	Publish PublishInfoTiUP `json:"publish,omitempty"`
}

type Worker

type Worker interface {
	Handle(event cloudevents.Event) cloudevents.Result
}

Worker provides handling for cloud events.

Jump to

Keyboard shortcuts

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