http

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package http provides a client for interacting with the ARN receiver API using an azcore.Client.

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 a client for interacting with the ARN receiver API.

func New

func New(endpoint string, cred azcore.TokenCredential, opts *policy.ClientOptions, options ...Option) (*Client, error)

New returns a new Client for accessing the ARN receiver API.

func (*Client) Send

func (c *Client) Send(ctx context.Context, event []byte, headers []string) error

Send sends an event (converted to JSON bytes) to the ARN receiver API.

type Option

type Option func(*Client) error

Option is a function that configures the client.

func WithFake added in v0.1.1

func WithFake(s Sender) Option

WithFake configures the client to use a fake sender for testing. This will be used instead of .Send(). Can only be used in tests.

func WithoutCompression

func WithoutCompression() Option

WihtoutCompression turns off deflate compression for the client.

type Sender added in v0.1.1

type Sender interface {
	Send(ctx context.Context, event []byte) error
}

Sender is an interface to provide a fake sender for testing.

Jump to

Keyboard shortcuts

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