Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoReadyMessage = errors.New("container stopped running before READY message was received")
ErrNoReadyMessage is returned when we are waiting for the READY message of a container that is not in the running state anymore.
Functions ¶
func SendMessage ¶
SendMessage sends the specified message to the specified socket. No message is sent if no socketPath is provided and the NOTIFY_SOCKET variable is not set either.
Types ¶
type Container ¶
type Container interface { State() (define.ContainerStatus, error) ID() string }
Container avoids a circular dependency among this package and libpod.
type NotifyProxy ¶
type NotifyProxy struct {
// contains filtered or unexported fields
}
NotifyProxy can be used to proxy notify messages.
func New ¶
func New(tmpDir string) (*NotifyProxy, error)
New creates a NotifyProxy that starts listening immediately. The specified temp directory can be left empty.
func (*NotifyProxy) AddContainer ¶
func (p *NotifyProxy) AddContainer(container Container)
AddContainer associates a container with the proxy.
func (*NotifyProxy) Close ¶
func (p *NotifyProxy) Close() error
Close closes the listener and removes the socket.
func (*NotifyProxy) SocketPath ¶
func (p *NotifyProxy) SocketPath() string
SocketPath returns the path of the socket the proxy is listening on.
func (*NotifyProxy) Wait ¶
func (p *NotifyProxy) Wait() error
Wait waits until receiving the `READY` notify message. Note that the this function must only be executed inside a systemd service which will kill the process after a given timeout. If the (optional) container stopped running before the `READY` is received, the waiting gets canceled and ErrNoReadyMessage is returned.