archiveplugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 1 package

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 (
	// Version gets incremented on incompatible changes to the archive plugin or its runtime,
	// think of this as a major version increment in semver terms.
	// This should almost never happen, but if it does, the old archive plugin will probably not work as expected.
	// This will be detected on Hugoreleaser startup and the build will fail.
	// The plugin server then needs to be updated and re-tested.
	Version = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveFile

type ArchiveFile struct {
	// The source filename.
	SourcePathAbs string `toml:"source_path_abs"`

	// Relative target path, including the name of the file.
	TargetPath string `toml:"target_path"`
}

func (*ArchiveFile) Init

func (a *ArchiveFile) Init() error

type Request

type Request struct {
	// Version is the archive plugin version.
	// This is just used for validation on startup.
	Version int `toml:"version"`

	// Heartbeat is a string that is echoed back to the caller,
	// used to test that plugin servers are up and running.
	Heartbeat string `toml:"heartbeat"`

	// BuildContext holds the basic build information about the current build.
	BuildContext model.BuildContext `toml:"build_context"`

	// Settings for the archive.
	// This is the content of archive_settings.custom_settings.
	Settings map[string]any `toml:"settings"`

	Files []ArchiveFile `toml:"files"`

	// Filename with extension.
	OutFilename string `toml:"out_filename"`
}

Request is what is sent to an external archive tool.

func (Request) HeartbeatResponse

func (r Request) HeartbeatResponse() (Response, bool)

HeartbeatResponse returns a Response that, if the second return value is true, will be returned to the caller.

func (*Request) Init

func (r *Request) Init() error

type Response

type Response struct {
	// Heartbeat is a string that is echoed back to the caller,
	// used to test that plugin servers are up and running.
	Heartbeat string `toml:"heartbeat"`

	Error *plugins.Error `toml:"err"`
}

Response is what is sent back from an external archive tool.

func (Response) Err

func (r Response) Err() error

Jump to

Keyboard shortcuts

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