ioc

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

go-ioc

Golang IOC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LittleCamelCase

func LittleCamelCase(txt string) string

func ReadFile

func ReadFile(filename string) (string, error)

func Unescaped

func Unescaped(txt string) interface{}

func UpperCamelCase

func UpperCamelCase(txt string) string

Types

type Arg

type Arg struct {
	Name     string // Argument/Property name
	TypeName string // Argument/Property type string name
}

type ContainerConfig

type ContainerConfig struct {
	Name                  string // Container struct name
	TemplateFile          string // Template file
	InputDirectory        string // Input directory
	OutputDirectory       string // Output directory
	OutputFilename        string // Output go source filename
	RequestMappingComment string // Route comment text
}

type ContainerGenerator

type ContainerGenerator interface {
	Generate(func(StructContext) interface{}, map[string]interface{}) (interface{}, error)
}

func NewGeneralContainerGenerator

func NewGeneralContainerGenerator(containerConfig ContainerConfig) ContainerGenerator

type GeneralContainerGenerator

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

func (*GeneralContainerGenerator) Generate

func (s *GeneralContainerGenerator) Generate(convert func(StructContext) interface{}, funcMap map[string]interface{}) (interface{}, error)

type Parser

type Parser interface {
	Parse(txt string) interface{}
}

func NewStructParser

func NewStructParser(structName string, requestMappingComment string) Parser

type StructContext

type StructContext struct {
	StructInfoes []StructInfo
}

func (*StructContext) Args

func (m *StructContext) Args() map[string][]string

func (*StructContext) Properties

func (m *StructContext) Properties() map[string][]string

type StructInfo

type StructInfo struct {
	Name           string // Struct name
	Properties     []Arg  // Struct properties
	Args           []Arg  // New function arguments
	RequestMapping string // Route path
}

type StructParser

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

func (*StructParser) Parse

func (s *StructParser) Parse(txt string) interface{}

Jump to

Keyboard shortcuts

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