codegen

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

codgen helps autogenerate cloudquery plugins configured by definition

Index

Constants

This section is empty.

Variables

View Source
var TemplatesFS embed.FS

Functions

This section is empty.

Types

type ColumnDefinition

type ColumnDefinition struct {
	// Name name of the column
	Name          string
	Type          schema.ValueType
	Resolver      string
	Description   string
	IgnoreInTests bool
	Options       schema.ColumnCreationOptions
}

type ColumnDefinitions

type ColumnDefinitions []ColumnDefinition

func (ColumnDefinitions) GetByName

func (c ColumnDefinitions) GetByName(name string) *ColumnDefinition

type ResourceDefinition

type ResourceDefinition struct {
	Name  string
	Table *TableDefinition
}

type TableDefinition

type TableDefinition struct {
	Name        string
	Description string
	Columns     []ColumnDefinition
	Relations   []*TableDefinition

	Resolver             string
	IgnoreError          string
	Multiplex            string
	PostResourceResolver string
	Options              schema.TableCreationOptions
	// contains filtered or unexported fields
}

func NewTableFromStruct

func NewTableFromStruct(name string, obj interface{}, opts ...TableOptions) (*TableDefinition, error)

func (*TableDefinition) GenerateTemplate

func (t *TableDefinition) GenerateTemplate(wr io.Writer) error

type TableOptions

type TableOptions func(*TableDefinition)

func WithDescriptionsEnabled

func WithDescriptionsEnabled() TableOptions

func WithExtraColumns

func WithExtraColumns(columns []ColumnDefinition) TableOptions

func WithNameTransformer

func WithNameTransformer(transformer func(string) string) TableOptions

func WithOverrideColumns

func WithOverrideColumns(columns []ColumnDefinition) TableOptions

func WithSkipFields

func WithSkipFields(fields []string) TableOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL