Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
YoEight authored and w1am committed Apr 26, 2024
1 parent e0a870e commit 67ea989
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
esdb_version: ${{ matrix.version }}
secrets: inherit

linting:
needs: tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
esdb_version: ${{ inputs.version }}
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Login to Cloudsmith
uses: docker/login-action@v3
with:
registry: docker.eventstore.com
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}

- name: Generate certificates
run: docker-compose --file docker-compose.yml up

Expand All @@ -63,6 +70,13 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Login to Cloudsmith
uses: docker/login-action@v3
with:
registry: docker.eventstore.com
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}

- name: Set up cluster with Docker Compose
run: |
docker-compose -f cluster-docker-compose.yml up -d
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Updated
- Update dependencies. [EventStore-Client-Go#172](https://github.com/EventStore/EventStore-Client-Go/pull/172)

## [4.0.0] - 2024-03-03
### Added
- Add missing persistent subscription API samples. [EventStore-Client-Go#168](https://github.com/EventStore/EventStore-Client-Go/pull/168)
- Implement projections API. [EventStore-Client-Go#167](https://github.com/EventStore/EventStore-Client-Go/pull/167)

### Changed
- Move to google uuid implementation. [EventStore-Client-Go#169](https://github.com/EventStore/EventStore-Client-Go/pull/169)
- Move to version 4. [EventStore-Client-Go#170](https://github.com/EventStore/EventStore-Client-Go/pull/170)

## [3.3.0] - 2024-01-27
### Added
- CaughtUp and FellBehind message handling in subscription [EventStore-Client-Go#161](https://github.com/EventStore/EventStore-Client-Go/pull/161)
Expand Down Expand Up @@ -54,4 +66,4 @@ All notable changes to this project will be documented in this file.

### Fixed
- Fix RequiresLeader header when node preference is set to Leader. [EventStore-Client-Go#126](https://github.com/EventStore/EventStore-Client-Go/pull/126)
- Respect `MaxDiscoverAttempts` setting. [EventStore-Client-Go#122](https://github.com/EventStore/EventStore-Client-Go/pull/122)
- Respect `MaxDiscoverAttempts` setting. [EventStore-Client-Go#122](https://github.com/EventStore/EventStore-Client-Go/pull/122)
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# EventStoreDB Client SDK for Golang [![Actions Status](https://github.com/eventstore/EventStore-Client-Go/workflows/CI/badge.svg?branch=master)](https://github.com/eventstore/EventStore-Client-Go/actions)

EventStoreDB is the event-native database, where business events are immutably stored and streamed. Designed for event-sourced, event-driven, and microservices architectures.

This repository contains an [EventStoreDB][es] Client SDK written in Go.

## Developing
Expand Down Expand Up @@ -37,6 +39,11 @@ export EVENTSTORE_DOCKER_TAG_ENV="21.10.0-focal"
make test
```

## Communities

- [Discuss](https://discuss.eventstore.com/)
- [Discord (Event Store)](https://discord.gg/Phn9pmCw3t)

## Security

If you find a vulnerability in our software, please contact us. You can find how to reach out us and report it at https://www.eventstore.com/security#security
Expand All @@ -52,4 +59,4 @@ All contributions to the SDK are made via GitHub Pull Requests, and must be lice
[docker compose]: https://www.docker.com/

[es]: https://eventstore.com
[make]: https://www.gnu.org/software/make/
[make]: https://www.gnu.org/software/make/
8 changes: 4 additions & 4 deletions cluster-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
network_mode: none

cert-gen:
image: eventstore/es-gencert-cli:1.0.2
image: docker.eventstore.com/eventstore-utils/es-gencert-cli:latest
entrypoint: bash
user: "1000:1000"
command: >
Expand All @@ -26,7 +26,7 @@ services:
- volumes-provisioner

esdb-node1:
image: ghcr.io/eventstore/eventstore:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
image: docker.eventstore.com/eventstore-ce/eventstoredb-ce:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
env_file:
- shared.env
environment:
Expand All @@ -47,7 +47,7 @@ services:
- cert-gen

esdb-node2:
image: ghcr.io/eventstore/eventstore:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
image: docker.eventstore.com/eventstore-ce/eventstoredb-ce:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
env_file:
- shared.env
environment:
Expand All @@ -68,7 +68,7 @@ services:
- cert-gen

esdb-node3:
image: ghcr.io/eventstore/eventstore:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
image: docker.eventstore.com/eventstore-ce/eventstoredb-ce:${EVENTSTORE_DOCKER_TAG_ENV:-latest}
env_file:
- shared.env
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
network_mode: "none"

setup:
image: eventstore/es-gencert-cli:1.0.2
image: docker.eventstore.com/eventstore-utils/es-gencert-cli:latest
entrypoint: bash
user: "1000:1000"
command: >
Expand Down
2 changes: 1 addition & 1 deletion esdb/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type EventStoreDockerConfig struct {
}

const (
DEFAULT_EVENTSTORE_DOCKER_REPOSITORY = "ghcr.io/eventstore/testdata"
DEFAULT_EVENTSTORE_DOCKER_REPOSITORY = "docker.eventstore.com/eventstore-utils/testdata"
DEFAULT_EVENTSTORE_DOCKER_TAG = "latest"
DEFAULT_EVENTSTORE_DOCKER_PORT = "2113"
)
Expand Down
123 changes: 123 additions & 0 deletions samples/persistentSubscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package samples

import (
"context"
"fmt"
"log"
"strings"

"github.com/EventStore/EventStore-Client-Go/v3/esdb"
)
Expand Down Expand Up @@ -125,3 +128,123 @@ func deletePersistentSubscription(client *esdb.Client) {
}
// #endregion delete-persistent-subscription
}

func deletePersistentSubscriptionToAll(client *esdb.Client) {
// #region delete-persistent-subscription-all
err := client.DeletePersistentSubscriptionToAll(context.Background(), "test-stream", esdb.DeletePersistentSubscriptionOptions{})

if err != nil {
panic(err)
}
// #endregion delete-persistent-subscription-all
}

func getPersistentSubscriptionToStreamInfo(client *esdb.Client) {
// #region get-persistent-subscription-to-stream-info
info, err := client.GetPersistentSubscriptionInfo(context.Background(), "test-stream", "subscription-group", esdb.GetPersistentSubscriptionOptions{})

if err != nil {
panic(err)
}

log.Printf("groupName: %s eventsource: %s status: %s", info.GroupName, info.EventSource, info.Status)
// #endregion get-persistent-subscription-to-stream-info
}

func getPersistentSubscriptionToAllInfo(client *esdb.Client) {
// #region get-persistent-subscription-to-all-info
info, err := client.GetPersistentSubscriptionInfoToAll(context.Background(), "subscription-group", esdb.GetPersistentSubscriptionOptions{})

if err != nil {
panic(err)
}

log.Printf("groupName: %s eventsource: %s status: %s", info.GroupName, info.EventSource, info.Status)
// #endregion get-persistent-subscription-to-all-info
}

func replayParkedToStream(client *esdb.Client) {
// #region replay-parked-of-persistent-subscription-to-stream
err := client.ReplayParkedMessages(context.Background(), "test-stream", "subscription-group", esdb.ReplayParkedMessagesOptions{
StopAt: 10,
})

if err != nil {
panic(err)
}
// #endregion replay-parked-of-persistent-subscription-to-stream
}

func replayParkedToAll(client *esdb.Client) {
// #region replay-parked-of-persistent-subscription-to-all
err := client.ReplayParkedMessagesToAll(context.Background(), "subscription-group", esdb.ReplayParkedMessagesOptions{
StopAt: 10,
})

if err != nil {
panic(err)
}
// #endregion replay-parked-of-persistent-subscription-to-all
}

func listPersistentSubscriptionsToStream(client *esdb.Client) {
// #region list-persistent-subscriptions-to-stream
subs, err := client.ListPersistentSubscriptionsForStream(context.Background(), "test-stream", esdb.ListPersistentSubscriptionsOptions{})

if err != nil {
panic(err)
}

var entries []string

for i := range subs {
entries = append(
entries,
fmt.Sprintf(
"groupName: %s eventSource: %s status: %s",
subs[i].GroupName,
subs[i].EventSource,
subs[i].Status,
),
)
}

log.Printf("subscriptions to stream: [ %s ]", strings.Join(entries, ","))
// #endregion list-persistent-subscriptions-to-stream
}

func listPersistentSubscriptionsToAll(client *esdb.Client) {
// #region list-persistent-subscriptions-to-all
subs, err := client.ListPersistentSubscriptionsToAll(context.Background(), esdb.ListPersistentSubscriptionsOptions{})

if err != nil {
panic(err)
}

var entries []string

for i := range subs {
entries = append(
entries,
fmt.Sprintf(
"groupName: %s eventSource: %s status: %s",
subs[i].GroupName,
subs[i].EventSource,
subs[i].Status,
),
)
}

log.Printf("subscriptions to stream: [ %s ]", strings.Join(entries, ","))
// #endregion list-persistent-subscriptions-to-all
}

func restartPersistentSubscriptionSubsystem(client *esdb.Client) {
// #region restart-persistent-subscription-subsystem
err := client.RestartPersistentSubscriptionSubsystem(context.Background(), esdb.RestartPersistentSubscriptionSubsystemOptions{})

if err != nil {
panic(err)
}
// #endregion restart-persistent-subscription-subsystem
}

0 comments on commit 67ea989

Please sign in to comment.