plugin

package
v0.0.0-...-cf76350 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginProvider           pluginType = "provider"
	PluginFilesUpdater       pluginType = "files_updater"
	PluginHooks              pluginType = "hooks"
	PluginChangelogGenerator pluginType = "changelog_generator"
	PluginCondition          pluginType = "ci_condition"
	PluginCommitAnalyzer     pluginType = "commit_analyzer"
)

Variables

This section is empty.

Functions

func RegisterCICondition

func RegisterCICondition(cc CICondition)

func RegisterChangelogGenerator

func RegisterChangelogGenerator(cg ChangelogGenerator)

func RegisterCommitAnalyzer

func RegisterCommitAnalyzer(ca CommitAnalyzer)

func RegisterFilesUpdater

func RegisterFilesUpdater(fu FilesUpdater)

func RegisterHooks

func RegisterHooks(h Hooks)

func RegisterProvider

func RegisterProvider(p Provider)

Types

type CICondition

type CICondition interface {
	Name() string
	Version() string
	RunCondition(map[string]string) error
	GetCurrentBranch() string
	GetCurrentSHA() string
}

type ChainedHooksExecutor

type ChainedHooksExecutor struct {
	HooksChain []Hooks
}

func (*ChainedHooksExecutor) GetNameVersionPairs

func (c *ChainedHooksExecutor) GetNameVersionPairs() []string

func (*ChainedHooksExecutor) Init

func (c *ChainedHooksExecutor) Init(conf map[string]string) error

func (*ChainedHooksExecutor) NoRelease

func (c *ChainedHooksExecutor) NoRelease(reason NoReleaseReason, message string) error

func (*ChainedHooksExecutor) Success

func (c *ChainedHooksExecutor) Success(commits []*semrel.Commit, prevRelease *semrel.Release, newRelease *semrel.Release, changelog string, repoInfo *RepositoryInfo) error

type ChainedUpdater

type ChainedUpdater struct {
	Updaters []FilesUpdater
}

func (*ChainedUpdater) Apply

func (u *ChainedUpdater) Apply(file, newVersion string) error

func (*ChainedUpdater) GetNameVersionPairs

func (u *ChainedUpdater) GetNameVersionPairs() []string

func (*ChainedUpdater) Init

func (u *ChainedUpdater) Init(conf map[string]string) error

type ChangelogGenerator

type ChangelogGenerator interface {
	Init(map[string]string) error
	Name() string
	Version() string
	Generate(commits []*semrel.Commit, latestRelease *semrel.Release, newVersion string) string
}

type CommitAnalyzer

type CommitAnalyzer interface {
	Init(map[string]string) error
	Name() string
	Version() string
	Analyze([]*semrel.RawCommit) []*semrel.Commit
}

type CreateReleaseConfig

type CreateReleaseConfig struct {
	Changelog  string
	NewVersion string
	Prerelease bool
	Branch     string
	SHA        string
}

type Discovery

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

func NewDiscovery

func NewDiscovery(config *config.Config) (*Discovery, error)

func (*Discovery) FindPlugin

func (d *Discovery) FindPlugin(t pluginType, name string) (interface{}, error)

type FilesUpdater

type FilesUpdater interface {
	Init(map[string]string) error
	Name() string
	Version() string
	ForFiles() string
	Apply(file, newVersion string) error
}

type Hooks

type Hooks interface {
	Init(map[string]string) error
	Name() string
	Version() string
	Success(commits []*semrel.Commit, prevRelease *semrel.Release, newRelease *semrel.Release, changelog string, repoInfo *RepositoryInfo) error
	NoRelease(reason NoReleaseReason, message string) error
}

type Manager

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

func NewManager

func NewManager(config *config.Config) (*Manager, error)

func (*Manager) EnsureAllPlugins

func (m *Manager) EnsureAllPlugins() error

func (*Manager) GetCICondition

func (m *Manager) GetCICondition() (CICondition, error)

func (*Manager) GetChainedHooksExecutor

func (m *Manager) GetChainedHooksExecutor() (*ChainedHooksExecutor, error)

func (*Manager) GetChainedUpdater

func (m *Manager) GetChainedUpdater() (*ChainedUpdater, error)

func (*Manager) GetChangelogGenerator

func (m *Manager) GetChangelogGenerator() (ChangelogGenerator, error)

func (*Manager) GetCommitAnalyzer

func (m *Manager) GetCommitAnalyzer() (CommitAnalyzer, error)

func (*Manager) GetProvider

func (m *Manager) GetProvider() (Provider, error)

func (*Manager) Stop

func (m *Manager) Stop()

type NoReleaseReason

type NoReleaseReason int32
const (
	NoReleaseReasonCondition NoReleaseReason = 0
	NoReleaseReasonNoChange  NoReleaseReason = 1
)

type Provider

type Provider interface {
	Init(map[string]string) error
	Name() string
	Version() string
	GetInfo() (*RepositoryInfo, error)
	GetCommits(fromSha, toSha string) ([]*semrel.RawCommit, error)
	GetReleases(re string) ([]*semrel.Release, error)
	CreateRelease(*CreateReleaseConfig) error
}

type RepositoryInfo

type RepositoryInfo struct {
	Owner         string
	Repo          string
	DefaultBranch string
	Private       bool
}

Jump to

Keyboard shortcuts

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