Help us shape the future of Go! Take the 2026 Go Developer Survey

admin

package
v1.4.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const Slug = "admin"

Variables

This section is empty.

Functions

func Command

func Command(d Deps) *cobra.Command

Command builds a fresh admin subtree for a runtime or generator mount.

func ServeCommand added in v1.4.14

func ServeCommand(d ServeDeps) *cobra.Command

ServeCommand creates an API-only server command, independently of compat mode.

Types

type AdminConnection

type AdminConnection struct {
	Name       string `json:"name"`
	Host       string `json:"host"`
	User       string `json:"user"`
	Port       int    `json:"port"`
	LocalPort  int    `json:"local_port"`
	RemotePort int    `json:"remote_port"`
}

AdminConnection represents a saved remote admin connection.

type AdminProject

type AdminProject struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	Host    string `json:"host"`
	SSHUser string `json:"ssh_user"`
	URL     string `json:"url"`
}

AdminProject represents a project in the multi-project config.

type Deps

type Deps struct {
	LoadHealthConfig  func() (*config.Config, string, error)
	OpenBrowserCmd    func(context.Context, string) *exec.Cmd
	ResolveEnvFile    func(string) (string, error)
	SetEnvKeyInFile   func(string, string, string) error
	ShouldOpenBrowser func() bool
}

Deps carries the command package helpers used by the admin family.

type ServeDeps added in v1.4.14

type ServeDeps struct {
	// Registry supplies the command snapshot used by the server.
	Registry func() (*cmdregistry.Registry, error)
	// DataSchema provides committed command data schemas for OpenAPI.
	DataSchema func(string) ([]byte, bool)
	// ProjectDir resolves the invocation working directory.
	ProjectDir func() (string, error)
	// Listen binds the listener before announcing readiness; nil uses net.Listen.
	Listen func(network, address string) (net.Listener, error)
}

ServeDeps supplies composition-root providers without importing commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL