id

package
v0.0.0-...-f64704c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Properties

type Properties struct {
	PropertyIds []string
	Type        []string
	Name        []string
	Table       []string
	Filename    []string
}

Properties A helper struct which allows for easy display of validation errors

func (*Properties) Add

func (p *Properties) Add(id string, ptype string, name string, tname string, filename string)

Add Adds the parameters to the list of known properties

func (Properties) Exists

func (p Properties) Exists(pid, name, tname, ptype, filename string) (exists bool, e ValidationError)

Exists Checks if the pid and name parameters exist

type ValidationError

type ValidationError struct {
	Desc  string
	Items []ValidationItem
}

ValidationError Stores the details of an Error

func (ValidationError) String

func (v ValidationError) String() string

type ValidationErrors

type ValidationErrors struct {
	Errors []ValidationError
}

func ValidatePropertyIDs

func ValidatePropertyIDs(yamlSchema []table.Table, mysqlSchema []table.Table, log bool) (validationErrors ValidationErrors, err error)

ValidatePropertyIDs Compare the tables between the YAML and MySQL, and check if property ids have been changed without any change to the table and field. This would indicate a YAML data error and the user should be notified.

func ValidateSchema

func ValidateSchema(tables table.Tables, schemaName string, log bool) (validationErrors ValidationErrors, err error)

ValidateSchema checks the tables parameter for duplicate names and ids. Ids and names cannot be shared between tables and the properties of individual tables

func (*ValidationErrors) Add

func (ve *ValidationErrors) Add(e ValidationError)

func (ValidationErrors) Count

func (ve ValidationErrors) Count() int

func (ValidationErrors) HasErrors

func (ve ValidationErrors) HasErrors() bool

func (ValidationErrors) Log

func (ve ValidationErrors) Log()

type ValidationItem

type ValidationItem struct {
	Context string
	ID      string
	Name    string
	Table   string
	Type    string
	Source  string
}

ValidationItem Stores the specific item detail for a validation error

func (ValidationItem) String

func (vi ValidationItem) String() string

Jump to

Keyboard shortcuts

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