{"modulePath":"github.com/flant/shell-operator","version":"v1.21.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package debug\n\n## Variables\n\n```go\nvar DefaultSocketPath = \"/var/run/shell-operator/debug.socket\"\n```\nDefaultSocketPath 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.\n\n## Functions\n\n```go\nfunc AddOutputJsonYamlTextFlag(cmd *cobra.Command)\n```\n\n```go\nfunc DefineDebugCommands(rootCmd *cobra.Command)\n```\n\n```go\nfunc DefineDebugCommandsSelf(rootCmd *cobra.Command)\n```\n\n```go\nfunc DefineSocketFlag(cmd *cobra.Command)\n```\nDefineSocketFlag 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).\n\n```go\nfunc FormatFromRequest(request *http.Request) string\n```\n\n## Types\n\n```go\ntype BadRequestError struct {\n\tMsg string\n}\n```\n\n```go\nfunc (be *BadRequestError) Error() string\n```\n\n```go\ntype Client struct {\n\tSocketPath string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc DefaultClient() (*Client, error)\n```\nDefaultClient 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.\n\n```go\nfunc NewClient(socketPath string) (*Client, error)\n```\n\n```go\nfunc (c *Client) Close()\n```\n\n```go\nfunc (c *Client) Get(url string) ([]byte, error)\n```\n\n```go\nfunc (c *Client) Post(targetUrl string, data map[string][]string) ([]byte, error)\n```\n\n```go\ntype ConfigRequest struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Config(client *Client) *ConfigRequest\n```\n\n```go\nfunc (cr *ConfigRequest) List(format string) ([]byte, error)\n```\n\n```go\nfunc (cr *ConfigRequest) Set(name string, value string, duration time.Duration) ([]byte, error)\n```\n\n```go\ntype HookRequest struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Hook(client *Client) *HookRequest\n```\n\n```go\nfunc (r *HookRequest) List(format string) ([]byte, error)\n```\n\n```go\nfunc (r *HookRequest) Name(name string) *HookRequest\n```\n\n```go\nfunc (r *HookRequest) Snapshots(format string) ([]byte, error)\n```\n\n```go\ntype NotFoundError struct {\n\tMsg string\n}\n```\n\n```go\nfunc (nf *NotFoundError) Error() string\n```\n\n```go\ntype QueueRequest struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Queue(client *Client) *QueueRequest\n```\n\n```go\nfunc (qr *QueueRequest) List(format string, showEmpty bool) ([]byte, error)\n```\n\n```go\nfunc (qr *QueueRequest) Main(format string) ([]byte, error)\n```\n\n```go\ntype Server struct {\n\tPrefix     string\n\tSocketPath string\n\tHttpAddr   string\n\n\tRouter chi.Router\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewServer(prefix, socketPath, httpAddr string, logger *log.Logger) *Server\n```\n\n```go\nfunc (s *Server) Init() error\n```\n\n```go\nfunc (s *Server) RegisterHandler(method, pattern string, handler func(request *http.Request) (interface{}, error))\n```\nRegisterHandler registers http handler for unix/http debug server\n\n```go\nfunc (s *Server) Shutdown(ctx context.Context) error\n```\nShutdown 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.\n\n","path":"github.com/flant/shell-operator/pkg/debug","name":"debug","synopsis":"","isRedistributable":true}
