Files
threshold/internal/host/static/gorm.go
T

64 lines
1.7 KiB
Go
Raw Normal View History

2020-05-27 18:16:43 -04:00
package static
const (
defaultHostCatalogTableName = "static_host_catalog"
defaultHostTableName = "static_host"
defaultHostSetTableName = "static_host_set"
defaultHostSetMemberTableName = "static_host_set_member"
)
2020-05-27 18:16:43 -04:00
// TableName returns the table name for the host catalog.
func (c *HostCatalog) TableName() string {
if c.tableName != "" {
return c.tableName
}
return defaultHostCatalogTableName
2020-05-27 18:16:43 -04:00
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
2020-05-27 18:16:43 -04:00
func (c *HostCatalog) SetTableName(n string) {
2020-07-23 17:58:41 -04:00
c.tableName = n
2020-05-27 18:16:43 -04:00
}
// TableName returns the table name for the host.
func (h *Host) TableName() string {
if h.tableName != "" {
return h.tableName
}
return defaultHostTableName
2020-05-27 18:16:43 -04:00
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
2020-05-27 18:16:43 -04:00
func (h *Host) SetTableName(n string) {
2020-07-23 17:58:41 -04:00
h.tableName = n
2020-05-27 18:16:43 -04:00
}
// TableName returns the table name for the host set.
func (s *HostSet) TableName() string {
if s.tableName != "" {
return s.tableName
}
return defaultHostSetTableName
2020-05-27 18:16:43 -04:00
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
2020-05-27 18:16:43 -04:00
func (s *HostSet) SetTableName(n string) {
2020-07-23 17:58:41 -04:00
s.tableName = n
2020-05-27 18:16:43 -04:00
}
// TableName returns the table name for the host set.
func (m *HostSetMember) TableName() string {
if m.tableName != "" {
return m.tableName
}
return defaultHostSetMemberTableName
2020-05-27 18:16:43 -04:00
}
// SetTableName sets the table name. If the caller attempts to
// set the name to "" the name will be reset to the default name.
2020-05-27 18:16:43 -04:00
func (m *HostSetMember) SetTableName(n string) {
2020-07-23 17:58:41 -04:00
m.tableName = n
2020-05-27 18:16:43 -04:00
}