Skip to content

Commit

Permalink
Delete default client Send and SendMany
Browse files Browse the repository at this point in the history
  • Loading branch information
amh4r committed Feb 19, 2025
1 parent f920e31 commit 3c608b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
18 changes: 0 additions & 18 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ const (
defaultEndpoint = "https://inn.gs"
)

// Send uses the DefaultClient to send the given event.
func Send(ctx context.Context, e any) (string, error) {
client, ok := ctx.Value(clientCtxKey).(Client)
if !ok || client == nil {
return "", fmt.Errorf("client not found in context")
}
return client.Send(ctx, e)
}

// SendMany uses the DefaultClient to send the given event batch.
func SendMany(ctx context.Context, e []any) ([]string, error) {
client, ok := ctx.Value(clientCtxKey).(Client)
if !ok || client == nil {
return nil, fmt.Errorf("client not found in context")
}
return client.SendMany(ctx, e)
}

// Client represents a client used to send events to Inngest.
type Client interface {
AppID() string
Expand Down
4 changes: 2 additions & 2 deletions tests/invoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func TestInvoke(t *testing.T) {
defer server.Close()
r.NoError(sync())

_, err = inngestgo.Send(ctx, inngestgo.Event{
_, err = c.Send(ctx, inngestgo.Event{
Name: eventName,
Data: map[string]any{"foo": "bar"}},
)
Expand Down Expand Up @@ -392,7 +392,7 @@ func TestInvoke(t *testing.T) {
defer server.Close()
r.NoError(sync())

_, err = inngestgo.Send(ctx, inngestgo.Event{
_, err = c.Send(ctx, inngestgo.Event{
Name: eventName,
Data: map[string]any{"foo": "bar"}},
)
Expand Down

0 comments on commit 3c608b5

Please sign in to comment.