-
Notifications
You must be signed in to change notification settings - Fork 2
/
integrations.go
40 lines (32 loc) · 1.4 KB
/
integrations.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
package sdkservices
import (
"context"
"go.autokitteh.dev/autokitteh/sdk/sdkexecutor"
"go.autokitteh.dev/autokitteh/sdk/sdktypes"
)
type ListIntegrationsFilter struct {
NameSubstring string
// TODO: Categories
}
// Integrations is implemented by the autokitteh core, to manage integrations
// of external services within a running autokitteh server.
type Integrations interface {
// Get returns the instance of an integration which has already been registered
// in the autokitteh server, and is available for usage by runtime connections.
GetByID(ctx context.Context, id sdktypes.IntegrationID) (Integration, error)
GetByName(ctx context.Context, name sdktypes.Symbol) (Integration, error)
// List returns an enumeration - with optional filtering - of all
// the integrations which have been registered in the autokitteh
// server, and are available for usage by runtime connections.
// TODO: Add an optional tag-search-term filter argument.
List(ctx context.Context, nameSubstring string) ([]sdktypes.Integration, error)
}
// Integration is implemented for each external service, to let the autokitteh
// server interact with it.
type Integration interface {
// Get returns the configuration details of this integration and the
// external service that it wraps.
Get() sdktypes.Integration
Configure(ctx context.Context, cid sdktypes.ConnectionID) (map[string]sdktypes.Value, error)
sdkexecutor.Caller
}