Movatterモバイル変換


[0]ホーム

URL:


dist

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:16Imported by:8

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package dist is a release artifact builder library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeBuild

type Build struct {// Repo is a path to the root Go module for the build.Repostring// Out is where build artifacts are written.Outstring// Verbose is whether to print all command output, rather than just failed// commands.Verbosebool// WebClientSource is a path to the source for the web client.// If non-empty, web client assets will be built.WebClientSourcestring// Tmp is a temporary directory that gets deleted when the Builder is closed.Tmpstring// Go is the path to the Go binary to use for building.Gostring// Yarn is the path to the yarn binary to use for building the web client assets.Yarnstring// Version is the version info of the build.Versionmkversion.VersionInfo// Time is the timestamp of the build.Timetime.Time// contains filtered or unexported fields}

A Build is a build context for Targets.

funcNewBuild

func NewBuild(repo, outstring) (*Build,error)

NewBuild creates a new Build rooted at repo, and writing artifacts to out.

func (*Build)AddOnCloseFuncadded inv1.66.0

func (b *Build) AddOnCloseFunc(f func()error)

func (*Build)Build

func (b *Build) Build(targets []Target) (files []string, errerror)

Build builds all targets concurrently.

func (*Build)BuildGoBinary

func (b *Build) BuildGoBinary(pathstring, env map[string]string) (string,error)

BuildGoBinary builds the Go binary at path and returns the path to thebinary. Builds are cached by path and env, so each build only happens onceper process execution.

func (*Build)BuildGoBinaryWithTagsadded inv1.46.0

func (b *Build) BuildGoBinaryWithTags(pathstring, env map[string]string, tags []string) (string,error)

BuildGoBinaryWithTags builds the Go binary at path and returns thepath to the binary. Builds are cached by path, env and tags, soeach build only happens once per process execution.

The passed in tags override gocross's automatic selection of buildtags, so you will have to figure out and specify all the tagsrelevant to your build.

func (*Build)BuildWebClientAssetsadded inv1.50.0

func (b *Build) BuildWebClientAssets()error

BuildWebClientAssets builds the JS and CSS assets used by the web client.If b.WebClientSource is non-empty, assets are built in a "build" sub-directory of that path.Otherwise, no assets are built.

func (*Build)Close

func (b *Build) Close()error

Close ends the build, cleans up temporary files,and runs any onCloseFuncs.

func (*Build)Command

func (b *Build) Command(dir, cmdstring, args ...string) *Command

Command prepares an exec.Cmd to run [cmd, args...] in dir.

func (*Build)Extra

func (b *Build) Extra(keyany, constructor func()any)any

Extra returns a value from the build's extra state, creating it if necessary.

func (*Build)GoPkg

func (b *Build) GoPkg(pkgstring) (string,error)

GoPkg returns the path on disk of pkg.The module of pkg must be imported in b.Repo's go.mod.

func (*Build)Once

func (b *Build) Once(namestring, fn func()error)error

Once runs fn if Once hasn't been called with name before.

func (*Build)TmpDir

func (b *Build) TmpDir()string

TmpDir creates and returns a new empty temporary directory.The caller does not need to clean up the directory after use, it will getdeleted by b.Close().

typeCommand

type Command struct {Cmd    *exec.CmdOutputbytes.Buffer}

Command runs an exec.Cmd and returns its exit status. If the command fails,its output is printed to os.Stdout, otherwise it's suppressed.

func (*Command)CombinedOutput

func (c *Command) CombinedOutput() (string,error)

CombinedOutput is like c.Cmd.CombinedOutput, but returns the output as astring instead of a byte slice.

func (*Command)Run

func (c *Command) Run()error

Run is like c.Cmd.Run, but if the command fails, its output is printed toos.Stdout before returning the error.

typeMemoize

type Memoize[Oany] struct {// contains filtered or unexported fields}

Memoize runs MemoizedFns and remembers their results.

func (*Memoize[O])Do

func (m *Memoize[O]) Do(keyany, fnMemoizedFn[O]) (ret O, errerror)

Do runs fn and returns its result.fn is only run once per unique key. Subsequent Do calls with the same keyreturn the memoized result of the first call, even if fn is a differentfunction.

typeMemoizedFn

type MemoizedFn[Tany] func() (T,error)

MemoizedFn is a function that memoize.Do can call.

typeSigneradded inv1.50.0

type Signer func(io.Reader) ([]byte,error)

Signer is pluggable signer for a Target.

func (Signer)SignFileadded inv1.50.0

func (sSigner) SignFile(filePath, sigPathstring)error

SignFile signs the file at filePath with s and writes the signature tosigPath.

typeTarget

type Target interface {String()stringBuild(build *Build) ([]string,error)}

A Target is something that can be build in a Build.

funcFilterTargets

func FilterTargets(targets []Target, filters []string) ([]Target,error)

FilterTargets returns the subset of targets that match any of the filters.If filters is empty, returns all targets.

Source Files

View all Source files

Directories

PathSynopsis
Package cli provides the skeleton of a CLI for building release packages.
Package cli provides the skeleton of a CLI for building release packages.
Package qnap contains dist Targets for building QNAP Tailscale packages.
Package qnap contains dist Targets for building QNAP Tailscale packages.
Package synology contains dist Targets for building Synology Tailscale packages.
Package synology contains dist Targets for building Synology Tailscale packages.
Package unixpkgs contains dist Targets for building unix Tailscale packages.
Package unixpkgs contains dist Targets for building unix Tailscale packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp