You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/host/static/public_ids.go

39 lines
751 B

package static
import (
"fmt"
"github.com/hashicorp/boundary/internal/db"
)
// PublicId prefixes for the resources in the static package.
const (
HostCatalogPrefix = "hcst"
HostSetPrefix = "hsst"
HostPrefix = "hst"
)
func newHostCatalogId() (string, error) {
id, err := db.NewPublicId(HostCatalogPrefix)
if err != nil {
return "", fmt.Errorf("new host catalog id: %w", err)
}
return id, err
}
func newHostId() (string, error) {
id, err := db.NewPublicId(HostPrefix)
if err != nil {
return "", fmt.Errorf("new host id: %w", err)
}
return id, err
}
func newHostSetId() (string, error) {
id, err := db.NewPublicId(HostSetPrefix)
if err != nil {
return "", fmt.Errorf("new host set id: %w", err)
}
return id, err
}