v1

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version      = "version"
	Kind         = "kind"
	Entity       = "entity"
	Name         = "name"
	Plural       = "plural"
	Description  = "description"
	Docs         = "docs"
	Schema       = "schema"
	Reserved     = "reserved"
	Type         = "type"
	Fields       = "fields"
	Unique       = "unique"
	Encrypted    = "encrypted"
	Validate     = "validate"
	Regex        = "regex"
	Pattern      = "pattern"
	Go           = "go"
	Java         = "java"
	Value        = "value"
	Enum         = "enum"
	Range        = "range"
	Min          = "min"
	Max          = "max"
	Adapters     = "adapters"
	Map          = "map"
	Rel          = "$rel"
	Input        = "input"
	HTTP         = "http"
	ResourceName = "resourceName"
	Output       = "output"
	Memory       = "memory"
	MongoDB      = "mongodb"
	Redis        = "redis"
	SQL          = "sql"
	RedisMongoDB = "redis+mongodb"
	RedisSQL     = "redis+sql"
	TTL          = "ttl"
	Collection   = "collection"
	Table        = "table"
	HasMany      = "hasMany"
	HasOne       = "hasOne"
	BelongsTo    = "belongsTo"
	Nested       = "nested"
	MaxItems     = "maxItems"
)
View Source
const (
	// Integer data type mapped to: Go=int64, Java=java.lang.Long
	Integer = "integer"

	// Float data type mapped to: Go=float64, Java=java.lang.Float
	Float = "float"

	// Boolean data type mapped to: Go=bool, Java=java.lang.Boolean
	Boolean = "boolean"

	// String data type mapped to: Go=string, Java=java.lang.String
	String = "string"

	// Date data type mapped to: Go=int64, Java=java.lang.Long
	// date representation as UTC milliseconds
	Date = "date"

	// UUID data type mapped to: Go=string, Java=java.lang.String
	UUID = "uuid"

	// ULID data type mapped to: Go=string, Java=java.lang.String
	ULID = "ulid"
)

Entity field types

Variables

This section is empty.

Functions

This section is empty.

Types

type AppSpec

type AppSpec struct {
	Name        string     `yaml:"name"`
	Description string     `yaml:"description"`
	Stack       StackSpec  `yaml:"stack"`
	Domain      DomainSpec `yaml:"domain"`
}

type DomainSpec

type DomainSpec struct {
	Entities []string `yaml:"entities"`
	UseCases []string `yaml:"useCases"`
}

type EntityAdapterItem

type EntityAdapterItem struct {
	Type     string `yaml:"type"`
	Metadata map[string]interface{}
}

type EntityAdapters

type EntityAdapters struct {
	Input  []EntityAdapterItem `yaml:"input"`
	Output []EntityAdapterItem `yaml:"output"`
}

type EntityRel

type EntityRel struct {
	Name        string            `yaml:"name"`
	Type        string            `yaml:"type"` // Type is reserved for future implementations ($rel, $urn)
	Ref         string            `yaml:"ref"`
	Cardinality string            `yaml:"cardinality"`
	Load        *EntityRelLoading `yaml:"load"`
}

type EntityRelLoading

type EntityRelLoading struct {
	Type     string                 `yaml:"type"`
	Metadata map[string]interface{} `yaml:"metadata"`
}

type EntitySchema

type EntitySchema struct {
	Reserved EntitySchemaReserved `yaml:"reserved"`
	Fields   []EntitySchemaItem   `yaml:"fields"`
}

type EntitySchemaItem

type EntitySchemaItem struct {
	Name        string        `yaml:"name"`
	Type        string        `yaml:"type"`
	Description string        `yaml:"description"`
	Doc         string        `yaml:"doc"`
	Encrypted   bool          `yaml:"encrypted"`
	ReadOnly    bool          `yaml:"readonly"`
	Optional    *OptionalItem `yaml:"optional,omitempty"`
	Validate    *ValidateItem `yaml:"validate,omitempty"`
}

type EntitySchemaReserved

type EntitySchemaReserved struct {
	Id EntitySchemaReservedId `yaml:"id"`
}

type EntitySchemaReservedId

type EntitySchemaReservedId struct {
	Type string `yaml:"type"`
}

type EntitySpec

type EntitySpec struct {
	Name          string         `yaml:"name"`
	Plural        string         `yaml:"plural"`
	Description   string         `yaml:"description"`
	Doc           string         `yaml:"doc"`
	Schema        EntitySchema   `yaml:"schema"`
	Relationships []EntityRel    `yaml:"relationships"`
	Adapters      EntityAdapters `yaml:"adapters"`
}

type OptionalItem

type OptionalItem struct {
	Default interface{} `yaml:"default"`
}

type RootApp

type RootApp struct {
	vx.DocHeader `yaml:",inline"`
	App          AppSpec `yaml:"spec"`
}

type RootEntity

type RootEntity struct {
	vx.DocHeader `yaml:",inline"`
	Entity       EntitySpec `yaml:"spec"`
}

type RootUseCase

type RootUseCase struct {
	vx.DocHeader `yaml:",inline"`
	UseCase      UseCaseSpec `yaml:"spec"`
}

type StackSpec

type StackSpec struct {
	Lang    string `yaml:"lang"`
	Package string `yaml:"package"`
}

type UseCaseActionSpec

type UseCaseActionSpec struct {
	Method string         `yaml:"method"`
	Params []UseCaseParam `yaml:"params"`
	Input  []UseCaseInput `yaml:"input"`
}

type UseCaseDomainSpec

type UseCaseDomainSpec struct {
	Entities []string `yaml:"entities"`
}

type UseCaseInput

type UseCaseInput struct {
	Type string `yaml:"type"`
	Dto  bool   `yaml:"dto"`
}

type UseCaseParam

type UseCaseParam struct {
	Name        string `yaml:"name"`
	Type        string `yaml:"type"`
	Description string `yaml:"description"`
}

type UseCaseSpec

type UseCaseSpec struct {
	Name        string              `yaml:"name"`
	Description string              `yaml:"description"`
	Doc         string              `yaml:"doc"`
	Domain      UseCaseDomainSpec   `yaml:"domain"`
	Actions     []UseCaseActionSpec `yaml:"actions"`
}

type ValidateItem

type ValidateItem struct {
	List  *ValidateItemList  `yaml:"list,omitempty"`
	Range *ValidateItemRange `yaml:"range,omitempty"`
	Regex *ValidateItemRegex `yaml:"regex,omitempty"`
	Value interface{}        `yaml:"value,omitempty"`
}

type ValidateItemList

type ValidateItemList struct {
	Values []interface{} `yaml:"values"`
}

type ValidateItemRange

type ValidateItemRange struct {
	Min interface{} `yaml:"min"`
	Max interface{} `yaml:"max"`
}

type ValidateItemRegex

type ValidateItemRegex struct {
	Default   string `yaml:"default"`
	GoPattern string `yaml:"go"`
}

Jump to

Keyboard shortcuts

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