Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import "fmt"
type EdgeLocation struct {
Region string
Cache bool
}
func serveContent(edge EdgeLocation, content string) {
fmt.Println("Request received at:", edge.Region)
if edge.Cache {
fmt.Println("Serving from Edge Cache")
} else {
fmt.Println("Fetching from Origin Server")
}
fmt.Println("Content:", content)
}
func main() {
edge := EdgeLocation{
Region: "Asia Pacific Edge",
Cache: true,
}
serveContent(edge, "backend-api-response")
}Coding works best on desktop or with an external keyboard.