| 12345678910111213141516171819202122232425262728293031323334353637 |
- package ds_sdk
- import (
- "time"
- )
- type Option func(opts *Options)
- func WithTimeout(timeout time.Duration) Option {
- return func(opts *Options) {
- opts.timeout = timeout
- }
- }
- func WithSqlResourceDir(sqlResourcesDir string) Option {
- return func(opts *Options) {
- opts.sqlResourcesDir = sqlResourcesDir
- }
- }
- type DataSourceOption struct {
- Name string
- Type string
- Spec map[string]any
- }
- type Options struct {
- // 必传
- token string
- baseUrl string
- namespace string
- dataSource *DataSourceOption
- // 选传
- timeout time.Duration
- sqlResourcesDir string
- }
|