http

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(readCloser io.ReadCloser, target any) error

Decode decodes a json string into the target type.

func NewTLSClientConfig

func NewTLSClientConfig(configuration *configuration.Configuration) (*tls.Config, error)

NewTLSClientConfig initiates a new tls.Config.

Types

type Client

type Client interface {
	// Call is responsible for making the HTTP call against BankID REST API
	Call(context context.Context, request *Request) (Response, error)
}

Client is the interface implemented by types that can invoke the BankID REST API.

func NewClient

func NewClient(configuration *configuration.Configuration, options ...Option) (Client, error)

NewClient returns a new instance of 'NewClient'.

type Option

type Option func(*client)

Option definition.

func WithHTTPClient

func WithHTTPClient(target *http.Client) Option

WithHTTPClient Function to create Option func to set net/http client.

type Payload

type Payload any

Payload is the interface implemented by types that holds the fields to be delivered to the API.

type Request

type Request struct {
	URI           string
	Payload       Payload
	Response      Response
	ErrorResponse error
}

Request holds the field related to http request.

type Response

type Response interface {
	OnDecode()
}

Response is the interface implemented by types that holds the response context fields.

Jump to

Keyboard shortcuts

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