httpclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHclogAdapter

func NewHclogAdapter(logger hclog.Logger) resty.Logger

NewHclogAdapter creates a new adapter that forwards messages to an hclog.Logger.

func SetLoggerForResty

func SetLoggerForResty(client *resty.Client, logger hclog.Logger)

SetLoggerForResty sets the adapted hclog.Logger as the logger for Resty.

Types

type Client

type Client struct {
	RestyClient *resty.Client
}

Client represents a Resty a wrapper for the Resty client.

func New

func New(logger hclog.Logger, cfg *config.Config) (*Client, error)

New creates and initializes a new Resty client based on the provided configuration.

type HclogAdapter

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

HclogAdapter adapts an hclog.Logger to be compatible with the resty log.Logger interface.

func (*HclogAdapter) Debugf

func (a *HclogAdapter) Debugf(format string, v ...interface{})

Debugf logs a message at the debug level.

func (*HclogAdapter) Errorf

func (a *HclogAdapter) Errorf(format string, v ...interface{})

Errorf logs a message at the error level.

func (*HclogAdapter) Infof

func (a *HclogAdapter) Infof(format string, v ...interface{})

Infof logs a message at the info level.

func (*HclogAdapter) Warnf

func (a *HclogAdapter) Warnf(format string, v ...interface{})

Warnf logs a message at the warning level.

Jump to

Keyboard shortcuts

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