Skip to content

Commit

Permalink
feat: Get all connections
Browse files Browse the repository at this point in the history
  • Loading branch information
alexluong committed Jun 5, 2024
1 parent 5d725f6 commit 4bed96e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/listen/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ import (
)

func getConnections(client *hookdeckclient.Client, sources []*hookdecksdk.Source, connectionQuery string) ([]*hookdecksdk.Connection, error) {
source := sources[0]
connections := []*hookdecksdk.Connection{}

for _, source := range sources {
sourceConnections, err := getConnectionsPerSource(client, source, connectionQuery)
if err != nil {
return []*hookdecksdk.Connection{}, nil
}
connections = append(connections, sourceConnections...)
}

return connections, nil
}

func getConnectionsPerSource(client *hookdeckclient.Client, source *hookdecksdk.Source, connectionQuery string) ([]*hookdecksdk.Connection, error) {
// TODO: Filter connections using connectionQuery
var connections []*hookdecksdk.Connection
connectionList, err := client.Connection.List(context.Background(), &hookdecksdk.ConnectionListRequest{
Expand Down

0 comments on commit 4bed96e

Please sign in to comment.