debug

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 25 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSocketPath = "/var/run/shell-operator/debug.socket"

DefaultSocketPath is the path the debug CLI client (DefaultClient) connects to when no explicit socket has been configured. It is a CLI concern only — library consumers should build a debug.Client with NewClient(path) directly.

Functions

func AddOutputJsonYamlTextFlag

func AddOutputJsonYamlTextFlag(cmd *cobra.Command)

func DefineDebugCommands

func DefineDebugCommands(rootCmd *cobra.Command)

func DefineDebugCommandsSelf added in v1.0.8

func DefineDebugCommandsSelf(rootCmd *cobra.Command)

func DefineSocketFlag added in v1.18.0

func DefineSocketFlag(cmd *cobra.Command)

DefineSocketFlag binds the --debug-unix-socket flag on cmd to the process-level DefaultSocketPath used by DefaultClient(). Called by debug sub-commands (queue, hook, config, raw).

func FormatFromRequest added in v1.0.8

func FormatFromRequest(request *http.Request) string

Types

type BadRequestError added in v1.4.0

type BadRequestError struct {
	Msg string
}

func (*BadRequestError) Error added in v1.4.0

func (be *BadRequestError) Error() string

type Client

type Client struct {
	SocketPath string
	// contains filtered or unexported fields
}

func DefaultClient

func DefaultClient() (*Client, error)

DefaultClient connects to the unix socket pointed at by DefaultSocketPath. CLI commands bind --debug-unix-socket against DefaultSocketPath via DefineSocketFlag so that this function picks up any flag-supplied override.

func NewClient

func NewClient(socketPath string) (*Client, error)

func (*Client) Close added in v1.10.4

func (c *Client) Close()

func (*Client) Get

func (c *Client) Get(url string) ([]byte, error)

func (*Client) Post added in v1.0.8

func (c *Client) Post(targetUrl string, data map[string][]string) ([]byte, error)

type ConfigRequest added in v1.0.8

type ConfigRequest struct {
	// contains filtered or unexported fields
}

func Config added in v1.0.8

func Config(client *Client) *ConfigRequest

func (*ConfigRequest) List added in v1.0.8

func (cr *ConfigRequest) List(format string) ([]byte, error)

func (*ConfigRequest) Set added in v1.0.8

func (cr *ConfigRequest) Set(name string, value string, duration time.Duration) ([]byte, error)

type HookRequest added in v1.0.8

type HookRequest struct {
	// contains filtered or unexported fields
}

func Hook added in v1.0.8

func Hook(client *Client) *HookRequest

func (*HookRequest) List added in v1.0.8

func (r *HookRequest) List(format string) ([]byte, error)

func (*HookRequest) Name added in v1.0.8

func (r *HookRequest) Name(name string) *HookRequest

func (*HookRequest) Snapshots added in v1.0.8

func (r *HookRequest) Snapshots(format string) ([]byte, error)

type NotFoundError added in v1.7.4

type NotFoundError struct {
	Msg string
}

func (*NotFoundError) Error added in v1.7.4

func (nf *NotFoundError) Error() string

type QueueRequest

type QueueRequest struct {
	// contains filtered or unexported fields
}

func Queue

func Queue(client *Client) *QueueRequest

func (*QueueRequest) List added in v1.0.8

func (qr *QueueRequest) List(format string, showEmpty bool) ([]byte, error)

func (*QueueRequest) Main added in v1.0.8

func (qr *QueueRequest) Main(format string) ([]byte, error)

type Server

type Server struct {
	Prefix     string
	SocketPath string
	HttpAddr   string

	Router chi.Router
	// contains filtered or unexported fields
}

func NewServer

func NewServer(prefix, socketPath, httpAddr string, logger *log.Logger) *Server

func (*Server) Init

func (s *Server) Init() error

func (*Server) RegisterHandler added in v1.4.0

func (s *Server) RegisterHandler(method, pattern string, handler func(request *http.Request) (interface{}, error))

RegisterHandler registers http handler for unix/http debug server

func (*Server) Shutdown added in v1.18.0

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully stops both the unix-socket server and the optional HTTP server. The unix socket file is removed on the way out. Safe to call when Init was never run or after a previous Shutdown.

Jump to

Keyboard shortcuts

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