Documentation ¶
Index ¶
- Constants
- Variables
- type Metadata
- type Origin
- type Origins
- type Override
- type Overrides
- type Scalar
- type Scalars
- type Schema
- func (s *Schema) AddModel(m *model.Model) error
- func (s *Schema) AddPath(path string) bool
- func (s *Schema) AddScalar(sc *Scalar) error
- func (s *Schema) CreateReferences() error
- func (s *Schema) ModelsByPackage() *model.Package
- func (s *Schema) Validate(n string) *ValidationResult
- func (s *Schema) ValidateModel(sch string, m *model.Model) *ValidationResult
- type Schemata
- type ValidationMessage
- type ValidationResult
Constants ¶
View Source
const ( KeyTitle = "title" KeyPlural = "plural" )
View Source
const ( LevelInfo = iota LevelWarn LevelError )
Variables ¶
View Source
var ( OriginMySQL = Origin{Key: "mysql", Title: "MySQL", Icon: "database", Description: "MySQL database schema"} OriginPostgres = Origin{Key: "postgres", Title: "PostgreSQL", Icon: "database", Description: "PostgreSQL database schema"} OriginSQLite = Origin{Key: "sqlite", Title: "SQLite", Icon: "database", Description: "SQLite database schema"} OriginSQLServer = Origin{Key: "sqlserver", Title: "SQL Server", Icon: "database", Description: "SQL Server database schema"} OriginGraphQL = Origin{Key: "graphql", Title: "GraphQL", Icon: "star", Description: "GraphQL schema and queries"} OriginProtobuf = Origin{Key: "protobuf", Title: "Protobuf", Icon: "star", Description: "File describing proto3 definitions"} OriginJSONSchema = Origin{Key: "jsonschema", Title: "JSON Schema", Icon: "star", Description: "JSON Schema definition files"} OriginMock = Origin{Key: "mock", Title: "Mock", Icon: "star", Description: "Simple type that returns mock data"} OriginUnknown = Origin{Key: "unknown", Title: "Unknown", Icon: "star", Description: "Not quite sure what this is"} )
View Source
var AllOrigins = Origins{OriginMySQL, OriginPostgres, OriginSQLite, OriginSQLServer, OriginGraphQL, OriginProtobuf, OriginJSONSchema, OriginMock}
Functions ¶
This section is empty.
Types ¶
type Origin ¶
type Origin struct { Key string `json:"key"` Title string `json:"title,omitempty"` Icon string `json:"icon,omitempty"` Description string `json:"description,omitempty"` }
func OriginFromString ¶
func (*Origin) MarshalText ¶ added in v0.2.16
func (*Origin) UnmarshalText ¶ added in v0.2.16
type Override ¶
type Schema ¶
type Schema struct { Paths []string `json:"paths,omitempty"` Scalars Scalars `json:"scalars,omitempty"` Models model.Models `json:"models,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*Schema) CreateReferences ¶
func (*Schema) ModelsByPackage ¶
func (*Schema) Validate ¶
func (s *Schema) Validate(n string) *ValidationResult
func (*Schema) ValidateModel ¶
func (s *Schema) ValidateModel(sch string, m *model.Model) *ValidationResult
type ValidationMessage ¶
type ValidationResult ¶
type ValidationResult struct { Schema string `json:"schema,omitempty"` Messages []ValidationMessage `json:"messages,omitempty"` Duration int64 `json:"duration,omitempty"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.