-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdestination.go
53 lines (44 loc) · 1.1 KB
/
destination.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
package connectorName
import (
"context"
sdk "github.com/conduitio/conduit-connector-sdk"
)
type Destination struct {
sdk.UnimplementedDestination
config DestinationConfig
}
func NewDestination() sdk.Destination {
return &Destination{}
}
func (d *Destination) Parameters() map[string]sdk.Parameter {
return map[string]sdk.Parameter{
GlobalConfigParam: {
Default: "localhost:10000",
Required: true,
Description: "The URL of the server.",
},
DestinationConfigParam: {
Default: "false",
Required: false,
Description: "An optional configuration parameter.",
},
}
}
func (d *Destination) Configure(ctx context.Context, cfg map[string]string) error {
sdk.Logger(ctx).Info().Msg("Configuring a Destination connector...")
config, err := ParseDestinationConfig(cfg)
if err != nil {
return err
}
d.config = config
return nil
}
func (d *Destination) Open(ctx context.Context) error {
return nil
}
func (d *Destination) Write(ctx context.Context, records []sdk.Record) (int, error) {
return 0, nil
}
func (d *Destination) Teardown(ctx context.Context) error {
return nil
}