file

package
v0.0.0-...-3fcbef7 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2019 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentsGroupCondition

type ArgumentsGroupCondition func(service types.Service, argsGroup types.ArgumentsGroup) bool

type ArgumentsGroupGenerator

type ArgumentsGroupGenerator func(file File, service types.Service, argsGroup types.ArgumentsGroup) error

type Creator

type Creator func(base string, path string, name string, overwrite bool, merge bool) File

type EntityCondition

type EntityCondition func(service types.Service, entity types.Entity) bool

type EntityGenerator

type EntityGenerator func(file File, service types.Service, entity types.Entity) error

type EnumCondition

type EnumCondition func(service types.Service, enum types.Enum) bool

type EnumGenerator

type EnumGenerator func(file File, service types.Service, enum types.Enum) error

type File

type File interface {
	Name() string
	Path() string
	Base() string
	Extension() string
	Overwrite() bool
	Merge() bool
	IsEmpty() bool
	WriteTo(w io.Writer) (n int64, err error)
	AddImport(alias string, path ...string)
	HasImport(path ...string) bool
	FormatComments(s ...string) []string
	C(s string)
	Cs(s ...string)
	Cf(format string, args ...interface{})
	P(s string)
	Ps(s ...string)
	Pf(format string, args ...interface{})
}

type MethodCondition

type MethodCondition func(service types.Service, method types.Method) bool

type MethodGenerator

type MethodGenerator func(file File, service types.Service, method types.Method) error

type MethodsExtractor

type MethodsExtractor func(service types.Service) []types.Method

type ServiceCondition

type ServiceCondition func(service types.Service) bool

type ServiceGenerator

type ServiceGenerator func(file File, service types.Service) error

type Spec

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

func NewSpec

func NewSpec(fileType string) Spec

func (Spec) AddArgumentsGroupGenerator

func (f Spec) AddArgumentsGroupGenerator(name string, generator ArgumentsGroupGenerator, conds ...ArgumentsGroupCondition) Spec

func (Spec) AddEntityGenerator

func (f Spec) AddEntityGenerator(name string, generator EntityGenerator, conds ...EntityCondition) Spec

func (Spec) AddEnumGenerator

func (f Spec) AddEnumGenerator(name string, generator EnumGenerator, conds ...EnumCondition) Spec

func (Spec) AddMethodGenerator

func (f Spec) AddMethodGenerator(name string, generator MethodGenerator, extractor MethodsExtractor, conds ...MethodCondition) Spec

func (Spec) AddServiceGenerator

func (f Spec) AddServiceGenerator(name string, generator ServiceGenerator, conds ...ServiceCondition) Spec

func (Spec) After

func (f Spec) After(after ...SpecAfterFunc) Spec

func (Spec) ArgumentsGroupGenerator

func (f Spec) ArgumentsGroupGenerator(name string, generator ArgumentsGroupGenerator) Spec

func (Spec) ArgumentsGroupGeneratorConditions

func (f Spec) ArgumentsGroupGeneratorConditions(name string, conds ...ArgumentsGroupCondition) Spec

func (Spec) Before

func (f Spec) Before(before ...SpecBeforeFunc) Spec

func (Spec) Conditions

func (f Spec) Conditions(conds ...ServiceCondition) Spec

func (Spec) EntityGenerator

func (f Spec) EntityGenerator(name string, generator EntityGenerator) Spec

func (Spec) EntityGeneratorConditions

func (f Spec) EntityGeneratorConditions(name string, conds ...EntityCondition) Spec

func (Spec) EnumGenerator

func (f Spec) EnumGenerator(name string, generator EnumGenerator) Spec

func (Spec) EnumGeneratorConditions

func (f Spec) EnumGeneratorConditions(name string, conds ...EnumCondition) Spec

func (Spec) Generate

func (f Spec) Generate(service types.Service, creator Creator) (File, error)

func (Spec) Merge

func (f Spec) Merge(merge bool, mergeFunc func(service types.Service) bool) Spec

func (Spec) MethodGenerator

func (f Spec) MethodGenerator(name string, generator MethodGenerator) Spec

func (Spec) MethodGeneratorConditions

func (f Spec) MethodGeneratorConditions(name string, conds ...MethodCondition) Spec

func (Spec) MethodGeneratorExtractor

func (f Spec) MethodGeneratorExtractor(name string, extractor MethodsExtractor) Spec

func (Spec) Name

func (f Spec) Name(name string, nameFunc func(service types.Service) string) Spec

func (Spec) Overwrite

func (f Spec) Overwrite(overwrite bool, overwriteFunc func(service types.Service) bool) Spec

func (Spec) Path

func (f Spec) Path(path string, pathFunc func(service types.Service) string) Spec

func (Spec) RemoveGenerator

func (f Spec) RemoveGenerator(name string) Spec

func (Spec) ServiceGenerator

func (f Spec) ServiceGenerator(name string, generator ServiceGenerator) Spec

func (Spec) ServiceGeneratorConditions

func (f Spec) ServiceGeneratorConditions(name string, conds ...ServiceCondition) Spec

func (Spec) Type

func (f Spec) Type() string

type SpecAfterFunc

type SpecAfterFunc func(b []byte, service types.Service) ([]byte, error)

type SpecBeforeFunc

type SpecBeforeFunc func(file File, service types.Service)

Jump to

Keyboard shortcuts

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