client

package
v0.0.0-...-7638244 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnableToConnect is error when client is unable connect to rpc server
	ErrUnableToConnect = errors.New("unable to connect Talaria server")
)

Functions

This section is empty.

Types

type Client

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

Client represents a client for Talaria.

func Dial

func Dial(address string, options ...Option) (*Client, error)

Dial creates a new client and connect to Talaria grpc server.

func (*Client) Close

func (c *Client) Close() error

Close connection

func (*Client) IngestBatch

func (c *Client) IngestBatch(ctx context.Context, batch []Event) error

IngestBatch sends a batch of events to Talaria server.

type Event

type Event map[string]interface{}

Event represents a single event.

type Option

type Option func(client *Client)

Option is a functional parameter used to configure the client.

func WithCircuit

func WithCircuit(timeout time.Duration, maxConcurrent, errorThresholdPercent int) Option

WithCircuit specifies the configuration for the circuit breaker.

func WithCredential

func WithCredential(credentials credentials.TransportCredentials) Option

WithCredential specfies the configuration for the gRPC credentials based on TLS with this one being set, connection will be created in secure manner

func WithNetwork

func WithNetwork(dialTimeout time.Duration) Option

WithNetwork specifies the configuration for a connection.

func WithNonBlock

func WithNonBlock() Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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