Files
threshold/internal/storage/plugin/ids.go
T
Jeff Mitchell a9e372930d Revert 0bf60996c5 (#3990)
Post-merge some issues were discovered with the ways typing is used for
proto reflection. This will be reworked without moving the subtypes
around.
2023-11-02 16:03:47 -04:00

35 lines
767 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package plugin
import (
"context"
"github.com/hashicorp/boundary/globals"
"github.com/hashicorp/boundary/internal/db"
"github.com/hashicorp/boundary/internal/errors"
"github.com/hashicorp/boundary/internal/types/subtypes"
)
const StorageDomain = "storage"
func init() {
if err := subtypes.Register(StorageDomain, Subtype, globals.PluginStorageBucketPrefix); err != nil {
panic(err)
}
}
const (
Subtype = subtypes.Subtype("plugin")
)
func newStorageBucketId(ctx context.Context) (string, error) {
const op = "plugin.newStorageBucketId"
id, err := db.NewPublicId(ctx, globals.PluginStorageBucketPrefix)
if err != nil {
return "", errors.Wrap(ctx, err, op)
}
return id, nil
}