func GetAllFieldtype() map[string]Definition {
	return fieldtypeMap
}
GetAllFieldtype get all fieldtype
package fieldtype
import (
	"context"
	"database/sql"
	"encoding/json"
	"errors"
	"fmt"
	"strings"
	"github.com/digimakergo/digimaker/core/definition"
	"github.com/digimakergo/digimaker/core/log"
	"github.com/digimakergo/digimaker/core/query/querier"
)
type Definition struct {
	Name       string                             
	DataType   string                             
	Package    string                             
	NewHandler func(definition.FieldDef) Handler  
}
type Handler interface {
	LoadInput(input interface{}, mode string) (interface{}, error)
	DBField() string
}
type Outputer interface {
	Ouput(ctx context.Context, querier querier.Querier, value interface{}) interface{}
}
type ValidationError struct {
	Message string
}
func (err ValidationError) Error() string {
	return err.Message
}
func NewValidationError(message string) ValidationError {
	return ValidationError{Message: message}
}
type EmptyError struct {
}
func (err EmptyError) Error() string {
	return "Field is empty"
}
type Event interface {
	BeforeStore(value interface{}, existing interface{}, mode string) (interface{}, error)
	AfterDelete(value interface{}) error
}
type StoreHandler interface {
	Store(ctx context.Context, value interface{}, contentType string, cid int, transaction *sql.Tx) error
}
var fieldtypeMap map[string]Definition = map[string]Definition{}
func Register(definition Definition) {
	name := definition.Name
	if _, ok := fieldtypeMap[name]; ok {
		log.Warning("Fieldtype has been previous registered: "+name, "system")
	}
	log.Info("Registering fieldtype: " + name)
	fieldtypeMap[definition.Name] = definition
}
func GetFieldtype(fieldtype string) Definition {
	result, ok := fieldtypeMap[fieldtype]
	if ok {
		return result
	} else {
		log.Error("Field type doesn't exist: "+fieldtype, "system")
		return Definition{}
	}
}