artifacts

package
v0.129.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 17 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactsResolver

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

ArtifactsResolver resolves workflow WASM and config paths from BinarySource and ConfigSource via local files or remote fetch.

func NewArtifactsResolver

func NewArtifactsResolver(workDir string, opts ...ArtifactsResolverOption) (*ArtifactsResolver, error)

NewArtifactsResolver returns a resolver for workDir (non-empty after trim). for Github release assets, the resolver uses the GitHub API to fetch release info and download assets using GITHUB_TOKEN/GH_TOKEN env vars (github_http.go).

func (*ArtifactsResolver) ResolveBinary

func (r *ArtifactsResolver) ResolveBinary(ctx context.Context, src BinarySource) (string, error)

ResolveBinary resolves a .wasm path.

func (*ArtifactsResolver) ResolveConfig

func (r *ArtifactsResolver) ResolveConfig(ctx context.Context, src ConfigSource) (string, error)

ResolveConfig resolves a config file path.

func (*ArtifactsResolver) WorkDir

func (r *ArtifactsResolver) WorkDir() string

WorkDir returns the directory used for downloads and temp artifacts. Callers may pass it to os.RemoveAll after use.

type ArtifactsResolverOption

type ArtifactsResolverOption func(*ArtifactsResolver)

ArtifactsResolverOption configures NewArtifactsResolver.

func WithHTTPClient

func WithHTTPClient(c *http.Client) ArtifactsResolverOption

WithHTTPClient sets the HTTP client for remote artifact fetches. When omitted, http.DefaultClient is used

type BinarySource

type BinarySource struct {
	ExternalRef *externalBinaryRef `json:"externalRef,omitempty" yaml:"externalRef,omitempty"`
	LocalPath   string             `json:"localPath,omitempty" yaml:"localPath,omitempty"`
}

func NewBinarySourceGitHubRelease

func NewBinarySourceGitHubRelease(repo, releaseTag, assetName, sha256 string) (BinarySource, error)

NewBinarySourceGitHubRelease returns a validated BinarySource for a GitHub release asset.

func NewBinarySourceLocal

func NewBinarySourceLocal(localPath string) BinarySource

NewBinarySourceLocal returns a BinarySource for a local .wasm file at localPath.

func NewBinarySourceURL

func NewBinarySourceURL(rawURL, sha256 string) (BinarySource, error)

NewBinarySourceURL returns a validated BinarySource for a direct URL download with SHA-256 verification.

func (*BinarySource) IsExternal

func (b *BinarySource) IsExternal() bool

IsExternal reports whether the binary source uses an external reference.

func (*BinarySource) IsLocal

func (b *BinarySource) IsLocal() bool

IsLocal reports whether the binary source is a local filesystem path.

func (*BinarySource) Validate

func (b *BinarySource) Validate() error

Validate trims LocalPath and checks that exactly one of local path or external ref is set.

type ConfigSource

type ConfigSource struct {
	ExternalRef *externalConfigRef `json:"externalRef,omitempty" yaml:"externalRef,omitempty"`
	LocalPath   string             `json:"localPath,omitempty" yaml:"localPath,omitempty"`
}

ConfigSource is either a local config file or an external reference. Create via NewConfigSourceLocal, NewConfigSourceURL, or NewConfigSourceGitHub, or unmarshal from JSON/YAML and call ConfigSource.Validate.

func NewConfigSourceGitHub

func NewConfigSourceGitHub(repo, ref, path string) (ConfigSource, error)

NewConfigSourceGitHub returns a validated ConfigSource for a GitHub file via the Contents API.

func NewConfigSourceLocal

func NewConfigSourceLocal(localPath string) ConfigSource

NewConfigSourceLocal returns a ConfigSource for a local config file at localPath.

func NewConfigSourceURL

func NewConfigSourceURL(rawURL string) (ConfigSource, error)

NewConfigSourceURL returns a validated ConfigSource for a direct URL download.

func (*ConfigSource) IsExternal

func (c *ConfigSource) IsExternal() bool

IsExternal reports whether the config source uses an external reference.

func (*ConfigSource) IsLocal

func (c *ConfigSource) IsLocal() bool

IsLocal reports whether the config source is a local filesystem path.

func (*ConfigSource) Validate

func (c *ConfigSource) Validate() error

Validate trims LocalPath and checks that exactly one of local path or external ref is set.

type WorkflowBundle

type WorkflowBundle struct {
	WorkflowName       string       `json:"workflowName" yaml:"workflowName"`
	Binary             BinarySource `json:"binary" yaml:"binary"`
	Config             ConfigSource `json:"config" yaml:"config"`
	DonFamily          string       `json:"donFamily,omitempty" yaml:"donFamily,omitempty"`
	DeploymentRegistry string       `json:"deploymentRegistry,omitempty" yaml:"deploymentRegistry,omitempty"`
	Attributes         string       `json:"attributes,omitempty" yaml:"attributes,omitempty"`
	Tag                string       `json:"tag,omitempty" yaml:"tag,omitempty"`
}

WorkflowBundle describes workflow deploy inputs: pre-built WASM and config.

func (*WorkflowBundle) Validate

func (w *WorkflowBundle) Validate() error

Validate trims string fields and validates the workflow bundle.

Jump to

Keyboard shortcuts

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