Documentation
¶
Overview ¶
Package grantsock is the Unix socket the launcher (`txco sandbox`) reaches the chassis on: the `grant` personality. It carries a program's request to open a sandbox to the grant gateway and the gateway's answer back (chassis/grantwire has the protocol).
It is a socket and not a route on the web head because only processes on this machine have any business asking: the socket lives in a directory only the chassis's user may enter, so nothing on the network can reach it and nothing else on the machine can either.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath is where the socket lives when --grant-socket is not given: a directory of its own under the system's temp dir, named for the chassis's data directory so two chassis on one machine do not share it and a restart finds the same place.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller listens on the socket.
func New ¶
New prepares the socket at path and refuses what cannot work: a path too long for the kernel, a directory others may enter, a socket another chassis is listening on.
func (*Controller) Listen ¶
func (c *Controller) Listen() error
Listen makes the socket. It is apart from Start so that a chassis that cannot listen fails at boot, not in a goroutine.
func (*Controller) Start ¶
func (c *Controller) Start()
Start serves the socket until Stop, and returns at once, as every personality's Start does. Listen must have succeeded; without it Start does nothing.
func (*Controller) Stop ¶
func (c *Controller) Stop()
Stop closes the socket, waits for the requests in flight, and removes it.