Documentation ¶
Index ¶
- type APIServer
- type EventServer
- type UIDAddr
- type UIDConnection
- func (c UIDConnection) Close() error
- func (c UIDConnection) LocalAddr() net.Addr
- func (c UIDConnection) Read(b []byte) (n int, err error)
- func (c UIDConnection) RemoteAddr() net.Addr
- func (c UIDConnection) SetDeadline(t time.Time) error
- func (c UIDConnection) SetReadDeadline(t time.Time) error
- func (c UIDConnection) SetWriteDeadline(t time.Time) error
- func (c UIDConnection) Write(b []byte) (n int, err error)
- type UIDListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
APIServer is the main interface of the API server. Allows to create mock functions for testing.
type EventServer ¶
type EventServer struct {
// contains filtered or unexported fields
}
EventServer is a new event server
func NewEventServer ¶
func NewEventServer(address string, registerer registerer.Registerer) (*EventServer, error)
NewEventServer creates a new event server
func (*EventServer) Run ¶
func (e *EventServer) Run(ctx context.Context) error
Run runs the server. The server will run in the background. It will gracefully die with the provided context.
func (*EventServer) ServeHTTP ¶
func (e *EventServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is called for every request.
type UIDAddr ¶
UIDAddr implements the Addr interface and allows us to customize the address.
type UIDConnection ¶
type UIDConnection struct {
// contains filtered or unexported fields
}
UIDConnection is a connection wrapper that allows to recover the user ID of the calling process.
func (UIDConnection) Close ¶
func (c UIDConnection) Close() error
Close implements the close interface of the connection.
func (UIDConnection) LocalAddr ¶
func (c UIDConnection) LocalAddr() net.Addr
LocalAddr implements the LocalAddr interface of the connection.
func (UIDConnection) Read ¶
func (c UIDConnection) Read(b []byte) (n int, err error)
Read implements the read interface of the connection.
func (UIDConnection) RemoteAddr ¶
func (c UIDConnection) RemoteAddr() net.Addr
RemoteAddr implements the RemoteAddr interface of the connection. This is the main change where we actually use the FD of the unix socket to find the remote UID.
func (UIDConnection) SetDeadline ¶
func (c UIDConnection) SetDeadline(t time.Time) error
SetDeadline implements the SetDeadLine interface.
func (UIDConnection) SetReadDeadline ¶
func (c UIDConnection) SetReadDeadline(t time.Time) error
SetReadDeadline implements the SetReadDeadling interface
func (UIDConnection) SetWriteDeadline ¶
func (c UIDConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline implements the SetWriteDeadline method of the interface.
type UIDListener ¶
type UIDListener struct {
// contains filtered or unexported fields
}
UIDListener is a custom net listener that uses the UID connection
func (UIDListener) Accept ¶
func (l UIDListener) Accept() (c net.Conn, err error)
Accept implements the accept method of the interface.
func (UIDListener) Addr ¶
func (l UIDListener) Addr() net.Addr
Addr returns the address of the listener.
func (UIDListener) Close ¶
func (l UIDListener) Close() error
Close implements the close method of the interface.