MCPcopy
hub / github.com/pocketbase/pocketbase / NewAuthCollection

Function NewAuthCollection

core/collection_model.go:447–462  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

445// It also loads the minimal default configuration for the collection
446// (eg. system fields, indexes, type specific options, etc.).
447func 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.
465func (m *Collection) TableName() string {

Callers 15

TestCollectionValidateFunction · 0.92
TestRecordEmailFunction · 0.92
TestRecordVerifiedFunction · 0.92
TestRecordTokenKeyFunction · 0.92
TestRecordPasswordFunction · 0.92
TestNewAuthCollectionFunction · 0.92
TestCollectionSaveModelFunction · 0.92
TestRecordFieldsDataFunction · 0.92
TestRecordCustomDataFunction · 0.92
TestRecordDBExportFunction · 0.92

Calls 3

initDefaultIdMethod · 0.95
initDefaultFieldsMethod · 0.95
setDefaultAuthOptionsMethod · 0.95

Tested by 15

TestCollectionValidateFunction · 0.74
TestRecordEmailFunction · 0.74
TestRecordVerifiedFunction · 0.74
TestRecordTokenKeyFunction · 0.74
TestRecordPasswordFunction · 0.74
TestNewAuthCollectionFunction · 0.74
TestCollectionSaveModelFunction · 0.74
TestRecordFieldsDataFunction · 0.74
TestRecordCustomDataFunction · 0.74
TestRecordDBExportFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…