In this example we call out to a 3rd party library/API to handle payments.
Let's see the request and response types:
type TransactionRequest struct {
//request fields
}
/* This is a snippet to show how to add CORS middleware for grpc-gateway implementation */ | |
package main | |
// all relevant imports here | |
func main() { | |
ctx := BackgroundWithSignals() |
##Example 2##
In this example we will look at a part of a web application that manages stock items. The decision was made to start with using an embedded database, something like SQLite or BoltDB, with the idea to scale out to a more distributed database like Cassandra as the business scale.
Let's define the domain type:
package domain
In this example we look at a notification system that can send notifications as an sms and email.
Let's have a look at the main
function:
func main() {
//create smsNotifier object
var smsSender smsNotifier
smsSender.initialize("the-sms-api-config-details")