Documentation
¶
Overview ¶
Package rpc implements the communication between the h2c command line interface and the h2c process.
The command line interface uses a simple request/response protocol to communicate with the h2c process:
The cli sends a Command struct to the h2c process, and receives a Result struct as result.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
Command struct is sent from the command line interface to the h2c process.
func NewCommand ¶
func UnmarshalCommand ¶
Used by the h2c process when receiving a command from the command line interface.
type IpcManager ¶
type IpcManager interface { IsListening() bool Listen() (net.Listener, error) Dial() (net.Conn, error) InUseErrorMessage() string }
IpcManager maintains the socket for communication between the cli and the h2c process.
type Result ¶
type Result struct { Message string Error *string // Should be type error, but this doesn't seem to work well with JSON marshalling. }
Result is sent from the h2c process to the command line interface.
func UnmarshalResult ¶
Used by the command line interface when receiving a Result from the h2c process.
type UnixSocketConnection ¶
type UnixSocketConnection struct {
// contains filtered or unexported fields
}
Implements rpc.IpcManager
func NewIpcManager ¶
func NewIpcManager() *UnixSocketConnection
func (*UnixSocketConnection) InUseErrorMessage ¶
func (s *UnixSocketConnection) InUseErrorMessage() string
func (*UnixSocketConnection) IsListening ¶
func (s *UnixSocketConnection) IsListening() bool