trireme-lib: go.aporeto.io/trireme-lib/monitor/remoteapi/server Index | Files

package server

import "go.aporeto.io/trireme-lib/monitor/remoteapi/server"

Index

Package Files

interfaces.go server.go uidlistener.go

type APIServer Uses

type APIServer interface {
    // Run runs an API server
    Run(ctx context.Context) error
}

APIServer is the main interface of the API server. Allows to create mock functions for testing.

type EventServer Uses

type EventServer struct {
    // contains filtered or unexported fields
}

EventServer is a new event server

func NewEventServer Uses

func NewEventServer(address string, registerer registerer.Registerer) (*EventServer, error)

NewEventServer creates a new event server

func (*EventServer) Run Uses

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 Uses

func (e *EventServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is called for every request.

type UIDAddr Uses

type UIDAddr struct {
    NetworkAddress string
    Address        string
}

UIDAddr implements the Addr interface and allows us to customize the address.

func (*UIDAddr) Network Uses

func (a *UIDAddr) Network() string

Network returns the network of the connection

func (*UIDAddr) String Uses

func (a *UIDAddr) String() string

String returns a string representation.

type UIDConnection Uses

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 Uses

func (c UIDConnection) Close() error

Close implements the close interface of the connection.

func (UIDConnection) LocalAddr Uses

func (c UIDConnection) LocalAddr() net.Addr

LocalAddr implements the LocalAddr interface of the connection.

func (UIDConnection) Read Uses

func (c UIDConnection) Read(b []byte) (n int, err error)

Read implements the read interface of the connection.

func (UIDConnection) RemoteAddr Uses

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 Uses

func (c UIDConnection) SetDeadline(t time.Time) error

SetDeadline implements the SetDeadLine interface.

func (UIDConnection) SetReadDeadline Uses

func (c UIDConnection) SetReadDeadline(t time.Time) error

SetReadDeadline implements the SetReadDeadling interface

func (UIDConnection) SetWriteDeadline Uses

func (c UIDConnection) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements the SetWriteDeadline method of the interface.

func (UIDConnection) Write Uses

func (c UIDConnection) Write(b []byte) (n int, err error)

Write implements the write interface of the connection.

type UIDListener Uses

type UIDListener struct {
    // contains filtered or unexported fields
}

UIDListener is a custom net listener that uses the UID connection

func NewUIDListener Uses

func NewUIDListener(nl *net.UnixListener) *UIDListener

NewUIDListener creates a new UID listener.

func (UIDListener) Accept Uses

func (l UIDListener) Accept() (c net.Conn, err error)

Accept implements the accept method of the interface.

func (UIDListener) Addr Uses

func (l UIDListener) Addr() net.Addr

Addr returns the address of the listener.

func (UIDListener) Close Uses

func (l UIDListener) Close() error

Close implements the close method of the interface.

Package server imports 15 packages (graph) and is imported by 4 packages. Updated 2019-06-12. Refresh now. Tools for package owners.