Files
threshold/internal/alias/alias.go
T
429247f407 [COMPLIANCE] Update Copyright Headers (#6282)
* [COMPLIANCE] Update Copyright and License Headers

* chore: make gen to generate files with copyright headers

* chore: update missed copyright headers

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
2026-01-28 11:05:07 -06:00

45 lines
983 B
Go

// Copyright IBM Corp. 2020, 2025
// SPDX-License-Identifier: BUSL-1.1
package alias
import (
"github.com/hashicorp/boundary/internal/types/resource"
)
const (
Domain = "alias"
)
// An Alias is a view object containing only the information needed to lookup
// generic information about an alias.
type Alias struct {
tableName string `gorm:"-"`
PublicId string `gorm:"primary_key"`
DestinationId string
Value string
}
// allocAlias is just easier/better than leaking the underlying type
// bits to the repo, since the repo needs to alloc this type quite often.
func allocAlias() *Alias {
fresh := &Alias{}
return fresh
}
// GetResourceType returns the resource type of the Alias
func (al Alias) GetResourceType() resource.Type {
return resource.Alias
}
func (al *Alias) TableName() string {
if al.tableName != "" {
return al.tableName
}
return "alias_all_subtypes"
}
func (al *Alias) SetTableName(tableName string) {
al.tableName = tableName
}