provisionersdk

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: AGPL-3.0 Imports: 22 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 DirHasLockfile

func DirHasLockfile(dir string) (bool, error)

func MemTransportPipe

func MemTransportPipe() (drpc.Conn, net.Listener)

func MultiplexedConn

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

MultiplexedConn returns a multiplexed dRPC connection from a yamux session.

func ProvisionerJobLogsNotifyChannel

func ProvisionerJobLogsNotifyChannel(jobID uuid.UUID) string

ProvisionerJobLogsNotifyChannel is the PostgreSQL NOTIFY channel to publish updates to job logs on.

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(w io.Writer, directory string, limit int64) error

Tar archives a Terraform directory.

func Untar

func Untar(directory string, r io.Reader) error

Untar extracts the archive to a provided directory.

Types

type ProvisionerJobLogsNotifyMessage

type ProvisionerJobLogsNotifyMessage struct {
	CreatedAfter int64 `json:"created_after"`
	EndOfLogs    bool  `json:"end_of_logs,omitempty"`
}

ProvisionerJobLogsNotifyMessage is the payload published on the provisioner job logs notify channel.

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