Documentation ¶
Overview ¶
Package targettest provides a test target subtype for use by the target package. Note that it leverages the tcp.Target's database table to avoid needing schema migrations just for tests.
Index ¶
- Constants
- func Alloc() target.Target
- func New(scopeId string, opt ...target.Option) (target.Target, error)
- func TestNewTestTarget(ctx context.Context, t *testing.T, conn *db.DB, scopeId, name string, ...) target.Target
- func Vet(ctx context.Context, t target.Target) error
- func VetCredentialLibraries(_ context.Context, _ []*target.CredentialLibrary) error
- type Target
- func (t *Target) Clone() target.Target
- func (t *Target) GetCreateTime() *timestamp.Timestamp
- func (t *Target) GetDefaultPort() uint32
- func (t *Target) GetDescription() string
- func (t *Target) GetName() string
- func (t *Target) GetPublicId() string
- func (t *Target) GetScopeId() string
- func (t *Target) GetSessionConnectionLimit() int32
- func (t *Target) GetSessionMaxSeconds() uint32
- func (t *Target) GetType() subtypes.Subtype
- func (t *Target) GetUpdateTime() *timestamp.Timestamp
- func (t *Target) GetVersion() uint32
- func (t *Target) GetWorkerFilter() string
- func (t *Target) Oplog(op oplog.OpType) oplog.Metadata
- func (t *Target) SetCreateTime(ts *timestamp.Timestamp)
- func (t *Target) SetDefaultPort(port uint32)
- func (t *Target) SetDescription(description string)
- func (t *Target) SetName(name string)
- func (t *Target) SetPublicId(_ context.Context, publicId string) error
- func (t *Target) SetScopeId(scopeId string)
- func (t *Target) SetSessionConnectionLimit(l int32)
- func (t *Target) SetSessionMaxSeconds(s uint32)
- func (t *Target) SetTableName(n string)
- func (t *Target) SetUpdateTime(ts *timestamp.Timestamp)
- func (t *Target) SetVersion(v uint32)
- func (t *Target) SetWorkerFilter(f string)
- func (t *Target) TableName() string
- func (t *Target) VetForWrite(ctx context.Context, _ db.Reader, opType db.OpType, _ ...db.Option) error
Constants ¶
View Source
const ( Subtype = subtypes.Subtype("tcp") TargetPrefix = "ttcp" )
Variables ¶
This section is empty.
Functions ¶
func TestNewTestTarget ¶
func TestNewTestTarget(ctx context.Context, t *testing.T, conn *db.DB, scopeId, name string, opt ...target.Option) target.Target
TestNewTestTarget is a test helper for creating a targettest.Target.
func VetCredentialLibraries ¶
func VetCredentialLibraries(_ context.Context, _ []*target.CredentialLibrary) error
VetCredentialLibraries allows for any CredentialLibraries.
Types ¶
type Target ¶
Target is a target.Target used for tests.
func (*Target) GetCreateTime ¶
func (*Target) GetDefaultPort ¶
func (*Target) GetDescription ¶
func (*Target) GetPublicId ¶
func (*Target) GetScopeId ¶
func (*Target) GetSessionConnectionLimit ¶
func (*Target) GetSessionMaxSeconds ¶
func (*Target) GetUpdateTime ¶
func (*Target) GetVersion ¶
func (*Target) GetWorkerFilter ¶
func (*Target) SetCreateTime ¶
func (*Target) SetDefaultPort ¶
func (*Target) SetDescription ¶
func (*Target) SetScopeId ¶
func (*Target) SetSessionConnectionLimit ¶
func (*Target) SetSessionMaxSeconds ¶
func (*Target) SetTableName ¶
SetTableName sets the tablename and satisfies the ReplayableMessage interface. If the caller attempts to set the name to "" the name will be reset to the default name.
func (*Target) SetUpdateTime ¶
func (*Target) SetVersion ¶
func (*Target) SetWorkerFilter ¶
Click to show internal directories.
Click to hide internal directories.