Sha256: 13b58c070f3184ed6601bc69284872552aaa6a59e0a50a081ce9723f825729b1
Contents?: true
Size: 826 Bytes
Versions: 5
Compression:
Stored size: 826 Bytes
Contents
<%- package 'main' user_editable import "os" import "reflect" import "regexp" import "github.com/akm/typedict" import config.model_package_path -%> // Usage // $ go run <%= config.structs_gen_dir %>/*.go func main() { ptn := regexp.MustCompile(`\A<%= config.model_package_path %>|\A<%= config.store_package_path %>|\A<%= config.converter_package_path %>`) objectMap := map[string][]interface{}{ "model": []interface{}{ // model.User{}, }, "payload": []interface{}{ // user.UserPayload{}, }, "result": []interface{}{ // user.User{}, }, } structs := typedict.CategorizedTypes(objectMap, typedict.KindFilter(append([]reflect.Kind{reflect.Struct}, typedict.SimpleKinds...)...), func(t reflect.Type) bool { return ptn.MatchString(t.PkgPath()) }) typedict.WriteJson(os.Stdout, structs) }
Version data entries
5 entries across 5 versions & 1 rubygems