Documentation
¶
Index ¶
- Constants
- func AgentScriptEnv() map[string]string
- func ApplyErrorf(format string, args ...any) *proto.ApplyComplete
- func DefaultDisplayApps() *proto.DisplayApps
- func DirHasLockfile(dir string) (bool, error)
- func MemTransportPipe() (drpc.Conn, net.Listener)
- func MultiplexedConn(session *yamux.Session) drpc.Conn
- func ParseErrorf(format string, args ...any) *proto.ParseComplete
- func PlanErrorf(format string, args ...any) *proto.PlanComplete
- func ProvisionerJobLogsNotifyChannel(jobID uuid.UUID) string
- func Serve(ctx context.Context, server Server, options *ServeOptions) error
- func Tar(w io.Writer, directory string, limit int64) error
- func Untar(directory string, r io.Reader) error
- type ProvisionerJobLogsNotifyMessage
- type ServeOptions
- type Server
- type Session
Constants ¶
const ( // MaxMessageSize is the maximum payload size that can be // transported without error. MaxMessageSize = 4 << 20 )
const ReadmeFile = "README.md"
ReadmeFile is the location we look for to extract documentation from template versions.
const (
// TemplateArchiveLimit represents the maximum size of a template in bytes.
TemplateArchiveLimit = 1 << 20
)
Variables ¶
This section is empty.
Functions ¶
func AgentScriptEnv ¶
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 ApplyErrorf ¶ added in v2.1.4
func ApplyErrorf(format string, args ...any) *proto.ApplyComplete
func DefaultDisplayApps ¶ added in v2.1.5
func DefaultDisplayApps() *proto.DisplayApps
DefaultDisplayApps returns the default display applications to enable if none are specified in a template.
func DirHasLockfile ¶
func MultiplexedConn ¶
MultiplexedConn returns a multiplexed dRPC connection from a yamux Session.
func ParseErrorf ¶ added in v2.1.4
func ParseErrorf(format string, args ...any) *proto.ParseComplete
func PlanErrorf ¶ added in v2.1.4
func PlanErrorf(format string, args ...any) *proto.PlanComplete
func ProvisionerJobLogsNotifyChannel ¶
ProvisionerJobLogsNotifyChannel is the PostgreSQL NOTIFY channel to publish updates to job logs on.
func Serve ¶
func Serve(ctx context.Context, server Server, options *ServeOptions) error
Serve starts a dRPC connection for the provisioner and transport provided.
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 Logger slog.Logger WorkDirectory string }
ServeOptions are configurations to serve a provisioner.
type Server ¶ added in v2.1.4
type Server interface { Parse(s *Session, r *proto.ParseRequest, canceledOrComplete <-chan struct{}) *proto.ParseComplete Plan(s *Session, r *proto.PlanRequest, canceledOrComplete <-chan struct{}) *proto.PlanComplete Apply(s *Session, r *proto.ApplyRequest, canceledOrComplete <-chan struct{}) *proto.ApplyComplete }