plugin

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPluginEventNotSupported = errors.New("event not supported")
	ErrFileExistInvalid        = errors.New("invalid file_exist value")
)
View Source
var ErrHashMethodNotSupported = errors.New("hash method not supported")

Functions

func Checksum added in v1.0.2

func Checksum(r io.Reader, method string) (string, error)

Checksum calculates the checksum of the given io.Reader using the specified hash method. Supported hash methods are: "md5", "sha1", "sha256", "sha512", "adler32", "crc32", "blake2b", "blake2s".

func Flags added in v1.0.2

func Flags(settings *Settings, category string) []cli.Flag

Flags returns a slice of CLI flags for the plugin.

func WriteChecksums added in v1.0.2

func WriteChecksums(files, methods []string, outDir string) ([]string, error)

WriteChecksums calculates the checksums for the given files using the specified hash methods, and writes the checksums to files named after the hash methods (e.g. "md5sum.txt", "sha256sum.txt").

Types

type Plugin

type Plugin struct {
	*plugin_base.Plugin
	Settings *Settings
}

Plugin implements provide the plugin.

func New

func New(e plugin_base.ExecuteFunc, build ...string) *Plugin

func (*Plugin) Execute

func (p *Plugin) Execute() error

Execute provides the implementation of the plugin.

func (*Plugin) FlagsFromContext

func (p *Plugin) FlagsFromContext() error

func (*Plugin) Validate

func (p *Plugin) Validate() error

Validate handles the settings validation of the plugin.

type Settings

type Settings struct {
	APIKey     string
	FileExists string
	Checksum   cli.StringSlice
	Draft      bool
	PreRelease bool
	Title      string
	Note       string
	CommitRef  string
	Event      string
	// contains filtered or unexported fields
}

Settings for the Plugin.

Jump to

Keyboard shortcuts

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