transport

package
v0.2.0-preview.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package transport implements Tend's bounded, versioned deployment stream.

Index

Constants

View Source
const (
	Protocol         = "tend-receive-v1"
	MaxArtifactBytes = 512 << 20
)

Variables

This section is empty.

Functions

func CopyArtifact

func CopyArtifact(destination io.Writer, reader *bufio.Reader, header Header, maxBytes int64) error

func Prefix

func Prefix(header Header) ([]byte, error)

func Push

func Push(ctx context.Context, runner SSHRunner, options PushOptions) (json.RawMessage, error)

func Receive

func Receive(ctx context.Context, input io.Reader, policy serverpolicy.Policy, manager deploy.Manager) (deploy.Report, error)

Types

type ExecSSHRunner

type ExecSSHRunner struct{}

func (ExecSSHRunner) Run

func (ExecSSHRunner) Run(ctx context.Context, name string, args []string, stdin io.Reader) ([]byte, error)
type Header struct {
	Protocol       string `json:"protocol"`
	Service        string `json:"service"`
	ArtifactName   string `json:"artifact_name"`
	Size           int64  `json:"size"`
	SHA256         string `json:"sha256"`
	ApprovedSHA256 string `json:"approved_sha256"`
	Activate       bool   `json:"activate"`
}

func ReadHeader

func ReadHeader(reader *bufio.Reader) (Header, error)

func (Header) Validate

func (h Header) Validate(maxBytes int64) error

type PushOptions

type PushOptions struct {
	Target         string
	Port           int
	KnownHosts     string
	Identity       string
	Service        string
	Artifact       string
	SHA256         string
	ApprovedSHA256 string
	Activate       bool
}

type SSHRunner

type SSHRunner interface {
	Run(context.Context, string, []string, io.Reader) ([]byte, error)
}

Jump to

Keyboard shortcuts

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