| 1234567891011121314151617181920212223242526272829303132333435 |
- package sdk
- import (
- "time"
- )
- type Option func(opts *Options)
- func WithTimeout(timeout time.Duration) Option {
- return func(opts *Options) {
- opts.timeout = timeout
- }
- }
- const (
- DataSourceTypeDatabase = "database"
- DataSourceDatabaseTypePostgres = "postgres"
- )
- 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
- }
|