ssclient

package
v0.0.0-...-9750751 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey              = cli.NewErrorWithString("no key")
	ErrUniqueKeyViolation = cli.NewErrorWithString("unique key violation")
	ErrBadParam           = cli.NewErrorWithString("bad parameter")
	ErrConditionViolation = cli.NewErrorWithString("condition violation") //version too old

	ErrBadMsg        = cli.NewErrorWithString("bad message")
	ErrRecordLocked  = cli.NewErrorWithString("record locked")
	ErrServiceDenied = cli.NewErrorWithString("service denied")
	ErrCommitFailure = cli.NewErrorWithString("commit failure")
	ErrMarkedDelete  = cli.NewErrorWithString("record is marked as deleted")
	ErrInternal      = cli.NewErrorWithString("internal error")
)

Functions

This section is empty.

Types

type AdvSSClient

type AdvSSClient struct {
	Config
	Conn net.Conn
}

Advanced SSClient to mock proxy in the test

func NewAdvSSClient

func NewAdvSSClient(server string, ns string) *AdvSSClient

func NewAdvSSClientWithNumShards

func NewAdvSSClientWithNumShards(server string, ns string, numShards uint32) *AdvSSClient

func (*AdvSSClient) Abort

func (c *AdvSSClient) Abort(request *proto.OperationalMessage) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) CheckConnection

func (c *AdvSSClient) CheckConnection() (err error)

func (*AdvSSClient) Clone

func (c *AdvSSClient) Clone(request *proto.OperationalMessage) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) Commit

func (c *AdvSSClient) Commit(request *proto.OperationalMessage) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) CommitWithShardId

func (c *AdvSSClient) CommitWithShardId(shardId uint16, request *proto.OperationalMessage) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) Get

func (c *AdvSSClient) Get(key []byte) (value []byte, response *proto.OperationalMessage, err error)

func (*AdvSSClient) GetWithShardId

func (c *AdvSSClient) GetWithShardId(shardId uint16, key []byte) (value []byte, response *proto.OperationalMessage, err error)

func (*AdvSSClient) NewRequest

func (c *AdvSSClient) NewRequest(op proto.OpCode, key []byte, value []byte, ttl uint32) (request *proto.OperationalMessage)

func (*AdvSSClient) PrepareCreate

func (c *AdvSSClient) PrepareCreate(key []byte, value []byte, ttl uint32) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) PrepareCreateWithShardId

func (c *AdvSSClient) PrepareCreateWithShardId(shardId uint16, key []byte, value []byte, ttl uint32) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) Process

func (c *AdvSSClient) Process(m *proto.OperationalMessage) (response *proto.OperationalMessage, err error)

func (*AdvSSClient) StopRedist

func (c *AdvSSClient) StopRedist(zoneid uint16) (err error)

type Config

type Config struct {
	Target            string
	Namespace         string
	NumShards         uint32
	DefaultTimeToLive int
	ConnectTimeout    util.Duration //Millisecond
	ReadTimeout       util.Duration //Millisecond
	WriteTimeout      util.Duration //Millisecond
}

type Record

type Record struct {
	CreationTime         uint32
	TimeToLive           uint32
	Version              uint32
	LastModificationTime uint32
	Payload              proto.Payload
	OriginatorRequestId  proto.RequestId
	RequestId            proto.RequestId
}

func (*Record) PrettyPrint

func (r *Record) PrettyPrint(w io.Writer)

type SSClient

type SSClient struct {
	Target    string
	Namespace string
	NumShards uint32
}

func NewSSClient

func NewSSClient(server string, ns string) *SSClient

func NewSSClientWithNumShards

func NewSSClientWithNumShards(server string, ns string, numShards uint32) *SSClient

func (*SSClient) Delete

func (c *SSClient) Delete(key []byte) (err error)

func (*SSClient) Get

func (c *SSClient) Get(key []byte) (value []byte, recInfo *cli.RecordInfo, err error)

func (*SSClient) MarkDelete

func (c *SSClient) MarkDelete(key []byte, rec *Record) (err error)

func (*SSClient) Read

func (c *SSClient) Read(key []byte) (rec *Record, err error)

func (*SSClient) Store

func (c *SSClient) Store(key []byte, rec *Record) (err error)

Jump to

Keyboard shortcuts

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