client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 5 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 interface {
	// Do sends the HTTP request after signing it with authentication headers.
	Do(*http.Request) (*http.Response, error)
}

func NewClient

func NewClient(endpoint, apiKey, secret string, allowInsecure bool) (Client, error)

NewClient creates a new HMAC-authenticated HTTP client.

Parameters:

  • endpoint: Base API endpoint (e.g., "https://api.example.com")
  • apiKey: API key identifier
  • secret: Secret key for HMAC signing
  • allowInsecure: If true, disables TLS certificate verification (for testing)

Returns:

  • Client: Secure HTTP client that signs all requests
  • error: If endpoint is invalid

Jump to

Keyboard shortcuts

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