mocking_http_reques

package
v0.0.0-...-7c18459 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Logger() Logger
	ExchangeBaseURL() string
	ExchangeAPIKey() string
}

Config is the config for Converter

type Converter

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

Converter will convert the base price to the currency supplied

func NewConverter

func NewConverter(cfg Config, requester Requester) *Converter

NewConverter creates and initializes the converter

func (*Converter) Exchange

func (c *Converter) Exchange(ctx context.Context, basePrice float64, currency string) (float64, error)

Exchange will perform the conversion

type Logger

type Logger interface {
	Warn(message string, args ...interface{})
	Error(message string, args ...interface{})
}

type Requester

type Requester interface {
	// contains filtered or unexported methods
}

Requester builds and sending HTTP requests

type Requesterer

type Requesterer struct {
}

Requesterer is the default implementation of Requester

Jump to

Keyboard shortcuts

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