daemon

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataDir

func DataDir() (string, error)

func Run

func Run(cfg Config) error

func WaitForSocket

func WaitForSocket(dataDir string) error

Types

type Client

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

func NewClient

func NewClient(dataDir string) *Client

func (*Client) Send

func (c *Client) Send(req Request) (*Response, error)

type Config

type Config struct {
	Domains []string
	Hosts   []string
	Port    int
	Daemon  bool
}

type GetParams

type GetParams struct {
	ID int64 `json:"id"`
}

type IPCServer

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

func NewIPCServer

func NewIPCServer(dataDir string, store storage.Store, shutdown chan struct{}) (*IPCServer, error)

func (*IPCServer) Close

func (s *IPCServer) Close() error

func (*IPCServer) Serve

func (s *IPCServer) Serve()

type LogsParams

type LogsParams struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type Request

type Request struct {
	Command string          `json:"command"` // "logs", "search", "get", "req", "res", "tail", "clear", "shutdown"
	Params  json.RawMessage `json:"params"`
}

type Response

type Response struct {
	OK    bool            `json:"ok"`
	Data  json.RawMessage `json:"data,omitempty"`
	Error string          `json:"error,omitempty"`
}

type SearchRequestParams

type SearchRequestParams struct {
	Method  string   `json:"method,omitempty"`
	Host    string   `json:"host,omitempty"`
	Domains []string `json:"domains,omitempty"`
	Path    string   `json:"path,omitempty"`
	Status  int      `json:"status,omitempty"`
	Limit   int      `json:"limit,omitempty"`
	Offset  int      `json:"offset,omitempty"`
}

type TailParams added in v0.3.2

type TailParams struct {
	AfterID int64 `json:"after_id"`
	Limit   int   `json:"limit"`
}

Jump to

Keyboard shortcuts

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