/
esdb2.go
113 lines (111 loc) · 3.69 KB
/
esdb2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package eventstore_db
import (
"context"
"github.com/EventStore/EventStore-Client-Go/v2/esdb"
)
type IESDB interface {
Close() error
AppendToStream(
context context.Context,
streamID string,
opts esdb.AppendToStreamOptions,
events ...esdb.EventData,
) (*esdb.WriteResult, error)
SetStreamMetadata(
context context.Context,
streamID string,
opts esdb.AppendToStreamOptions,
metadata esdb.StreamMetadata,
) (*esdb.WriteResult, error)
GetStreamMetadata(
context context.Context,
streamID string,
opts esdb.ReadStreamOptions,
) (*esdb.StreamMetadata, error)
DeleteStream(
parent context.Context,
streamID string,
opts esdb.DeleteStreamOptions,
) (*esdb.DeleteResult, error)
TombstoneStream(
parent context.Context,
streamID string,
opts esdb.TombstoneStreamOptions,
) (*esdb.DeleteResult, error)
ReadStream(
context context.Context,
streamID string,
opts esdb.ReadStreamOptions,
count uint64,
) (*esdb.ReadStream, error)
ReadAll(
context context.Context,
opts esdb.ReadAllOptions,
count uint64,
) (*esdb.ReadStream, error)
SubscribeToStream(
parent context.Context,
streamID string,
opts esdb.SubscribeToStreamOptions,
) (*esdb.Subscription, error)
SubscribeToAll(
parent context.Context,
opts esdb.SubscribeToAllOptions,
) (*esdb.Subscription, error)
SubscribeToPersistentSubscription(
ctx context.Context,
streamName string,
groupName string,
options esdb.SubscribeToPersistentSubscriptionOptions,
) (*esdb.PersistentSubscription, error)
SubscribeToPersistentSubscriptionToAll(
ctx context.Context,
groupName string,
options esdb.SubscribeToPersistentSubscriptionOptions,
) (*esdb.PersistentSubscription, error)
CreatePersistentSubscription(
ctx context.Context,
streamName string,
groupName string,
options esdb.PersistentStreamSubscriptionOptions,
) error
CreatePersistentSubscriptionToAll(
ctx context.Context,
groupName string,
options esdb.PersistentAllSubscriptionOptions,
) error
UpdatePersistentSubscription(
ctx context.Context,
streamName string,
groupName string,
options esdb.PersistentStreamSubscriptionOptions,
) error
UpdatePersistentSubscriptionToAll(
ctx context.Context,
groupName string,
options esdb.PersistentAllSubscriptionOptions,
) error
DeletePersistentSubscription(
ctx context.Context,
streamName string,
groupName string,
options esdb.DeletePersistentSubscriptionOptions,
) error
DeletePersistentSubscriptionToAll(
ctx context.Context,
groupName string,
options esdb.DeletePersistentSubscriptionOptions,
) error
ReplayParkedMessages(
ctx context.Context,
streamName string,
groupName string,
options esdb.ReplayParkedMessagesOptions) error
ReplayParkedMessagesToAll(ctx context.Context, groupName string, options esdb.ReplayParkedMessagesOptions) error
ListAllPersistentSubscriptions(ctx context.Context, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
ListPersistentSubscriptionsForStream(ctx context.Context, streamName string, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
ListPersistentSubscriptionsToAll(ctx context.Context, options esdb.ListPersistentSubscriptionsOptions) ([]esdb.PersistentSubscriptionInfo, error)
GetPersistentSubscriptionInfo(ctx context.Context, streamName string, groupName string, options esdb.GetPersistentSubscriptionOptions) (*esdb.PersistentSubscriptionInfo, error)
GetPersistentSubscriptionInfoToAll(ctx context.Context, groupName string, options esdb.GetPersistentSubscriptionOptions) (*esdb.PersistentSubscriptionInfo, error)
RestartPersistentSubscriptionSubsystem(ctx context.Context, options esdb.RestartPersistentSubscriptionSubsystemOptions) error
}