flow

package
v0.0.0-...-519d24f Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name string
	Type FlowType
}

type FlowType

type FlowType interface {
	GetExpr() string
}

type FlowTypeArray

type FlowTypeArray struct {
	ElemenetType FlowType
}

func (*FlowTypeArray) GetExpr

func (f *FlowTypeArray) GetExpr() string

type FlowTypeEnum

type FlowTypeEnum struct {
	// contains filtered or unexported fields
}

FlowTypeEnum is to represent enum types.

func (*FlowTypeEnum) GetExpr

func (f *FlowTypeEnum) GetExpr() string

type FlowTypeMaybe

type FlowTypeMaybe struct {
	Elem FlowType
}

func (*FlowTypeMaybe) GetExpr

func (f *FlowTypeMaybe) GetExpr() string

type FlowTypeNamed

type FlowTypeNamed struct {
	Name       string
	ImportPath string
	ImportName string
}

FlowTypeNamed is to represent other named object

func (*FlowTypeNamed) GetExpr

func (f *FlowTypeNamed) GetExpr() string

type FlowTypeObject

type FlowTypeObject struct {
	Fields []FlowTypeObjectField
}

func (*FlowTypeObject) GetExpr

func (f *FlowTypeObject) GetExpr() string

type FlowTypeObjectField

type FlowTypeObjectField struct {
	Name      string
	Type      FlowType
	OmitEmpty bool
}

type FlowTypePrimitive

type FlowTypePrimitive string
const (
	FlowTypeString FlowTypePrimitive = "string"
	FlowTypeNumber FlowTypePrimitive = "number"
	FlowTypeBool   FlowTypePrimitive = "boolean"
	FlowTypeDate   FlowTypePrimitive = "Date"
	FlowTypeAny    FlowTypePrimitive = "any"
)

Primitive flow types

func (FlowTypePrimitive) GetExpr

func (f FlowTypePrimitive) GetExpr() string

type Generator

type Generator struct {
	Options *Options
}

Generator is a generator for Flow types

func NewGenerator

func NewGenerator(opts *Options) *Generator

NewGenerator returns a new instance of Generator

func (*Generator) GetAnnotationSymbol

func (*Generator) GetAnnotationSymbol() generator.AnnotationSymbol

GetAnnotationSymbol implements generator.Generator#AnnotationSymbol

func (*Generator) GetFormatter

func (*Generator) GetFormatter() generator.Formatter

GetFormatter implements generator.Generator#GetFormatter

func (*Generator) Run

Run implementes generator.Generator#Run

type Options

type Options struct {
	RootDir        string `json:"root_dir"`
	GenerateJS     bool   `json:"generate_js"`
	GenerateLibDef bool   `json:"generate_lib_def"`
}

Options is to controll the generactor behavior

func NewOptions

func NewOptions() *Options

NewOptions returns a new *Option with default values.

type Spec

type Spec struct {
	TypeName string
	FlowType FlowType
}

Spec represents type specification

Directories

Path Synopsis
Code generated by github.com/yssk22/go/generator DO NOT EDIT.
Code generated by github.com/yssk22/go/generator DO NOT EDIT.

Jump to

Keyboard shortcuts

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