2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2023-02-02 17:15:17 -08:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2023-04-24 19:27:41 -04:00
|
|
|
package plugin
|
2021-09-08 10:06:38 -07:00
|
|
|
|
|
|
|
|
import (
|
2023-06-06 17:09:08 -04:00
|
|
|
"context"
|
|
|
|
|
|
2021-09-08 10:06:38 -07:00
|
|
|
"github.com/hashicorp/boundary/internal/db"
|
|
|
|
|
"github.com/hashicorp/boundary/internal/errors"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// PublicId prefixes for the resources in the plugin package.
|
|
|
|
|
const (
|
2021-09-24 13:16:13 -07:00
|
|
|
PluginPrefix = "pl"
|
2021-09-08 10:06:38 -07:00
|
|
|
)
|
|
|
|
|
|
2023-06-06 17:09:08 -04:00
|
|
|
func newPluginId(ctx context.Context) (string, error) {
|
|
|
|
|
id, err := db.NewPublicId(ctx, PluginPrefix)
|
2021-09-08 10:06:38 -07:00
|
|
|
if err != nil {
|
2023-06-06 17:09:08 -04:00
|
|
|
return "", errors.Wrap(ctx, err, "plugin.newPluginId")
|
2021-09-08 10:06:38 -07:00
|
|
|
}
|
|
|
|
|
return id, nil
|
|
|
|
|
}
|