github

package
v0.0.0-...-2f9d7e4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	StrategyPullRequest = "pull-request"
	StrategyDirect      = "direct"
)

Variables

View Source
var ErrFileMissing = errors.New("File missing in repository")
View Source
var ErrNotAutomated = errors.New("Not an automated release")

Functions

This section is empty.

Types

type Config

type Config struct {
	AppID             int64  `mapstructure:"appID"`
	PrivateKeyPem     string `mapstructure:"privateKeyPem"`
	ReleaseConfigPath string `mapstructure:"releaseConfig"`
}

type Releaser

type Releaser struct {
	Client     *github.Client
	Repository *github.Repository
	Rules      []Rule
	// contains filtered or unexported fields
}

Releaser is a configured client for updating files in a repository

func (*Releaser) ScanAndUpdate

func (r *Releaser) ScanAndUpdate(ctx context.Context) error

func (*Releaser) ScanAndUpdateWithRule

func (r *Releaser) ScanAndUpdateWithRule(ctx context.Context, rule Rule) error

func (*Releaser) UpdateDocument

func (r *Releaser) UpdateDocument(ctx context.Context, doc *gabs.Container) (*gabs.Container, error)

func (*Releaser) UpdateFile

func (r *Releaser) UpdateFile(ctx context.Context, entry *github.TreeEntry, ref *github.Reference) error

type ReleaserConfig

type ReleaserConfig struct {
	Rules []RuleConfig `yaml:"rules"`
}

type Rule

type Rule struct {
	Branch   string
	Files    *regexp.Regexp
	Indent   int
	Strategy string // Has no effect yet. TODO: implement
}

type RuleConfig

type RuleConfig struct {
	Branch   string `yaml:"branch"`
	Files    string `yaml:"files"`
	Strategy string `yaml:"strategy"`
}

type Service

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

func NewService

func NewService(conf Config, chartService chart.Service) (*Service, error)

func (*Service) FullScan

func (s *Service) FullScan(ctx context.Context) ([]*github.Repository, error)

func (*Service) GetReleasers

func (s *Service) GetReleasers(ctx context.Context, installation *github.Installation, l logrus.FieldLogger) ([]*Releaser, error)

func (*Service) ListInstallations

func (s *Service) ListInstallations(ctx context.Context) ([]*github.Installation, error)

func (*Service) NewReleaser

func (s *Service) NewReleaser(ctx context.Context, client *github.Client, repo *github.Repository, log logrus.FieldLogger, chartService chart.Service) (*Releaser, error)

func (*Service) ScanInstallation

func (s *Service) ScanInstallation(ctx context.Context, client *github.Client) ([]*github.Repository, error)

func (*Service) ScheduleImageUpdates

func (s *Service) ScheduleImageUpdates(ctx context.Context, l logrus.FieldLogger) error

Jump to

Keyboard shortcuts

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