kis-flow/kis/connector.go

26 lines
882 B
Go
Raw Normal View History

2024-01-09 17:30:58 +08:00
package kis
import (
"context"
2024-04-16 14:54:11 +08:00
2024-03-26 14:54:50 +08:00
"github.com/aceld/kis-flow/config"
2024-01-09 17:30:58 +08:00
)
2024-04-15 17:50:02 +08:00
// Connector defines the interface for connectors associated with external storage.
2024-01-09 17:30:58 +08:00
type Connector interface {
2024-04-15 17:50:02 +08:00
// Init initializes the connection to the storage engine associated with the Connector.
2024-01-09 17:30:58 +08:00
Init() error
2024-04-15 17:50:02 +08:00
// Call invokes the read-write operations of the external storage logic.
Call(ctx context.Context, flow Flow, args interface{}) (interface{}, error)
2024-04-15 17:50:02 +08:00
// GetID returns the ID of the Connector.
GetID() string
// GetName returns the name of the Connector.
2024-01-09 17:30:58 +08:00
GetName() string
2024-04-15 17:50:02 +08:00
// GetConfig returns the configuration information of the Connector.
2024-01-09 17:30:58 +08:00
GetConfig() *config.KisConnConfig
2024-04-15 17:50:02 +08:00
// GetMetaData gets the temporary data of the current Connector.
2024-01-26 17:27:29 +08:00
GetMetaData(key string) interface{}
2024-04-15 17:50:02 +08:00
// SetMetaData sets the temporary data of the current Connector.
2024-01-26 17:27:29 +08:00
SetMetaData(key string, value interface{})
2024-01-09 17:30:58 +08:00
}