12345678910111213141516171819202122232425262728293031323334353637383940 |
- package sdk
- import "github.com/fatih/structs"
- type DataSourceDatabaseSpec struct {
- Type string `structs:"type"`
- UserName string `structs:"user_name"`
- Password string `structs:"password"`
- Address string `structs:"address"`
- Port string `structs:"port"`
- Database string `structs:"database"`
- MaxConnections int `structs:"max_connections"`
- MaxIdleConnections int `structs:"max_idle_connections"`
- }
- func (spec *DataSourceDatabaseSpec) ToMap() map[string]any {
- return structs.Map(spec)
- }
- type DataContainerDatabaseSpec struct {
- TableName string `structs:"table_name"`
- Columns []DataContainerDatabaseColumnSpec `structs:"columns"`
- }
- type DataContainerDatabaseColumnSpec struct {
- Name string `structs:"name"`
- Type string `structs:"type"`
- Comment string `structs:"comment"`
- PrimaryKey bool `structs:"primary_key"`
- Size int `structs:"size"`
- Unique bool `structs:"unique"`
- NotNull bool `structs:"not_null"`
- Index bool `structs:"index"`
- UniqueIndex string `structs:"unique_index"`
- Default any `structs:"default"`
- }
- func (spec *DataContainerDatabaseSpec) ToMap() map[string]any {
- return structs.Map(spec)
- }
|