Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowDomainHandlerConfig ¶
type AllowDomainHandlerConfig struct {
Runtime container.Runtime
ContainerName string
// PromptFunc overrides the tmux popup prompt for testing.
PromptFunc func(domain string) (bool, error)
// ReloadFunc overrides domain reload for testing.
ReloadFunc func(domain string) error
}
AllowDomainHandlerConfig holds dependencies for the allow_domain handler.
type AllowDomainRequest ¶
type AllowDomainRequest struct {
Domain string `json:"domain"`
}
AllowDomainRequest is the payload for "allow_domain" requests.
type AllowDomainResponse ¶
type AllowDomainResponse struct {
Approved bool `json:"approved"`
Error string `json:"error,omitempty"`
}
AllowDomainResponse is the payload for "allow_domain" responses.
type HandlerFunc ¶
HandlerFunc processes an IPC request and returns a response payload.
func NewAllowDomainHandler ¶
func NewAllowDomainHandler(cfg AllowDomainHandlerConfig) HandlerFunc
NewAllowDomainHandler returns a HandlerFunc that validates a domain, prompts the user via a tmux popup in the container, and hot-reloads Squid on approval.
type Request ¶
type Request struct {
Type string `json:"type"`
ID string `json:"id"`
Payload json.RawMessage `json:"payload"`
}
Request is a message sent from the container to the host.
type Response ¶
type Response struct {
Type string `json:"type"`
ID string `json:"id"`
Payload interface{} `json:"payload"`
}
Response is a message sent from the host back to the container.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server listens on a Unix domain socket and dispatches JSON-lines messages.
func (*Server) Handle ¶
func (s *Server) Handle(msgType string, h HandlerFunc)
Handle registers a handler for a message type.
func (*Server) SocketDir ¶
SocketDir returns the directory containing the socket (for container mount).