Documentation
¶
Overview ¶
Package http implements the logic to create API request It use in api module to get data from API
Index ¶
Constants ¶
View Source
const ( // FMPBaseURL represents the base URL for the financialmodelingprep.com API. FMPBaseURL string = "https://financialmodelingprep.com/api/v3" // EmptyResponseBody is the response given by the API EmptyResponseBody string = "[]" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInterface ¶
ClientInterface is the contract that must be follow to create a new HTTP client that will be used by API to get data
type FMPHandler ¶
type FMPHandler struct { APIKey string // APIKey represents the API key used for authentication. MaxAttempt uint // MaxAttempt represents the maximum number of attempts for API requests. }
FMPHandler represents a handler for interacting with the financialmodelingprep.com API. It contains fields for storing the API key and defining the maximum number of attempts to make when communicating with the API.
func (*FMPHandler) DoRequest ¶
func (httpHandler *FMPHandler) DoRequest(method, url string, body []byte) ([]byte, error)
DoRequest performs an HTTP request to the financialmodelingprep.com API. It takes the HTTP method, URL, and request body as input parameters and returns the response body as a byte slice and an error, if any.
Click to show internal directories.
Click to hide internal directories.