-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: wbc6080 <[email protected]>
- Loading branch information
Showing
49 changed files
with
1,082 additions
and
707 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../v1beta1-mapper/virtualdevice/config.yaml → mappers/v1beta1-mapper/modbus/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
mappers/v1beta1-mapper/modbus/data/dbmethod/openGemini/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package opengemini | ||
|
||
import ( | ||
"encoding/json" | ||
_ "github.com/influxdata/influxdb1-client" // this is important because of the bug in go mod | ||
client "github.com/influxdata/influxdb1-client/v2" | ||
"github.com/kubeedge/modbus/pkg/common" | ||
) | ||
|
||
type DataBaseConfig struct { | ||
OpengeminiClientConfig *OpengeminiClientConfig `json:"opengeminiClientConfig,omitempty"` | ||
OpengeminiDataConfig *OpengeminiDataConfig `json:"opengeminiDataConfig,omitempty"` | ||
} | ||
|
||
type OpengeminiClientConfig struct { | ||
URL string `json:"url,omitempty"` | ||
Database string `json:"database,omitempty"` | ||
RetentionPolicy string `json:"retentionPolicy,omitempty"` | ||
} | ||
|
||
type OpengeminiDataConfig struct { | ||
Measurement string `json:"measurement,omitempty"` | ||
Tags map[string]string `json:"tags,omitempty"` | ||
FieldKey string `json:"fieldKey,omitempty"` | ||
} | ||
|
||
func NewDataBaseClient(clientConfig json.RawMessage, dataConfig json.RawMessage) (*DataBaseConfig, error) { | ||
// TODO parse opengemini database config data | ||
|
||
return &DataBaseConfig{}, nil | ||
} | ||
|
||
func (d *DataBaseConfig) InitDbClient() (client.Client, error) { | ||
// TODO add opengemini database initialization code | ||
|
||
conf := client.HTTPConfig{} | ||
return client.NewHTTPClient(conf) | ||
} | ||
|
||
func (d *DataBaseConfig) CloseSession(cli client.Client) error { | ||
// TODO add opengemini database close code | ||
return nil | ||
} | ||
|
||
func (d *DataBaseConfig) AddData(data *common.DataModel, cli client.Client) error { | ||
// TODO add opengemini database data push code | ||
return nil | ||
} |
48 changes: 48 additions & 0 deletions
48
mappers/v1beta1-mapper/modbus/data/dbmethod/redis/client.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package redis | ||
|
||
import ( | ||
"github.com/kubeedge/modbus/pkg/common" | ||
"github.com/kubeedge/modbus/pkg/global" | ||
) | ||
|
||
type DataBaseConfig struct { | ||
} | ||
|
||
func NewDataBaseClient() (global.DataBaseClient, error) { | ||
return &DataBaseConfig{}, nil | ||
} | ||
|
||
func (d *DataBaseConfig) InitDbClient() error { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) CloseSession() { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) AddData(data *common.DataModel) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) GetDataByDeviceName(deviceName string) ([]*common.DataModel, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) GetPropertyDataByDeviceName(deviceName string, propertyData string) ([]*common.DataModel, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) GetDataByTimeRange(start int64, end int64) ([]*common.DataModel, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} | ||
|
||
func (d *DataBaseConfig) DeleteDataByTimeRange(start int64, end int64) ([]*common.DataModel, error) { | ||
//TODO implement me | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.