-
Notifications
You must be signed in to change notification settings - Fork 24
/
options.go
39 lines (31 loc) · 950 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package source
import (
"context"
"github.com/cloudquery/plugin-sdk/schema"
)
type GetTables func(ctx context.Context, c schema.ClientMeta) (schema.Tables, error)
type Option func(*Plugin)
// WithDynamicTableOption allows the plugin to return list of tables after call to New
func WithDynamicTableOption(getDynamicTables GetTables) Option {
return func(p *Plugin) {
p.getDynamicTables = getDynamicTables
}
}
// WithNoInternalColumns won't add internal columns (_cq_id, _cq_parent_cq_id) to the plugin tables
func WithNoInternalColumns() Option {
return func(p *Plugin) {
p.internalColumns = false
}
}
func WithUnmanaged() Option {
return func(p *Plugin) {
p.unmanaged = true
}
}
// WithTitleTransformer allows the plugin to control how table names get turned into titles for the
// generated documentation.
func WithTitleTransformer(t func(*schema.Table) string) Option {
return func(p *Plugin) {
p.titleTransformer = t
}
}