domain

package
v0.0.0-...-f2905ed Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFields

func BuildFields(cfg *config.Config, model config.Model) ([]Field, Imports)

func BuildRepoMethods

func BuildRepoMethods(cfg *config.Config) map[string][]Method

func BuildTypes

func BuildTypes(cfg *config.Config) ([]Type, Imports)

func CamelCasef

func CamelCasef(f string, args ...interface{}) string

func LowerCamelCasef

func LowerCamelCasef(f string, args ...interface{}) string

Types

type Arg

type Arg struct {
	Name   string
	Parent NameInternal
	Type   string
	Deref  bool
}

type ByMethodName

type ByMethodName []Method

func (ByMethodName) Len

func (t ByMethodName) Len() int

func (ByMethodName) Less

func (t ByMethodName) Less(i, j int) bool

func (ByMethodName) Swap

func (t ByMethodName) Swap(i, j int)

type Field

type Field struct {
	Name         string
	Type         string
	Primative    string
	Internal     string // Snake Case
	Relationship *Relationship
	ShouldExpose bool
}

func BuildField

func BuildField(cfg *config.Config, f config.Field) (Field, string)

type Imports

type Imports map[string]struct{}

func NewImports

func NewImports() Imports

func (Imports) Add

func (t Imports) Add(imports ...string)

func (Imports) AsSlice

func (t Imports) AsSlice() []string

type Method

type Method struct {
	Type         string
	Name         string
	Args         []Arg
	Relationship *Relationship
	Return       Return
}

type Model

type Model struct {
	Name        string
	Type        string
	Plural      string
	Description string
	Fields      []Field
	Internal    string
	Repo        Repo
	Imports     Imports
	Mutations   []Mutation
}

func BuildModel

func BuildModel(cfg *config.Config, model config.Model) Model

func BuildModels

func BuildModels(cfg *config.Config) []Model

func FindModel

func FindModel(models []Model, name string) Model

func (Model) String

func (t Model) String() string

type Mutation

type Mutation struct {
	Name   string
	Type   string
	Fields []Field
	Key    string
}

func BuildMutations

func BuildMutations(cfg *config.Config, model config.Model) []Mutation

type NameInternal

type NameInternal struct {
	Name     string
	Internal string
}

type Relationship

type Relationship struct {
	To      NameInternal
	Through NameInternal
	Field   string
	Type    string
}

func (Relationship) String

func (t Relationship) String() string

type Repo

type Repo struct {
	Name    string
	Methods []Method
}

type Resolver

type Resolver struct {
	Name    string
	Methods []Method
}

type Return

type Return struct {
	Type  string
	Multi bool
}

type Type

type Type struct {
	Name string
	Type string
}

Jump to

Keyboard shortcuts

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