Files
threshold/internal/authtoken/gorm.go
T
Todd Knight 6de1f7ee16 Auth Token Read/List/Delete handler and Go SDK (#199)
* Creating Auth Token Get List and Delete API.
2020-07-23 09:53:37 -07:00

42 lines
1.0 KiB
Go

package authtoken
const defaultAuthTokenTableName = "auth_token_account"
const defaultWritableAuthTokenTableName = "auth_token"
// TableName returns the table name for the auth token.
func (s *AuthToken) TableName() string {
if s.tableName != "" {
return s.tableName
}
return defaultAuthTokenTableName
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
func (s *AuthToken) SetTableName(n string) {
switch n {
case "":
s.tableName = defaultAuthTokenTableName
default:
s.tableName = n
}
}
// TableName returns the table name for the auth token.
func (s *writableAuthToken) TableName() string {
if s.tableName != "" {
return s.tableName
}
return defaultWritableAuthTokenTableName
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
func (s *writableAuthToken) SetTableName(n string) {
switch n {
case "":
s.tableName = defaultWritableAuthTokenTableName
default:
s.tableName = n
}
}