Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Sqlite - SQLite protocol. Sqlite = "sqlite3" // Postgres - Postgresql protocol. Postgres = "postgresql" // MySQL - MySQL protocol. MySQL = "mysql" )
View Source
const ( // SQLiteInMemoryHost is the default string used by SQLite // as a host when ran in memory (string value is ":memory:"). SQLiteInMemoryHost = ":memory:" )
Variables ¶
View Source
var ( // ErrRecordNotFound - Record not found error. ErrRecordNotFound = gorm.ErrRecordNotFound // ErrUnsupportedDialect - An invalid dialect was specified. ErrUnsupportedDialect = errors.New("Unknown/unsupported DB Dialect") )
Functions ¶
Types ¶
type Certificate ¶
type Certificate struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
CommonName string
CAType string
KeyType string
CertificatePEM string
PrivateKeyPEM string
}
Certificate - Certificate database model.
func (*Certificate) BeforeCreate ¶
func (c *Certificate) BeforeCreate(tx *gorm.DB) (err error)
BeforeCreate - GORM hook to automatically set values.
type Config ¶
type Config struct {
Dialect string `json:"dialect"`
Database string `json:"database"`
Username string `json:"username"`
Password string `json:"password"`
Host string `json:"host"`
Port uint16 `json:"port"`
Params map[string]string `json:"params"`
MaxIdleConns int `json:"max_idle_conns"`
MaxOpenConns int `json:"max_open_conns"`
LogLevel string `json:"log_level"`
// EncryptionKey, when set, enables transparent encryption-at-rest for
// on-disk SQLite databases through the pure-Go adiantum VFS (available on
// the default and wasm_sqlite builds). It is deliberately NOT serialized:
// persisting the key next to the database it protects would defeat the
// purpose. Applications supply it out-of-band (option, env, KMS, prompt).
EncryptionKey string `json:"-"`
}
Config - Server database configuration.
type User ¶
type User struct {
ID uuid.UUID `gorm:"primaryKey;->;<-:create;type:uuid;"`
CreatedAt time.Time `gorm:"->;<-:create;"`
LastSeen time.Time
Name string
Token string `gorm:"uniqueIndex"`
}
User - A teamserver user (an authenticated identity + its credentials). The teamserver stores no authorization/permission data: applications own their own role model, keyed by the user Name.
Click to show internal directories.
Click to hide internal directories.