Documentation ¶
Index ¶
- Constants
- func BasePkg(pkg string) string
- func ListParameters(namePrefix string, t []reflect.Type) string
- func ListReturns(r []reflect.Type) string
- func ProcessSource(ag Agent, sd ServiceInfo)
- func Run(basePrjDir string, pkg string, agent Agent, definitions interface{})
- func TemplateBaseFunctions() template.FuncMap
- type Agent
- type MethodInfo
- type Override
- type ServiceInfo
- type Source
Constants ¶
View Source
const InternalDirName = "internal/"
Variables ¶
This section is empty.
Functions ¶
func ListReturns ¶
func ProcessSource ¶
func ProcessSource(ag Agent, sd ServiceInfo)
func TemplateBaseFunctions ¶
Types ¶
type Agent ¶
type Agent interface {
Code(service ServiceInfo) []Source
}
type MethodInfo ¶
type MethodInfo struct { Method reflect.Method Receiver reflect.Type Parameters []reflect.Type Returns []reflect.Type }
func NewMethodInfo ¶
func NewMethodInfo(receiver reflect.Type) []MethodInfo
func (MethodInfo) MarshalJSON ¶
func (d MethodInfo) MarshalJSON() ([]byte, error)
type ServiceInfo ¶
type ServiceInfo struct { BaseDir string Pkg string Type reflect.Type `json:"-"` Definition interface{} Methods []MethodInfo }
func NewServiceInfo ¶
func NewServiceInfo(definition interface{}, t reflect.Type, baseDir string, pkg string) ServiceInfo
func (ServiceInfo) BaseName ¶
func (s ServiceInfo) BaseName() string
func (ServiceInfo) FullPath ¶
func (s ServiceInfo) FullPath(p ...string) string
func (ServiceInfo) FullnternalPath ¶
func (s ServiceInfo) FullnternalPath(p ...string) string
func (ServiceInfo) Inject ¶
func (s ServiceInfo) Inject() *jen.Statement
func (ServiceInfo) InternalPath ¶
func (s ServiceInfo) InternalPath(p ...string) string
Click to show internal directories.
Click to hide internal directories.