NewAuthCollection initializes and returns a new "auth" Collection model. It also loads the minimal default configuration for the collection (eg. system fields, indexes, type specific options, etc.).
(name string, optId ...string)
| 445 | // It also loads the minimal default configuration for the collection |
| 446 | // (eg. system fields, indexes, type specific options, etc.). |
| 447 | func NewAuthCollection(name string, optId ...string) *Collection { |
| 448 | m := &Collection{} |
| 449 | m.Name = name |
| 450 | m.Type = CollectionTypeAuth |
| 451 | |
| 452 | // @todo consider removing once inferred composite literals are supported |
| 453 | if len(optId) > 0 { |
| 454 | m.Id = optId[0] |
| 455 | } |
| 456 | |
| 457 | m.initDefaultId() |
| 458 | m.initDefaultFields() |
| 459 | m.setDefaultAuthOptions() |
| 460 | |
| 461 | return m |
| 462 | } |
| 463 | |
| 464 | // TableName returns the Collection model SQL table name. |
| 465 | func (m *Collection) TableName() string { |
searching dependent graphs…