Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package tcp
|
|
|
|
import (
|
|
"context"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/target"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/target/store"
|
|
)
|
|
|
|
// Expose functions and variables for tests.
|
|
var (
|
|
TestId = testId
|
|
TestTargetName = testTargetName
|
|
DefaultTableName = defaultTableName
|
|
)
|
|
|
|
// NewTestTarget is a test helper that bypasses the projectId checks
|
|
// performed by NewTarget, allowing tests to create Targets with
|
|
// nil projectIds for more robust testing.
|
|
func NewTestTarget(ctx context.Context, projectId string, opt ...target.Option) target.Target {
|
|
t, _ := targetHooks{}.NewTarget(ctx, "testScope", opt...)
|
|
t.SetProjectId(projectId)
|
|
return t
|
|
}
|
|
|
|
// NewTestAddress is a test helper that bypasses the targetId & address checks
|
|
// performed by NewAddress, allowing tests to create a target Address with
|
|
// nil fields for more robust testing.
|
|
func NewTestAddress() *target.Address {
|
|
return &target.Address{
|
|
TargetAddress: &store.TargetAddress{},
|
|
}
|
|
}
|