client

package
v0.2.1-0...-32c0aa3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryKV

type BinaryKV struct {
	Key           []byte `json:"k"`
	Value         []byte `json:"v"`
	EndOfTransfer bool   `json:"EOT"`
}

type BinarySync2KafkaClient

type BinarySync2KafkaClient struct {
	// contains filtered or unexported fields
}

BinarySync2KafkaClient communicates with sync2kafka with binary encoded messages

func NewBinary

func NewBinary(config *SyncInitInfo, target string, insecureSkipVerify, useTls bool, caCert string) (client *BinarySync2KafkaClient)

NewBinary creates a new binary client for sync2kafaka server (uses []byte key value messages for input)

func (*BinarySync2KafkaClient) Close

func (c *BinarySync2KafkaClient) Close() error

func (*BinarySync2KafkaClient) Connect

func (c *BinarySync2KafkaClient) Connect(ctx context.Context) (err error)

Connect connects this sync2kafka client to a sync2kafka server.

func (*BinarySync2KafkaClient) EndTransfer

func (c *BinarySync2KafkaClient) EndTransfer() (err error)

EndTransfer ends a data transfer session

func (*BinarySync2KafkaClient) SendValue

func (c *BinarySync2KafkaClient) SendValue(kv BinaryKV) (err error)

SendValue send one value in a Transfer session (after calling StartTransfer() and before calling EndTransfer()

func (*BinarySync2KafkaClient) StartTransfer

func (c *BinarySync2KafkaClient) StartTransfer() (err error)

StartTransfer starts a data transfert session. Endtransfer() must be called after transferring all data

type JsonKV

type JsonKV struct {
	Key           *json.RawMessage `json:"k"`
	Value         *json.RawMessage `json:"v"`
	EndOfTransfer bool             `json:"EOT"`
}

type JsonSync2KafkaClient

type JsonSync2KafkaClient struct {
	// contains filtered or unexported fields
}

func NewJson

func NewJson(config *SyncInitInfo, target string, insecureSkipVerify, useTls bool, caCert string) (client *JsonSync2KafkaClient)

NewJson creates a new json client for sync2kafaka server (uses precomputed json key value messages for input)

func (*JsonSync2KafkaClient) Close

func (c *JsonSync2KafkaClient) Close() error

func (*JsonSync2KafkaClient) Connect

func (c *JsonSync2KafkaClient) Connect(ctx context.Context) (err error)

Connect connects this sync2kafka client to a sync2kafka server.

func (*JsonSync2KafkaClient) EndTransfer

func (c *JsonSync2KafkaClient) EndTransfer() (err error)

EndTransfer ends a data transfer session

func (*JsonSync2KafkaClient) StartTransfer

func (c *JsonSync2KafkaClient) StartTransfer() (err error)

StartTransfer starts a data transfert session. Endtransfer() must be called after transferring all data

type SyncInitInfo

type SyncInitInfo struct {
	// Format of data. Can be `json` or `binary`.
	Format string `json:"format"`

	// DoDelete makes the sync delete unseen keys. No deletions if false (the default case).
	DoDelete bool `json:"doDelete"`

	// Token for authn
	Token string `json:"token"`

	// Topic target topic if not default
	Topic string `json:"topic"`
}

type SyncResult

type SyncResult struct {
	OK bool `json:"ok"`
}

Jump to

Keyboard shortcuts

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