provisionersdk
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Constants
- func AgentScriptEnv() map[string]string
- func ApplyErrorf(format string, args ...any) *proto.ApplyComplete
- func CleanStaleSessions(ctx context.Context, workDirectory string, fs afero.Fs, now time.Time, ...) error
- func DefaultDisplayApps() *proto.DisplayApps
- func DirHasLockfile(dir string) (bool, error)
- func MutateTags(userID uuid.UUID, provided ...map[string]string) map[string]string
- 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 SessionDir(sessID string) string
- func Tar(w io.Writer, logger slog.Logger, directory string, limit int64) error
- func Untar(directory string, r io.Reader) error
- type ProvisionerJobLogsNotifyMessage
- type ServeOptions
- type Server
- type Session
Constants¶
const (TagScope = "scope"TagOwner = "owner"ScopeUser = "user"ScopeOrganization = "organization")
const (// ReadmeFile is the location we look for to extract documentation from template versions.ReadmeFile = "README.md")
const (// TemplateArchiveLimit represents the maximum size of a template in bytes.TemplateArchiveLimit = 1 << 20)
Variables¶
This section is empty.
Functions¶
funcAgentScriptEnv¶
AgentScriptEnv returns a key-pair of scripts that are consumed by the Coder Terraform Provider.https://github.com/coder/terraform-provider-coder/blob/main/provider/agent.go (updateInitScript)performs additional string substitutions.
funcApplyErrorf¶added inv2.1.4
func ApplyErrorf(formatstring, args ...any) *proto.ApplyComplete
funcCleanStaleSessions¶added inv2.2.0
func CleanStaleSessions(ctxcontext.Context, workDirectorystring, fsafero.Fs, nowtime.Time, loggerslog.Logger)error
CleanStaleSessions browses the work directory searching for stale sessiondirectories. Coder provisioner is supposed to remove them once after finishing the provisioning,but there is a risk of keeping them in case of a failure.
funcDefaultDisplayApps¶added inv2.1.5
func DefaultDisplayApps() *proto.DisplayApps
DefaultDisplayApps returns the default display applications to enableif none are specified in a template.
funcDirHasLockfile¶
funcMutateTags¶added inv2.5.0
MutateTags adjusts the "owner" tag dependent on the "scope".If the scope is "user", the "owner" is changed to the user ID.This is for user-scoped provisioner daemons, where users shouldown their own operations.Multiple sets of tags may be passed to this function; they willbe merged into one single tag set.Otherwise, the "owner" tag is always an empty string.NOTE: "owner" must NEVER be nil. Otherwise it will end up beingduplicated in the database, as idx_provisioner_daemons_name_owner_keyis a partial unique index that includes a JSON field.
funcParseErrorf¶added inv2.1.4
func ParseErrorf(formatstring, args ...any) *proto.ParseComplete
funcPlanErrorf¶added inv2.1.4
func PlanErrorf(formatstring, args ...any) *proto.PlanComplete
funcProvisionerJobLogsNotifyChannel¶
ProvisionerJobLogsNotifyChannel is the PostgreSQL NOTIFY channelto publish updates to job logs on.
funcServe¶
func Serve(ctxcontext.Context, serverServer, options *ServeOptions)error
Serve starts a dRPC connection for the provisioner and transport provided.
funcSessionDir¶added inv2.2.0
SessionDir returns the directory name with mandatory prefix.
Types¶
typeProvisionerJobLogsNotifyMessage¶
type ProvisionerJobLogsNotifyMessage struct {CreatedAfterint64 `json:"created_after"`EndOfLogsbool `json:"end_of_logs,omitempty"`}
ProvisionerJobLogsNotifyMessage is the payload published onthe provisioner job logs notify channel.
typeServeOptions¶
type ServeOptions struct {// Listener serves multiple connections. Cannot be combined with Conn.Listenernet.Listener// Conn is a single connection to serve. Cannot be combined with Listener.Conndrpc.TransportLoggerslog.LoggerWorkDirectorystringExternalProvisionerbool}
ServeOptions are configurations to serve a provisioner.
typeServer¶added inv2.1.4
type Server interface {Parse(s *Session, r *proto.ParseRequest, canceledOrComplete <-chan struct{}) *proto.ParseCompletePlan(s *Session, r *proto.PlanRequest, canceledOrComplete <-chan struct{}) *proto.PlanCompleteApply(s *Session, r *proto.ApplyRequest, canceledOrComplete <-chan struct{}) *proto.ApplyComplete}