refact(target): Move tcp into subpackage

This moves all of the tcp target functionality into a tcp package. It
also establishes a Register function in the target package to allow
specific target types to be registered at initilazation time. When
registering, a target type needs to provide its Subtype, as well as some
RepositoryHooks that are used by the target Repository.
This commit is contained in:
Timothy Messier committed 2021-10-19 10:44:51 -04:00
1 parent b48f11dddb
commit eac433f7ff
49 files changed
+2416 -1735

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ import (
"github.com/hashicorp/boundary/internal/credential/vault"
"github.com/hashicorp/boundary/internal/iam"
"github.com/hashicorp/boundary/internal/servers/controller"
"github.com/hashicorp/boundary/internal/target"
"github.com/hashicorp/boundary/internal/target/tcp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -250,7 +250,7 @@ func TestSet_Errors(t *testing.T) {
assert.NotNil(apiErr)
assert.Nil(tar)
_, err = tarClient.Read(tc.Context(), target.TcpTargetPrefix+"_doesntexis")
_, err = tarClient.Read(tc.Context(), tcp.TargetPrefix+"_doesntexis")
require.Error(err)
apiErr = api.AsServerError(err)
assert.NotNil(apiErr)