Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attach ¶
Attach takes an existing Getter and forwards each event retrieved from it to the provided forwarder. For example, if the source is a client for a remote exchange and sink is a local exchange, Attach will result in each event published on the remote exchange to be forwarded to the local exchange, essentially bridging the two together.
func RegisterGetterService ¶
RegisterGetterService adds the Getter service as a method to the provided TTRPC server.
Types ¶
type Getter ¶
type Getter interface { // GetEvent retrieves a single event from the source provided by the implementation. If no event is available at the // time of the call, GetEvent is expected to block until an event is available, an error occurs or the context is // canceled. GetEvent(ctx context.Context) (*eventapi.Envelope, error) }
The Getter interface provides an API for retrieving containerd events from a remote event source, such as an exchange. It exists separately from containerd's existing EventClient and EventServer interfaces in order to support retrieving events via long-polling as opposed to a streaming model. This allows us to use TTRPC for the implementation, which currently does not support streaming.
func NewGetterClient ¶
NewGetterClient returns a client-side implementation of the Getter interface using the provided TTRPC client to connect to the server.
func NewGetterService ¶
func NewGetterService(ctx context.Context, eventSource events.Subscriber) Getter
NewGetterService returns a server-side implementation of the Getter interface. Given an existing event source, it will subscribe to that source with no filters. Each GetEvent call pops and returns an event buffered in the subscription's channel of published events. If no event is buffered, it blocks until one is.