descriptor

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	Key        string `json:"key,omitempty"`
	FromColumn string `json:"fromColumn,omitempty"`
}

type Currency

type Currency struct {
	Key        string `json:"key,omitempty"`
	FromColumn string `json:"fromColumn,omitempty"`
	Value      string `json:"value,omitempty"`
}

type Descriptor

type Descriptor struct {
	Key             string            `json:"key,omitempty"`
	Name            string            `json:"name,omitempty"`
	Description     string            `json:"description,omitempty"`
	TypeDescriptors []*TypeDescriptor `json:"typeDescriptors,omitempty"`
}

func ParseDescriptorFile

func ParseDescriptorFile(file io.Reader) (descriptor *Descriptor)

ParseDescriptorFile will parse the descriptor.json file and make sure to add an `id` field if the user has not already specified it

type Field

type Field struct {
	Key          string        `json:"key,omitempty"`
	Name         string        `json:"name,omitempty"`
	Type         *WorkflowType `json:"type,omitempty"`
	FromColumn   string        `json:"fromColumn,omitempty"`
	Relationship *Relationship `json:"relationship,omitempty"`
}

type Relationship

type Relationship struct {
	Kind                       string `json:"kind,omitempty"`
	WithTable                  string `json:"withTable,omitempty"`
	ForeignTableUniqueIDColumn string `json:"foreignTableUniqueIdColumn,omitempty"`
	LocalTableUniqueIDColumn   string `json:"localTableUniqueIdColumn,omitempty"`
}

type SchemaMapping

type SchemaMapping struct {
	FieldNames    []string
	BackendTypes  []interface{}
	GolangTypes   []interface{}
	WorkflowTypes []interface{}
}

SchemaMapping defines the schema of data retrieved from a particular backend

type TypeDescriptor

type TypeDescriptor struct {
	Key                string   `json:"key,omitempty"`
	Name               string   `json:"name,omitempty"`
	TableName          string   `json:"tableName,omitempty"`
	ColumnAsOptionName string   `json:"columnAsOptionName,omitempty"`
	UniqueIdColumn     string   `json:"uniqueIdColumn,omitempty"`
	Fields             []*Field `json:"fields,omitempty"`
	OptionsAvailable   bool     `json:"optionsAvailable,omitempty"`
	FetchOneAvailable  bool     `json:"fetchOneAvailable,omitempty"`
}

type WorkflowType

type WorkflowType struct {
	Name     string    `json:"name,omitempty"`
	Kind     string    `json:"kind,omitempty"`
	Amount   *Amount   `json:"amount,omitempty"`
	Currency *Currency `json:"currency,omitempty"`
}

Jump to

Keyboard shortcuts

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