client

package
v2.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client struct

func New

func New(
	configPrefix string,
	config *viper.Viper,
	logger logger.Logger,
	client pb.GRPCForwarderClient,
	opts ...grpc.DialOption,
) (*Client, error)

New ctor configPrefix is whatever comes before `client` subpart of config

func NewClient

func NewClient(
	configPrefix string,
	config *viper.Viper,
	logger logrus.FieldLogger,
	client pb.GRPCForwarderClient,
	opts ...grpc.DialOption,
) (*Client, error)

NewClient ctor (DEPRECATED, use New() instead) configPrefix is whatever comes before `client` subpart of config

func (*Client) GetGRPCClient

func (c *Client) GetGRPCClient() GRPCClient

func (*Client) GracefulStop

func (c *Client) GracefulStop() error

GracefulStop waits pending async send of events and closes client connection

func (*Client) Send

func (c *Client) Send(
	ctx context.Context,
	name string,
	props map[string]string,
) error

Send sends an event to another server via grpc using the client's configured topic

func (*Client) SendAtTime

func (c *Client) SendAtTime(
	ctx context.Context,
	name string,
	props map[string]string,
	time time.Time,
) error

SendAtTime sends an event to another server via grpc with a specific timestamp

func (*Client) SendToTopic

func (c *Client) SendToTopic(
	ctx context.Context,
	name string,
	props map[string]string,
	topic string,
) error

SendToTopic sends an event to another server via grpc using an explicit topic

type GRPCClient

type GRPCClient interface {
	GracefulStop() error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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