garm/vendor/github.com/gorilla/websocket
Gabriel Adrian Samfira 9f8659abd6 Add events websocket endpoint
This change adds a new websocket endpoint for database events. The events
endpoint allows clients to stream events as they happen in GARM. Events
are defined as a structure containning the event type (create, update, delete),
the database entity involved (instances, pools, repos, etc) and the payload
consisting of the object involved in the event. The payload translates
to the types normally returned by the API and can be deserialized as one
of the types present in the params package.

The events endpoint is a websocket endpoint and it accepts filters as
a simple json send over the websocket connection. The filters allows the
user to specify which entities are of interest, and which operations should
be returned. For example, you may be interested in changes made to pools
or runners, in which case you could create a filter that only returns
update operations for pools. Or update and delete operations.

The filters can be defined as:

{
  "filters": [
    {
      "entity_type": "instance",
      "operations": ["update", "delete"]
    },
    {
      "entity_type": "pool"
    },
  ],
  "send_everything": false
}

This would return only update and delete events for instances and all events
for pools. Alternatively you can ask GARM to send you everything:

{
  "send_everything": true
}

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2024-07-05 12:55:35 +00:00
..
.gitignore Add events websocket endpoint 2024-07-05 12:55:35 +00:00
AUTHORS Add events websocket endpoint 2024-07-05 12:55:35 +00:00
client.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
compression.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
conn.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
doc.go Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
join.go Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
json.go Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
LICENSE Add events websocket endpoint 2024-07-05 12:55:35 +00:00
mask.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
mask_safe.go Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
prepared.go Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
proxy.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
README.md Add events websocket endpoint 2024-07-05 12:55:35 +00:00
server.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00
util.go Add events websocket endpoint 2024-07-05 12:55:35 +00:00

Gorilla WebSocket

GoDoc CircleCI

Gorilla WebSocket is a Go implementation of the WebSocket protocol.

Documentation

Status

The Gorilla WebSocket package provides a complete and tested implementation of the WebSocket protocol. The package API is stable.

Installation

go get github.com/gorilla/websocket

Protocol Compliance

The Gorilla WebSocket package passes the server tests in the Autobahn Test Suite using the application in the examples/autobahn subdirectory.