eventhub

package
v0.0.0-...-e8ffabb Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMessageResponse

func CheckMessageResponse(msg *amqp.Message) error

CheckMessageResponse checks for 200 response code otherwise returns an error.

func RandString

func RandString() (string, error)

RandString generates a random 32 bytes long string.

func SubscribePartitions

func SubscribePartitions(ctx context.Context, sess *amqp.Session, name, group string, f func(*amqp.Message)) error

Types

type Client

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

Client is eventhub client.

func Dial

func Dial(addr string, tlsConfig *tls.Config) (*Client, error)

Dial connects to the named amqp broker and returns an eventhub client.

func (*Client) Close

func (c *Client) Close() error

Close closes amqp session and connection.

func (*Client) PutToken

func (c *Client) PutToken(ctx context.Context, audience, token string) error

func (*Client) PutTokenContinuously

func (c *Client) PutTokenContinuously(
	ctx context.Context,
	audience string,
	cred *common.Credentials,
	stopCh chan struct{},
) error

PutTokenContinuously writes token first time in blocking mode and returns maintaining token updates in the background until stopCh is closed.

func (*Client) Sess

func (c *Client) Sess() *amqp.Session

func (*Client) SubscribePartitions

func (c *Client) SubscribePartitions(ctx context.Context, name, group string, f func(*amqp.Message)) error

Jump to

Keyboard shortcuts

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