promotion

package
v0.0.0-...-8da0845 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultStages = []string{
		"main",
		"staging",
		"canary",
		"production",
	}
)

Functions

func NewInternalError

func NewInternalError(format string, args ...any) error

Types

type Context

type Context struct {
	Logger      *slog.Logger
	EventType   any
	Owner       *string
	Repository  *string
	BaseRef     *string
	HeadRef     *string
	HeadSHA     *string
	PullRequest *github.PullRequest

	Promoter *Promoter
	ClientV3 *github.Client
	ClientV4 *githubv4.Client
}

func (*Context) LogValue

func (p *Context) LogValue() slog.Value

type InternalError

type InternalError struct {
	Cause error
}

func (*InternalError) Error

func (m *InternalError) Error() string

type Promoter

type Promoter struct {
	Stages []string
}

func NewDefaultPromoter

func NewDefaultPromoter() *Promoter

func NewDynamicPromoter

func NewDynamicPromoter(logger *slog.Logger, props map[string]string, promoterKey string) *Promoter

func NewStagePromoter

func NewStagePromoter(stages []string) *Promoter

func (*Promoter) IsPromotableRef

func (sp *Promoter) IsPromotableRef(ref string) (string, bool)

func (*Promoter) IsPromotionRequest

func (sp *Promoter) IsPromotionRequest(pr *github.PullRequest) bool

func (*Promoter) StageIndex

func (sp *Promoter) StageIndex(ref string) int

type Result

type Result struct {
	Context  *Context
	Response helpers.Response
}

Jump to

Keyboard shortcuts

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