func main()

in go/greeter/greeter.go [110:133]


func main() {

	builder := statefun.StatefulFunctionsBuilder()

	person := &Person{
		Visits: statefun.ValueSpec{
			Name:      "visits",
			ValueType: statefun.Int32Type,
		},
	}
	_ = builder.WithSpec(statefun.StatefulFunctionSpec{
		FunctionType: PersonTypeName,
		States:       []statefun.ValueSpec{person.Visits},
		Function:     person,
	})

	_ = builder.WithSpec(statefun.StatefulFunctionSpec{
		FunctionType: GreeterTypeName,
		Function:     statefun.StatefulFunctionPointer(Greeter),
	})

	http.Handle("/statefun", builder.AsHandler())
	_ = http.ListenAndServe(":8000", nil)
}