This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"net/http" | |
) | |
func hello(w http.ResponseWriter, r *http.Request) { | |
io.WriteString(w, "Hello World!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/rpc" | |
"github.com/techwo/rpc-server/service" | |
) | |
// Calculator stands for the RPC client implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net" | |
"net/http" | |
"net/rpc" | |
"github.com/techwo/rpc-server/service" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
import ( | |
"errors" | |
"log" | |
) | |
// Calculator represents the service available over the network. | |
type Calculator int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
// Operations stands for all the remote fuctions definition in the service. | |
type Operations interface { | |
Addition(*Request, *Response) error | |
Subtraction(*Request, *Response) error | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
// Request represents the data args for the service. | |
type Request struct { | |
A, B float64 | |
} | |
// Response represents the data results from the service. | |
type Response struct { | |
Result float64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"net/rpc" | |
"github.com/mbonell/simple-rpc-server/models" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"time" | |
"github.com/gophercloud/gophercloud" | |
"github.com/gophercloud/gophercloud/openstack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-get update | |
sudo apt-get install apache2 apache2-doc apache2-utils libexpat1 ssl-cert -y | |
wget https://gist.githubusercontent.com/MBonell/d1ac6700859db234b3d00151733997fe/raw/97addf5576725a67922e04e2f3b8c82854e9d8ad/example.html | |
sudo cp example.html /var/www/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="theme-color" content="#6D506E" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello Cloud App Devs</title> | |
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet"> |
NewerOlder