package main

import (
	"context"
	"fmt"
  "time"

	"github.com/fastly/compute-sdk-go/fsthttp"
)

// BackendName is the name of our service backend.
const BackendName = "origin_0"

func main() {
	fsthttp.ServeFunc(func(ctx context.Context, w fsthttp.ResponseWriter, r *fsthttp.Request) {
    // Define the time.
    theTime := time.Date(2006, time.January, 2, 22, 4, 5, 0, time.UTC)
    fmt.Println("Default time format:", theTime)
    // List of constant time formats available in the time package:
    // https://pkg.go.dev/time#pkg-constants
    // Print the time in different time formats to the console.
    fmt.Println("RFC1123Z:", theTime.Format(time.RFC1123Z))
    fmt.Println("RFC3339:", theTime.Format(time.RFC3339))
    fmt.Println("Unix:", theTime.Unix())

		w.WriteHeader(fsthttp.StatusOK)
	})
}