Skip to content

Commit

Permalink
Merge pull request #7 from ystia/feature/simplify-build-dependencies
Browse files Browse the repository at this point in the history
Removed dependency on Yorc
  • Loading branch information
loicalbertin committed Mar 3, 2020
2 parents 1a22e5b + fdab55a commit 3b36c9b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 112 deletions.
40 changes: 0 additions & 40 deletions internal/pkg/parser/tosca/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,8 @@

package tosca

import (
"strings"
)

// IsBuiltinType checks if a given type name corresponds to a TOSCA builtin type.
//
// Known builtin types:
// - string
// - integer
// - float
// - boolean
// - timestamp
// - null
// - list
// - map
// - version
// - range
// - scalar-unit.size
// - scalar-unit.time
func IsBuiltinType(typeName string) bool {
// type representation for map and list could be map:<EntrySchema> or list:<EntrySchema> (ex: list:integer)
return strings.HasPrefix(typeName, "list") || strings.HasPrefix(typeName, "map") ||
typeName == "string" || typeName == "integer" || typeName == "float" || typeName == "boolean" ||
typeName == "timestamp" || typeName == "null" || typeName == "version" || typeName == "range" ||
typeName == "scalar-unit.size" || typeName == "scalar-unit.time"
}

//go:generate go-enum -f=types.go

// TypeBase x ENUM(
// NODE,
// RELATIONSHIP,
// CAPABILITY,
// POLICY,
// ARTIFACT,
// DATA,
// )
type TypeBase int

// Type is the base type for all TOSCA types (like node types, relationship types, ...)
type Type struct {
Base TypeBase `yaml:"base,omitempty" json:"base,omitempty"`
DerivedFrom string `yaml:"derived_from,omitempty" json:"derived_from,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
ImportPath string `yaml:"import_path,omitempty" json:"import_path,omitempty"`
Expand Down
72 changes: 0 additions & 72 deletions internal/pkg/parser/tosca/types_enum.go

This file was deleted.

0 comments on commit 3b36c9b

Please sign in to comment.