Documentation ¶
Index ¶
- Variables
- func BuildLogger(inv *clibase.Invocation, cfg *codersdk.DeploymentValues) (slog.Logger, func(), error)
- func ConfigureHTTPClient(ctx context.Context, clientCertFile, clientKeyFile string, ...) (context.Context, *http.Client, error)
- func ConfigureTraceProvider(ctx context.Context, logger slog.Logger, cfg *codersdk.DeploymentValues) (trace.TracerProvider, string, func(context.Context) error)
- func ConnectToPostgres(ctx context.Context, logger slog.Logger, driver string, dbURL string) (*sql.DB, error)
- func ContextWithLogger(ctx context.Context, l slog.Logger) context.Context
- func CurrentOrganization(inv *clibase.Invocation, client *codersdk.Client) (codersdk.Organization, error)
- func DumpHandler(ctx context.Context)
- func IsLocalURL(ctx context.Context, u *url.URL) (bool, error)
- func IsLocalhost(host string) bool
- func LoggerFromContext(ctx context.Context) (slog.Logger, bool)
- func ParseProvisionerTags(rawTags []string) (map[string]string, error)
- func PrintDeprecatedOptions() clibase.MiddlewareFunc
- func PrintLogo(inv *clibase.Invocation, daemonTitle string)
- func ReadGitAuthProvidersFromEnv(environ []string) ([]codersdk.GitAuthConfig, error)
- func ServeHandler(ctx context.Context, logger slog.Logger, handler http.Handler, ...) (closeFunc func())
- func SlimUnsupported(w io.Writer, cmd string)
- func WriteConfigMW(cfg *codersdk.DeploymentValues) clibase.MiddlewareFunc
- type HTTPServers
- type ParameterResolver
- func (pr *ParameterResolver) Resolve(inv *clibase.Invocation, action WorkspaceCLIAction, ...) ([]codersdk.WorkspaceBuildParameter, error)
- func (pr *ParameterResolver) WithBuildOptions(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
- func (pr *ParameterResolver) WithLastBuildParameters(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
- func (pr *ParameterResolver) WithPromptBuildOptions(promptBuildOptions bool) *ParameterResolver
- func (pr *ParameterResolver) WithPromptRichParameters(promptRichParameters bool) *ParameterResolver
- func (pr *ParameterResolver) WithRichParameters(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
- func (pr *ParameterResolver) WithRichParametersFile(fileMap map[string]string) *ParameterResolver
- type RootCmd
- func (r *RootCmd) AGPL() []*clibase.Cmd
- func (r *RootCmd) Command(subcommands []*clibase.Cmd) (*clibase.Cmd, error)
- func (r *RootCmd) Core() []*clibase.Cmd
- func (r *RootCmd) InitClient(client *codersdk.Client) clibase.MiddlewareFunc
- func (r *RootCmd) InitClientMissingTokenOK(client *codersdk.Client) clibase.MiddlewareFunc
- func (r *RootCmd) RunMain(subcommands []*clibase.Cmd)
- func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.API, io.Closer, error)) *clibase.Cmd
- func (r *RootCmd) Verbosef(inv *clibase.Invocation, fmtStr string, args ...interface{})
- type WorkspaceCLIAction
Constants ¶
This section is empty.
Variables ¶
var (
Caret = pretty.Sprint(cliui.DefaultStyles.Prompt, "")
)
Functions ¶
func BuildLogger ¶
func BuildLogger(inv *clibase.Invocation, cfg *codersdk.DeploymentValues) (slog.Logger, func(), error)
func ConfigureHTTPClient ¶
func ConfigureTraceProvider ¶
func ConnectToPostgres ¶ added in v2.2.0
func CurrentOrganization ¶
func CurrentOrganization(inv *clibase.Invocation, client *codersdk.Client) (codersdk.Organization, error)
CurrentOrganization returns the currently active organization for the authenticated user.
func DumpHandler ¶
DumpHandler provides a custom SIGQUIT and SIGTRAP handler that dumps the stacktrace of all goroutines to stderr and a well-known file in the home directory. This is useful for debugging deadlock issues that may occur in production in workspaces, since the default Go runtime will only dump to stderr (which is often difficult/impossible to read in a workspace).
SIGQUITs will still cause the program to exit (similarly to the default Go runtime behavior).
A SIGQUIT handler will not be registered if GOTRACEBACK=crash.
On Windows this immediately returns.
func IsLocalURL ¶
isLocalURL returns true if the hostname of the provided URL appears to resolve to a loopback address.
func IsLocalhost ¶
IsLocalhost returns true if the host points to the local machine. Intended to be called with `u.Hostname()`.
func PrintDeprecatedOptions ¶
func PrintDeprecatedOptions() clibase.MiddlewareFunc
printDeprecatedOptions loops through all command options, and prints a warning for usage of deprecated options.
func ReadGitAuthProvidersFromEnv ¶
func ReadGitAuthProvidersFromEnv(environ []string) ([]codersdk.GitAuthConfig, error)
ReadGitAuthProvidersFromEnv is provided for compatibility purposes with the viper CLI. DEPRECATED
func ServeHandler ¶
func SlimUnsupported ¶ added in v2.1.5
func WriteConfigMW ¶
func WriteConfigMW(cfg *codersdk.DeploymentValues) clibase.MiddlewareFunc
writeConfigMW will prevent the main command from running if the write-config flag is set. Instead, it will marshal the command options to YAML and write them to stdout.
Types ¶
type HTTPServers ¶
type HTTPServers struct { HTTPUrl *url.URL HTTPListener net.Listener // TLS TLSUrl *url.URL TLSListener net.Listener TLSConfig *tls.Config }
func ConfigureHTTPServers ¶
func ConfigureHTTPServers(inv *clibase.Invocation, cfg *codersdk.DeploymentValues) (_ *HTTPServers, err error)
func (*HTTPServers) Close ¶
func (s *HTTPServers) Close()
type ParameterResolver ¶
type ParameterResolver struct {
// contains filtered or unexported fields
}
func (*ParameterResolver) Resolve ¶
func (pr *ParameterResolver) Resolve(inv *clibase.Invocation, action WorkspaceCLIAction, templateVersionParameters []codersdk.TemplateVersionParameter) ([]codersdk.WorkspaceBuildParameter, error)
func (*ParameterResolver) WithBuildOptions ¶
func (pr *ParameterResolver) WithBuildOptions(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
func (*ParameterResolver) WithLastBuildParameters ¶
func (pr *ParameterResolver) WithLastBuildParameters(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
func (*ParameterResolver) WithPromptBuildOptions ¶
func (pr *ParameterResolver) WithPromptBuildOptions(promptBuildOptions bool) *ParameterResolver
func (*ParameterResolver) WithPromptRichParameters ¶
func (pr *ParameterResolver) WithPromptRichParameters(promptRichParameters bool) *ParameterResolver
func (*ParameterResolver) WithRichParameters ¶
func (pr *ParameterResolver) WithRichParameters(params []codersdk.WorkspaceBuildParameter) *ParameterResolver
func (*ParameterResolver) WithRichParametersFile ¶
func (pr *ParameterResolver) WithRichParametersFile(fileMap map[string]string) *ParameterResolver
type RootCmd ¶
type RootCmd struct {
// contains filtered or unexported fields
}
RootCmd contains parameters and helpers useful to all commands.
func (*RootCmd) InitClient ¶
func (r *RootCmd) InitClient(client *codersdk.Client) clibase.MiddlewareFunc
InitClient sets client to a new client. It reads from global configuration files if flags are not set.
func (*RootCmd) InitClientMissingTokenOK ¶
func (r *RootCmd) InitClientMissingTokenOK(client *codersdk.Client) clibase.MiddlewareFunc
type WorkspaceCLIAction ¶
type WorkspaceCLIAction int
const ( WorkspaceCreate WorkspaceCLIAction = iota WorkspaceStart WorkspaceUpdate WorkspaceRestart )
Source Files ¶
- agent.go
- configssh.go
- configssh_other.go
- constants.go
- create.go
- delete.go
- dotfiles.go
- exp.go
- exp_scaletest.go
- gitaskpass.go
- gitssh.go
- help.go
- list.go
- login.go
- logout.go
- netcheck.go
- parameter.go
- parameterresolver.go
- ping.go
- portforward.go
- publickey.go
- remoteforward.go
- rename.go
- resetpassword.go
- restart.go
- root.go
- schedule.go
- server.go
- server_createadminuser.go
- show.go
- signal_unix.go
- speedtest.go
- ssh.go
- ssh_other.go
- start.go
- stat.go
- state.go
- stop.go
- templatecreate.go
- templatedelete.go
- templateedit.go
- templateinit.go
- templatelist.go
- templatepull.go
- templatepush.go
- templates.go
- templatevariables.go
- templateversions.go
- tokens.go
- update.go
- usercreate.go
- userlist.go
- users.go
- userstatus.go
- util.go
- version.go
- vscodessh.go