Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllTables ¶
func GetAllTables() []interface{}
func PrimaryKeyForTable ¶
Types ¶
type CacheEntry ¶
type CacheEntry struct {
Model
EntryID string `gorm:"primary_key;"`
ExpirationTimeUsec int64
SizeBytes int64
ReadCount int64
}
func (*CacheEntry) TableName ¶
func (c *CacheEntry) TableName() string
type Group ¶
type Group struct {
Model
GroupID string `gorm:"primary_key;"`
// The user that OWNS this group. Only this user may modify it.
UserID string
// The group name. This may be displayed to users.
Name string
// The "owned" domain. In enterprise/cloud version, we create a
// group for a customer's domain, and new users that sign up with an
// email belonging to that domain may be added to this group.
OwnedDomain string `gorm:"index:owned_domain_index"`
// The group access token. This token allows writing data for this
// group.
WriteToken string `gorm:"index:write_token_index"`
}
type Invocation ¶
type Invocation struct {
Model
InvocationID string `gorm:"primary_key;"`
UserID string `gorm:"index:user_id"`
GroupID string `gorm:"index:group_id"`
Perms int `gorm:"index:perms"`
Success bool
User string `gorm:"index:user_index"`
DurationUsec int64
Host string `gorm:"index:host_index"`
Command string
Pattern string
ActionCount int64
BlobID string
InvocationStatus int64 `gorm:"index:invocation_status_idx"`
}
func (*Invocation) FromProtoAndBlobID ¶ added in v1.0.4
func (i *Invocation) FromProtoAndBlobID(p *inpb.Invocation, blobID string)
func (*Invocation) TableName ¶
func (i *Invocation) TableName() string
func (*Invocation) ToProto ¶ added in v1.0.4
func (i *Invocation) ToProto() *inpb.Invocation
type Model ¶
func (*Model) BeforeCreate ¶
Timestamps are hard and differing sql implementations do... a lot. Too much. So, we handle this in go-code and set these to time.Now().UnixNano and store as int64.
type Token ¶
type User ¶
type User struct {
Model
// The buildbuddy user ID.
UserID string `gorm:"primary_key;"`
// The subscriber ID, a concatenated string of the
// auth Issuer ID and the subcriber ID string.
SubID string `gorm:"index:sub_id_index"`
// Groups are used to determine read/write permissions
// for everything.
Groups []*Group `gorm:"many2many:UserGroups;"`
// Profile information etc.
FirstName string
LastName string
Email string
ImageURL string
}
func (*User) ToProto ¶
func (u *User) ToProto() *uspb.DisplayUser
Click to show internal directories.
Click to hide internal directories.