NewInterface creates a new Interface with the given name and description.
(name, description string)
| 48 | |
| 49 | // NewInterface creates a new Interface with the given name and description. |
| 50 | func NewInterface(name, description string) *Interface { |
| 51 | return &Interface{ |
| 52 | name: name, |
| 53 | description: description, |
| 54 | fields: make(map[string][]*InterfaceFieldSpec), |
| 55 | fieldsL: new(sync.Mutex), |
| 56 | relationsL: new(sync.RWMutex), |
| 57 | implementors: make(map[string]struct{}), |
| 58 | interfaces: make(map[string]*Interface), |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // TypeName returns the name of the interface type. |
| 63 | func (iface *Interface) TypeName() string { |
no outgoing calls