rules

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package rules provides functions to deal with release rules.

Index

Constants

View Source
const Default = `` /* 178-byte string literal not displayed */

Variables

View Source
var (
	ErrInvalidCommitType    = errors.New("invalid commit type")
	ErrInvalidReleaseType   = errors.New("invalid release type")
	ErrDuplicateReleaseRule = errors.New("duplicate release rule for the same commit type")
	ErrNoRules              = errors.New("no rules found")
)

Functions

This section is empty.

Types

type Options added in v2.2.2

type Options struct {
	Reader io.Reader
}

type ReleaseRule

type ReleaseRule struct {
	CommitType  string `json:"type"`
	ReleaseType string `json:"release"`
}

type ReleaseRules

type ReleaseRules struct {
	Rules []ReleaseRule `json:"rules"`
}

func Init added in v2.2.2

func Init(opts *Options) (rr *ReleaseRules, err error)

Init initalize a new set of release rules with the given options if any.

func Parse added in v2.2.2

func Parse(reader io.Reader) (*ReleaseRules, error)

Parse reads a buffer a returns the corresponding release rules.

func (*ReleaseRules) Map

func (r *ReleaseRules) Map() map[string]string

Map returns a flat map corresponding to the release rules with commit types as keys and release types as values.

Jump to

Keyboard shortcuts

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