Skip to content

Commit b817801

Browse files
[PRIV-158] Add UnimplementedGatewayConnector type (#1512)
1 parent 1d271aa commit b817801

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pkg/types/core/gateway_connector.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package core
33
import (
44
"context"
55
"encoding/json"
6+
"fmt"
67

78
jsonrpc "github.com/smartcontractkit/chainlink-common/pkg/jsonrpc2"
89
)
@@ -30,3 +31,31 @@ type GatewayConnectorHandler interface {
3031
// HandleGatewayMessage is called when a message is received from a gateway
3132
HandleGatewayMessage(ctx context.Context, gatewayID string, req *jsonrpc.Request[json.RawMessage]) error
3233
}
34+
35+
var _ GatewayConnector = (*UnimplementedGatewayConnector)(nil)
36+
37+
type UnimplementedGatewayConnector struct{}
38+
39+
func (u *UnimplementedGatewayConnector) AddHandler(ctx context.Context, methods []string, handler GatewayConnectorHandler) error {
40+
return fmt.Errorf("not implemented")
41+
}
42+
43+
func (u *UnimplementedGatewayConnector) SendToGateway(ctx context.Context, gatewayID string, resp *jsonrpc.Response[json.RawMessage]) error {
44+
return fmt.Errorf("not implemented")
45+
}
46+
47+
func (u *UnimplementedGatewayConnector) SignMessage(ctx context.Context, msg []byte) ([]byte, error) {
48+
return nil, fmt.Errorf("not implemented")
49+
}
50+
51+
func (u *UnimplementedGatewayConnector) GatewayIDs(ctx context.Context) ([]string, error) {
52+
return nil, fmt.Errorf("not implemented")
53+
}
54+
55+
func (u *UnimplementedGatewayConnector) DonID(ctx context.Context) (string, error) {
56+
return "", fmt.Errorf("not implemented")
57+
}
58+
59+
func (u *UnimplementedGatewayConnector) AwaitConnection(ctx context.Context, gatewayID string) error {
60+
return fmt.Errorf("not implemented")
61+
}

0 commit comments

Comments
 (0)