grpc

package
v0.0.0-...-83f64a2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grpc

type Grpc struct {
	raccoon.Client
	// contains filtered or unexported fields
}

Grpc is the http implementation

func New

func New(options ...Option) (*Grpc, error)

New creates the new grpc client with provided options.

func (*Grpc) Close

func (gc *Grpc) Close()

Close closes the grpc connection.

func (*Grpc) Send

func (gc *Grpc) Send(events []*raccoon.Event) (string, *raccoon.Response, error)

Send sends the events to the raccoon service

type Option

type Option func(*Grpc)

Option represents the grpc client options.

func WithAddr

func WithAddr(addr string) Option

WithAddr sets the service address

func WithDialOptions

func WithDialOptions(opts ...grpc.DialOption) Option

WithDialOptions sets the grpc dial options.

func WithHeader

func WithHeader(key, val string) Option

WithHeader sets the grpc metadata for the request.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets the logger for the client.

func WithRetry

func WithRetry(delay time.Duration, maxAttempts uint) Option

WithRetry retries for the error upto max attempts with the given delay between calls

func WithSerializer

func WithSerializer(s serializer.SerializerFunc) Option

WithSerializer sets the serializer for the raccoon message.

Jump to

Keyboard shortcuts

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