provisionersdk

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxMessageSize is the maximum payload size that can be
	// transported without error.
	MaxMessageSize = 4 << 20
)
View Source
const (
	// TemplateArchiveLimit represents the maximum size of a template in bytes.
	TemplateArchiveLimit = 1 << 20
)

Variables

This section is empty.

Functions

func AgentScriptEnv

func AgentScriptEnv() map[string]string

AgentScriptEnv returns a key-pair of scripts that are consumed by the Coder Terraform Provider. See: https://github.com/coder/terraform-provider-coder/blob/main/internal/provider/provider.go#L97

func Conn

func Conn(session *yamux.Session) drpc.Conn

Conn returns a multiplexed dRPC connection from a yamux session.

func Serve

func Serve(ctx context.Context, server proto.DRPCProvisionerServer, options *ServeOptions) error

Serve starts a dRPC connection for the provisioner and transport provided.

func Tar

func Tar(directory string, limit int64) ([]byte, error)

Tar archives a directory.

func TransportPipe

func TransportPipe() (*yamux.Session, *yamux.Session)

TransportPipe creates an in-memory pipe for dRPC transport.

func Untar

func Untar(directory string, archive []byte) error

Untar extracts the archive to a provided directory.

Types

type ServeOptions

type ServeOptions struct {
	// Conn specifies a custom transport to serve the dRPC connection.
	Listener net.Listener
}

ServeOptions are configurations to serve a provisioner.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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