Getting Started with Go Core Runtime
Introduction
The go-core-runtime
is a core library for Apimatic's Go SDK, providing essential utilities and structures for handling API requests and responses using the HTTP protocol. For detailed API documentation and usage examples, visit the GoDoc documentation.
Requirement
This package requires Go v1.18 or higher.
Installation
To install the package, you can use go get
:
go get github.com/apimatic/go-core-runtime
Alternatively, you can add the package manually to your go.mod file:
require "github.com/apimatic/go-core-runtime" v0.0.x
Then, run the following command to install the package automatically:
go get ./...
Package Details
API Error
The apiError package provides a structure to represent error responses from API calls.
File Name |
Description |
API Error |
Provides a structure to represent error responses from API calls. |
HTTPS
The https package provides logic related to HTTP requests, including building and making the request call. It offers features such as handling form data, file parameters, headers, and interceptors.
File Name |
Description |
API Response |
Provides a struct around the HTTP response and the data. |
Call Builder |
Provides the logic related to the HTTPs request. Includes building and making the request call. |
File Wrapper |
Provides a wrapper for file parameters to use in the HTTPs calls. |
Form Data |
Provides handling of form parameters in the request. |
HTTP Client |
Provides an interface for the HTTP Client to use for making the calls. |
HTTP Configuration |
Provides configurations for the HTTP calls. |
HTTP Context |
Provides a struct that holds request and corresponding response instances. |
HTTP Headers |
Provides handling for headers to send with the request. |
Internal Error |
Provides handling for internal errors that may occur during the API calls. |
Interceptors |
Provides handling to intercept requests. |
Retryer |
Provides handling to automatically retry for failed requests. |
Test Helper
Package testHelper provides helper functions for testing purposes.
File Name |
Description |
BodyMatchers |
Provides functions to match JSON response bodies with expected bodies. |
HeadersMatchers |
Provides functions to match HTTP headers with expected headers. |
StatusCodeMatchers |
Provides functions to match HTTP status codes with expected status codes. |
Types
Package types provides utility types and functions.
File Name |
Description |
Optional |
Provides a wrapper to use any type as optional and nullable. |
Utilities
The utilities package provides utility functions for making HTTP calls.
File Name |
Description |
API Helper |
Provides helper methods for making the HTTP calls. |
Each package contains its test files.
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvement, please open an issue.
License
This project is licensed under the MIT License.
For any questions or support, please feel free to contact us at support@apimatic.io.