1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-17 07:40:10 +00:00

Add ability to rename imported types

This commit is contained in:
Darren Shepherd
2017-12-22 23:16:28 -07:00
parent 57a671459b
commit 6d5879c98a
2 changed files with 24 additions and 4 deletions

View File

@@ -3,8 +3,8 @@ package types
import (
"bytes"
"fmt"
"reflect"
"strings"
"sync"
"github.com/rancher/norman/name"
@@ -29,6 +29,7 @@ type BackReference struct {
type Schemas struct {
sync.Mutex
typeNames map[reflect.Type]string
schemasByPath map[string]map[string]*Schema
schemasBySubContext map[string]*Schema
mappers map[string]map[string][]Mapper
@@ -44,6 +45,7 @@ type Schemas struct {
func NewSchemas() *Schemas {
return &Schemas{
typeNames: map[reflect.Type]string{},
schemasByPath: map[string]map[string]*Schema{},
schemasBySubContext: map[string]*Schema{},
mappers: map[string]map[string][]Mapper{},