eventhub

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 11 Imported by: 2

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 is eventhub client.

func Dial

func Dial(addr string, opts ...Option) (*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 *sas.Credentials,
	done <-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

type Credentials

type Credentials struct {
	Endpoint            string
	SharedAccessKeyName string
	SharedAccessKey     string
	EntityPath          string
}

Credentials is an evenhub connection string representation.

func ParseConnectionString

func ParseConnectionString(cs string) (*Credentials, error)

ParseConnectionString parses the given connection string into Credentials structure.

type Option

type Option func(c *Client)

func WithConnOption

func WithConnOption(opt amqp.ConnOption) Option

func WithLogger

func WithLogger(l common.Logger) Option

func WithSASLPlain

func WithSASLPlain(username, password string) Option

func WithTLSConfig

func WithTLSConfig(tc *tls.Config) Option

Jump to

Keyboard shortcuts

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