Building block for mobile money api clients

base

the base code for creating mobile money api clients using golang

build request

request := NewRequestBuilder("login request", http.MethodPost, "https://google.com/login").
		Endpoint("/account-id").
		BasicAuth(&BasicAuth{Username: "johndoe", Password: "jd2021"}).
		Headers(map[string]string{
			"Content-Type": "application/json",
			"Accept":       "application/json"}).
		Payload(user).
		QueryParams(map[string]string{
			"page":  "1",
			"limit": "10"}).
		Build()

modifiers

RequestModifier func(request *http.Request)

//example
headerModifier := func(headers map[string]string) RequestModifier {
		return func(req *http.Request) {
			for key, value := range headers {
				req.Header.Set(key, value)
			}
		}
	}

	payloadModifier := func(payload interface{}) RequestModifier {
		return func(req *http.Request) {
			pt := categorizeContentType(req.Header.Get("Content-Type"))
			buf, _ := MarshalPayload(pt, payload)
			req.Body = io.NopCloser(bytes.NewReader(buf.Bytes()))
		}
	}
Owner
TECHCRAFT TECHNOLOGIES LIMITED
Open Source at Techcraft
TECHCRAFT TECHNOLOGIES LIMITED
Similar Resources

The NVD API is an unofficial Go wrapper around the NVD API.

NVD API The NVD API is an unofficial Go wrapper around the NVD API. Supports: CVE CPE How to use The following shows how to basically use the wrapper

Jan 7, 2023

go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

Dec 15, 2022

A Wrapper Client for Google Spreadsheet API (Sheets API)

Senmai A Wrapper Client for Google Spreadsheet API (Sheets API) PREPARATION Service Account and Key File Create a service account on Google Cloud Plat

Nov 5, 2021

💾 Wolke API is the API behind Wolke image storage and processing aswell as user management

💾 Wolke API Wolke API is the API behind Wolke image storage and processing aswell as user management Deploying To deploy Wolke Bot you'll need podman

Dec 21, 2021

Upcoming mobiles api (UpMob API)

upcoming_mobiles_api (UpMob API) UpMob API scraps 91mobiles.com to get devices i

Dec 21, 2021

Arweave-api - Arweave API implementation in golang

Arweave API Go implementation of the Arweave API Todo A list of endpoints that a

Jan 16, 2022

Api-product - A basic REST-ish API that allows you to perform CRUD operations for Products

Description A basic REST-ish API that allows you to perform CRUD operations for

Jan 3, 2022

Contact-api - API for websites I have designed that have to send unauthenticated email

contact https://aws.amazon.com/premiumsupport/knowledge-center/custom-headers-ap

Apr 11, 2022

Triangula-api-server - API server for processing images with Triangula

Triangula API server Minimalistic API server that calculates and serves artistic

Jan 10, 2022
External app to check and cache the latest block from DMO nodes

checkblock External app to check and cache the latest block from DMO nodes. This

Dec 22, 2021
Go clients for the Metaplex Solana programs

metaplex-go A suite of Go clients for the 5 metaplex contracts. This is an alpha version. For usage examples, you can get inspired by their Rust/Types

Nov 25, 2022
Example code to demonstrate how to mock external clients via context.Context

Mocking external client libraries using context.Context This code is paired with a blog post: Mocking external client libraries using context.Context

Nov 6, 2022
🛠 A Go SDK for building applications on top of Uniswap V3

?? A Go SDK for building applications on top of Uniswap V3

Jan 1, 2023
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Go library for accessing the MyAnimeList API: http://myanimelist.net/modules.php?go=api

go-myanimelist go-myanimelist is a Go client library for accessing the MyAnimeList API. Project Status The MyAnimeList API has been stable for years a

Sep 28, 2022
Go client for the YNAB API. Unofficial. It covers 100% of the resources made available by the YNAB API.

YNAB API Go Library This is an UNOFFICIAL Go client for the YNAB API. It covers 100% of the resources made available by the YNAB API. Installation go

Oct 6, 2022
An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022
lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin to AWS Lambda and Amazon API Gateway.

aws-lambda-go-api-proxy makes it easy to run Golang APIs written with frameworks such as Gin with AWS Lambda and Amazon API Gateway.

Jan 6, 2023
A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021