config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReleasesExclusionSliceEquals

func NewReleasesExclusionSliceEquals(left []NewReleasesExclusion, right []NewReleasesExclusion) bool

func NormalizePackageName added in v0.5.0

func NormalizePackageName(pkgName string) string

func Schema

func Schema() *jsonschema.Schema

Types

type Config

type Config struct {
	DryRun      bool `yaml:"dryRun"`
	Packages    []Package
	GitHub      GitHub
	Jira        Jira
	NewReleases NewReleases
	HTTP        HTTP
	Log         Log
}

func (Config) Censored added in v0.5.0

func (c Config) Censored() Config

func (Config) TryFindPackage

func (c Config) TryFindPackage(pkgName string) (Package, bool)

type GitHub

type GitHub struct {
	URL     *string `jsonschema:"oneof_type=string;null" jsonschema_extras:"format=uri"`
	TempDir *string `yaml:"tempDir" jsonschema:"oneof_type=string;null" jsonschema_extras:"format=uri"`
	Auth    GitHubAuth
	PR      GitHubPR
}

func (GitHub) Censored added in v0.5.0

func (gh GitHub) Censored() GitHub

type GitHubAuth

type GitHubAuth struct {
	Type  GitHubAuthType
	Token *string `yaml:",omitempty" jsonschema:"oneof_type=string;null"`
	App   GitHubAuthApp
}

func (GitHubAuth) Censored added in v0.5.0

func (a GitHubAuth) Censored() GitHubAuth

type GitHubAuthApp

type GitHubAuthApp struct {
	ID             int64
	PrivateKeyPath *string           `yaml:"privateKeyPath,omitempty" jsonschema:"oneof_type=string;null,oneof_required=privateKeyPath"`
	PrivateKeyPEM  *RSAPrivateKeyPEM `yaml:"privateKeyPem,omitempty" jsonschema:"oneof_required=privateKeyPem"`
}

func (GitHubAuthApp) Censored added in v0.5.0

func (a GitHubAuthApp) Censored() GitHubAuthApp

type GitHubAuthType

type GitHubAuthType string
const (
	GitHubAuthTypePAT GitHubAuthType = "pat"
	GitHubAuthTypeApp GitHubAuthType = "app"
)

func (GitHubAuthType) JSONSchema

func (GitHubAuthType) JSONSchema() *jsonschema.Schema

func (*GitHubAuthType) Set

func (f *GitHubAuthType) Set(value string) error

func (GitHubAuthType) String

func (f GitHubAuthType) String() string

func (*GitHubAuthType) Type

func (f *GitHubAuthType) Type() string

func (*GitHubAuthType) UnmarshalText

func (f *GitHubAuthType) UnmarshalText(text []byte) error

type GitHubCommitter

type GitHubCommitter struct {
	Name  *string `jsonschema:"oneof_type=string;null"`
	Email *string `jsonschema:"oneof_type=string;null" jsonschema_extras:"format=idn-email"`
}

type GitHubPR

type GitHubPR struct {
	Title       *Template
	Description *Template
	Branch      *Template
	Commit      *Template
	Committer   GitHubCommitter
}

type HTTP

type HTTP struct {
	Port      uint16
	PublicURL *URL `yaml:"publicUrl"`
}

func (HTTP) Censored added in v0.5.0

func (h HTTP) Censored() HTTP

type Jira

type Jira struct {
	URL            string `jsonschema_extras:"format=uri"`
	SkipCertVerify bool   `yaml:"skipCertVerify"`
	Auth           JiraAuth
	Issue          JiraIssue
}

func (Jira) Censored added in v0.5.0

func (j Jira) Censored() Jira

type JiraAuth

type JiraAuth struct {
	Type  JiraAuthType
	Token string
	User  string
}

func (JiraAuth) Censored added in v0.5.0

func (a JiraAuth) Censored() JiraAuth

type JiraAuthType

type JiraAuthType string
const (
	JiraAuthTypePAT   JiraAuthType = "pat"
	JiraAuthTypeToken JiraAuthType = "token"
)

func (JiraAuthType) JSONSchema

func (JiraAuthType) JSONSchema() *jsonschema.Schema

func (*JiraAuthType) Set

func (f *JiraAuthType) Set(value string) error

func (JiraAuthType) String

func (f JiraAuthType) String() string

func (*JiraAuthType) Type

func (f *JiraAuthType) Type() string

func (*JiraAuthType) UnmarshalText

func (f *JiraAuthType) UnmarshalText(text []byte) error

type JiraIssue

type JiraIssue struct {
	Labels                 []string
	Status                 string
	Description            string
	Type                   string
	Project                string
	ProjectNameCustomField uint `yaml:"projectNameCustomField"`

	// PRDeferredCreation means Jelease will send a link to where user can
	// manually trigger the PR creation, instead of creating it automatically.
	PRDeferredCreation bool `yaml:"prDeferredCreation"`

	Comments JiraIssueComments
}

Jira Ticket type

type JiraIssueComments

type JiraIssueComments struct {
	UpdatedIssue       *Template `yaml:"updatedIssue"`
	NoConfig           *Template `yaml:"noConfig"`
	NoPatches          *Template `yaml:"noPatches"`
	PRCreated          *Template `yaml:"prCreated"`
	PRFailed           *Template `yaml:"prFailed"`
	PRDeferredCreation *Template `yaml:"prDeferredCreation"`
}

type Log

type Log struct {
	Format LogFormat
	Level  LogLevel
}

type LogFormat

type LogFormat string
const (
	LogFormatPretty LogFormat = "pretty"
	LogFormatJSON   LogFormat = "json"
)

func (LogFormat) JSONSchema

func (LogFormat) JSONSchema() *jsonschema.Schema

func (*LogFormat) Set

func (f *LogFormat) Set(value string) error

func (LogFormat) String

func (f LogFormat) String() string

func (*LogFormat) Type

func (f *LogFormat) Type() string

func (*LogFormat) UnmarshalText

func (f *LogFormat) UnmarshalText(text []byte) error

type LogLevel

type LogLevel zerolog.Level

func (LogLevel) JSONSchema

func (LogLevel) JSONSchema() *jsonschema.Schema

func (LogLevel) MarshalText

func (l LogLevel) MarshalText() ([]byte, error)

func (*LogLevel) Set

func (l *LogLevel) Set(value string) error

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) Type

func (l *LogLevel) Type() string

func (*LogLevel) UnmarshalText

func (l *LogLevel) UnmarshalText(text []byte) error

type NewReleases

type NewReleases struct {
	Auth     NewReleasesAuth
	Projects []NewReleasesProject
	Defaults NewReleasesDefaults
}

type NewReleasesAuth

type NewReleasesAuth struct {
	APIKey string
}

type NewReleasesDefaults

type NewReleasesDefaults struct {
	EmailNotification string `json:"emailNotification" yaml:"emailNotification" mapstructure:"emailNotification"`
}

type NewReleasesExclusion

type NewReleasesExclusion struct {
	Value   string `json:"value"`
	Inverse bool   `json:"inverse"`
}

func (NewReleasesExclusion) Equals

func (exclusion NewReleasesExclusion) Equals(other NewReleasesExclusion) bool

type NewReleasesProject

type NewReleasesProject struct {
	Name               string
	Provider           string
	EmailNotification  string                 `json:"emailNotification,omitempty" yaml:"emailNotification,omitempty" mapstructure:"emailNotification"`
	Exclusions         []NewReleasesExclusion `json:"excludeVersionRegexp,omitempty" yaml:"excludeVersionRegexp,omitempty" mapstructure:"excludeVersionRegexp"`
	ExcludePrereleases bool                   `json:"excludePrereleases,omitempty" yaml:"excludePrereleases,omitempty" mapstructure:"excludePrereleases"`
	ExcludeUpdated     bool                   `json:"excludeUpdated,omitempty" yaml:"excludeUpdated,omitempty" mapstructure:"excludeUpdated"`
}

Similar to newreleases.io/newreleases/NewReleasesProject but omits some fields that we don't want to store or compare

func (NewReleasesProject) Equals

func (project NewReleasesProject) Equals(other NewReleasesProject) bool

Thanks to Go, I now know how a compiler feels

type Package

type Package struct {
	Name  string
	Repos []PackageRepo
}

func (Package) NormalizedName added in v0.5.0

func (p Package) NormalizedName() string

type PackageRepo

type PackageRepo struct {
	URL     string `jsonschema_extras:"format=uri-reference"`
	Patches []PackageRepoPatch
}

type PackageRepoPatch

type PackageRepoPatch struct {
	File  string
	Regex *PatchRegex `yaml:",omitempty" json:",omitempty" jsonschema:"oneof_required=regex"`
	YQ    *PatchYQ    `yaml:",omitempty" json:",omitempty" jsonschema:"oneof_required=yq"`
}

type PatchRegex

type PatchRegex struct {
	Match   *RegexPattern `jsonschema:"required"`
	Replace *Template     `jsonschema:"required"`
}

type PatchYQ

type PatchYQ struct {
	Expression string `jsonschema:"required"`
}

type RSAPrivateKeyPEM

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

func (RSAPrivateKeyPEM) JSONSchema

func (RSAPrivateKeyPEM) JSONSchema() *jsonschema.Schema

func (*RSAPrivateKeyPEM) MarshalText

func (k *RSAPrivateKeyPEM) MarshalText() ([]byte, error)

func (*RSAPrivateKeyPEM) PrivateKey

func (k *RSAPrivateKeyPEM) PrivateKey() *rsa.PrivateKey

func (*RSAPrivateKeyPEM) Set

func (k *RSAPrivateKeyPEM) Set(value string) error

func (*RSAPrivateKeyPEM) String

func (k *RSAPrivateKeyPEM) String() string

func (RSAPrivateKeyPEM) Type

func (RSAPrivateKeyPEM) Type() string

func (*RSAPrivateKeyPEM) UnmarshalText

func (k *RSAPrivateKeyPEM) UnmarshalText(text []byte) error

type RegexPattern

type RegexPattern regexp.Regexp

func (RegexPattern) JSONSchema

func (RegexPattern) JSONSchema() *jsonschema.Schema

func (*RegexPattern) MarshalText

func (r *RegexPattern) MarshalText() ([]byte, error)

func (*RegexPattern) Regexp

func (r *RegexPattern) Regexp() *regexp.Regexp

func (*RegexPattern) Set

func (r *RegexPattern) Set(value string) error

func (*RegexPattern) String

func (r *RegexPattern) String() string

func (*RegexPattern) Type

func (r *RegexPattern) Type() string

func (*RegexPattern) UnmarshalText

func (r *RegexPattern) UnmarshalText(text []byte) error

type Template

type Template template.Template

func (Template) JSONSchema

func (Template) JSONSchema() *jsonschema.Schema

func (*Template) MarshalText

func (t *Template) MarshalText() ([]byte, error)

func (*Template) Render

func (t *Template) Render(data any) (string, error)

func (*Template) Set

func (t *Template) Set(value string) error

func (*Template) String

func (t *Template) String() string

func (*Template) Template

func (t *Template) Template() *template.Template

func (Template) Type

func (Template) Type() string

func (*Template) UnmarshalText

func (t *Template) UnmarshalText(text []byte) error

type URL added in v0.5.0

type URL url.URL

func (URL) JSONSchema added in v0.5.0

func (URL) JSONSchema() *jsonschema.Schema

func (*URL) MarshalText added in v0.5.0

func (u *URL) MarshalText() ([]byte, error)

func (*URL) Set added in v0.5.0

func (u *URL) Set(value string) error

func (*URL) String added in v0.5.0

func (u *URL) String() string

func (URL) Type added in v0.5.0

func (URL) Type() string

func (*URL) URL added in v0.5.0

func (u *URL) URL() *url.URL

func (*URL) UnmarshalText added in v0.5.0

func (u *URL) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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