entity

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Query    = "queries.go"
	Mutation = "mutations.go"
)
View Source
const (
	Scalar    = "Scalar"
	Object    = "Object"
	Interface = "Interface"
	Union     = "Union"
	Enum      = "Enum"
	Input     = "Input"
)
View Source
const (
	Int = iota
	Float
	String
	Boolean
	ID
)

Variables

View Source
var AvailableTemplate = map[string]Template{
	"json":       JSON,
	"markdown":   Markdown,
	"html":       HTML,
	"confluence": Confluence,
}
View Source
var Default = map[string]interface{}{
	"Int":     1,
	"String":  "Hello",
	"Float":   1.0,
	"Boolean": true,
	"ID":      "123",
}
View Source
var DocTypeVariant = map[string]DocType{
	"query":    Query,
	"mutation": Mutation,
}
View Source
var ScalarTypes = map[string]ScalarVariant{
	"Int":     Int,
	"Float":   Float,
	"String":  String,
	"Boolean": Boolean,
	"ID":      ID,
}
View Source
var Types = map[string]TypeVariant{
	"type":      Object,
	"interface": Interface,
	"enum":      Enum,
	"input":     Input,
}

Functions

This section is empty.

Types

type Config added in v0.1.4

type Config struct {
	Input     string
	Output    string
	Template  string
	Type      []DocType
	Quiet     bool
	Help      bool
	NoExample bool
}

type Definition added in v0.1.4

type Definition struct {
	Name       string      `json:"name,omitempty"`
	Comment    string      `json:"comment,omitempty"`
	Variant    TypeVariant `json:"variant,omitempty"`
	Directive  string      `json:"directive,omitempty"`
	Properties []Property  `json:"properties,omitempty"`
}

type DocType added in v0.1.4

type DocType string

type Example added in v0.1.4

type Example struct {
	Request  string `json:"request,omitempty"`
	Response string `json:"response,omitempty"`
}

type Property added in v0.1.4

type Property struct {
	Name       string     `json:"name,omitempty"`
	Comment    string     `json:"comment,omitempty"`
	Type       string     `json:"type,omitempty"`
	Directive  string     `json:"directive,omitempty"`
	Parameters []Property `json:"parameters,omitempty"`
	IsScalar   bool       `json:"is_scalar,omitempty"`
	IsNullable bool       `json:"is_nullable,omitempty"`
	IsList     bool       `json:"is_list,omitempty"`
	Example    Example    `json:"example,omitempty"`
}

type ScalarVariant added in v0.1.4

type ScalarVariant int

type Spec added in v0.1.4

type Spec struct {
	Name        string       `json:"name,omitempty"`
	Queries     []Property   `json:"queries,omitempty"`
	Mutations   []Property   `json:"mutations,omitempty"`
	Definitions []Definition `json:"definitions,omitempty"`
}

type Template

type Template string
const (
	JSON       Template = "json"
	Markdown   Template = "md"
	HTML       Template = "html"
	Confluence Template = "confluence"
)

type TypeVariant added in v0.1.4

type TypeVariant string

Jump to

Keyboard shortcuts

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