provisionersdk

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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 ResourceAddresses

func ResourceAddresses(resources []*proto.Resource) ([]string, error)

ResourceAddresses returns an index-matching slice of unique addresses to access resources.

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) ([]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