tcp

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2021 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tcp provides a Target subtype for a TCP Target. Importing this package will register it with the target package and allow the target.Repository to support tcp.Targets.

Index

Constants

View Source
const (
	Subtype = subtypes.Subtype("tcp")
)
View Source
const (
	// TargetPrefix is the prefix for public ids of a tcp.Target.
	TargetPrefix = "ttcp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Target

type Target struct {
	*store.Target
	// contains filtered or unexported fields
}

Target is a resources that represets a networked service that can be accessed via TCP. It is a subtype of target.Target.

func New

func New(scopeId string, opt ...target.Option) (*Target, error)

New creates a new in memory tcp target. WithName, WithDescription and WithDefaultPort options are supported

func TestTarget

func TestTarget(t *testing.T, conn *db.DB, scopeId, name string, opt ...target.Option) *Target

TestTarget is used to create a Target that can be used by tests in other packages.

func (*Target) Clone

func (t *Target) Clone() target.Target

Clone creates a clone of the Target

func (*Target) GetType

func (t *Target) GetType() subtypes.Subtype

func (*Target) Oplog

func (t *Target) Oplog(op oplog.OpType) oplog.Metadata

Oplog provides the oplog.Metadata for recording operations taken on a Target.

func (*Target) SetCreateTime

func (t *Target) SetCreateTime(ts *timestamp.Timestamp)

func (*Target) SetDefaultPort

func (t *Target) SetDefaultPort(port uint32)

func (*Target) SetDescription

func (t *Target) SetDescription(description string)

func (*Target) SetName

func (t *Target) SetName(name string)

func (*Target) SetPublicId

func (t *Target) SetPublicId(ctx context.Context, publicId string) error

func (*Target) SetScopeId

func (t *Target) SetScopeId(scopeId string)

func (*Target) SetSessionConnectionLimit

func (t *Target) SetSessionConnectionLimit(limit int32)

func (*Target) SetSessionMaxSeconds

func (t *Target) SetSessionMaxSeconds(s uint32)

func (*Target) SetTableName

func (t *Target) SetTableName(n string)

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 (t *Target) SetUpdateTime(ts *timestamp.Timestamp)

func (*Target) SetVersion

func (t *Target) SetVersion(v uint32)

func (*Target) SetWorkerFilter

func (t *Target) SetWorkerFilter(filter string)

func (*Target) TableName

func (t *Target) TableName() string

TableName returns the tablename to override the default gorm table name

func (*Target) VetForWrite

func (t *Target) VetForWrite(ctx context.Context, _ db.Reader, opType db.OpType, _ ...db.Option) error

VetForWrite implements db.VetForWrite() interface and validates the tcp target before it's written.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL