abstract

package
v0.0.0-...-6c5c701 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultManifestFilename string = "MANIFEST.yaml"
View Source
const (
	L_SCHEMA = "schema"
)

Variables

This section is empty.

Functions

func NewDatabaseBuilder

func NewDatabaseBuilder() *databaseBuilder

NewDatabaseBuilder ... builder for a database asset type

func NewTableBuilder

func NewTableBuilder() *tableBuilder

NewTableBuilder ... table builder

Types

type Asset

type Asset struct {
	// asset last found by crawler at - only added by service (not crawler/manifest itself, i.e. no yaml)
	LastDiscoveredAt time.Time `json:"last-discovered-at"`
	// asset publication datetime
	PublishedOn time.Time `yaml:"published-on" json:"published-on"`
	// name of the asset
	Name string `yaml:"name" json:"name"`
	// description of the asset
	Description string `yaml:"description" json:"description"`
	// the list of assets this depends on
	DependsOn []string `yaml:"depends-on" json:"depends-on"`
	// asset type
	Type AssetType `yaml:"type" json:"type"`
	// labels for the specific asset
	Labels map[string]interface{} `yaml:"labels" json:"labels"`
	// tags are flags used to simplify asset search
	Tags []string `yaml:"tags" json:"tags"`
}

Asset ... managed resource

func ParseAsset

func ParseAsset(data []byte) (*Asset, error)

ParseAsset ... Parse an asset specification file

func (*Asset) Validate

func (asset *Asset) Validate() error

Validate ... Validate asset specification file

type AssetDAOProvider

type AssetDAOProvider interface {
	Init(*conf.DataSourceDefinition)
	Upsert(asset *Asset) error
	GetById(id string) (*Asset, error)
	GetByName(id string) (*Asset, error)
	SearchAssetsByTags(tags []string) (*[]Asset, error)
	ListAllAssets() (*[]Asset, error)
	CloseConnection()
}

AssetDAOProvider ... The interface each dao must implement

type AssetType

type AssetType string

AssetType ... Asset type information

func (*AssetType) Validate

func (assetType *AssetType) Validate() error

type ColumnInfo

type ColumnInfo struct {
	Type    string
	Comment string
}

ColumnInfo ... Type and description for a table column

type ConnectorProvider

type ConnectorProvider interface {
	ValidateDataSourceDefinition(*conf.DataSourceDefinition) error
	InitConnection(*conf.DataSourceDefinition)
	CloseConnection()
}

ConnectorProvider ... The interface each connector must implement

type Crawler

type Crawler interface {
	InitConnection(cfg *conf.Config) (Crawler, error)
	WalkWithFilter(root string, filenameFilter string) ([]Asset, error)
}

type DBInfo

type DBInfo struct {
	Name    string
	Comment string
}

DBInfo ... Name and description for a database

func GetDBInfoByName

func GetDBInfoByName(dbName string) (DBInfo, error)

Partial constructor for DBInfo

func (*DBInfo) BuildAsset

func (db *DBInfo) BuildAsset() (*Asset, error)

type Feature

type Feature struct {
	Name     string      `json:"name,omitempty"`
	Value    interface{} `json:"value,omitempty"`
	DataType string      `json:"data-type,omitempty"`
}

Feature ... a named variable with a data type

func (*Feature) Validate

func (f *Feature) Validate() error

Validate ... validate a feature

type FeatureSet

type FeatureSet struct {
	Name        string            `json:"name,omitempty"`
	InsertedAt  time.Time         `json:"inserted_at,omitempty"`
	Version     string            `json:"version,omitempty"`
	Features    []Feature         `json:"features,omitempty"`
	Description string            `json:"description,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
}

FeatureSet ... a versioned set of features

func (*FeatureSet) Validate

func (fs *FeatureSet) Validate() error

Validate ... validate a featureSet

type FeatureSetDAOProvider

type FeatureSetDAOProvider interface {
	Init(*conf.DataSourceDefinition)
	Create(fs *FeatureSet) error
	GetById(id string) (*FeatureSet, error)
	GetByName(name string) (*[]FeatureSet, error)
	ListAllFeatureSets() (*[]FeatureSet, error)
	CloseConnection()
}

FeatureSetDAOProvider ... The interface each dao must implement

type TableInfo

type TableInfo struct {
	Name    string
	Schema  map[string]ColumnInfo
	Comment string
}

TableInfo ... Name, schema and description for a table

func GetTableInfoByName

func GetTableInfoByName(tableName string) (TableInfo, error)

Partial constructor for TableInfo

func (*TableInfo) BuildAsset

func (tb *TableInfo) BuildAsset() (*Asset, error)

Jump to

Keyboard shortcuts

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