-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,376 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Empty file.
Empty file.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2024 The nilgo authors | ||
// Use of this source code is governed by a MIT license found in the LICENSE file. | ||
|
||
package main | ||
|
||
import ( | ||
"embed" | ||
"net/http" | ||
"time" | ||
|
||
"cloud.google.com/go/compute/metadata" | ||
|
||
"github.com/nil-go/nilgo" | ||
"github.com/nil-go/nilgo/config" | ||
"github.com/nil-go/nilgo/gcp" | ||
nhttp "github.com/nil-go/nilgo/http" | ||
) | ||
|
||
//go:embed config | ||
var configFS embed.FS | ||
|
||
func main() { | ||
var opts []any | ||
if metadata.OnGCE() { | ||
opts = gcp.Options() | ||
} | ||
opts = append(opts, | ||
config.WithFS(configFS), | ||
nhttp.Run(&http.Server{ReadTimeout: time.Second}), | ||
) | ||
|
||
if err := nilgo.Run(opts...); err != nil { | ||
panic(err) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
module github.com/nil-go/nilgo/examples/http | ||
|
||
go 1.22 | ||
|
||
toolchain go1.22.2 | ||
|
||
require ( | ||
cloud.google.com/go/compute/metadata v0.3.0 | ||
github.com/nil-go/nilgo v0.0.0 | ||
github.com/nil-go/nilgo/gcp v0.0.0 | ||
github.com/nil-go/nilgo/http v0.0.0 | ||
) | ||
|
||
replace ( | ||
github.com/nil-go/nilgo => ./../.. | ||
github.com/nil-go/nilgo/gcp => ./../../gcp | ||
github.com/nil-go/nilgo/http => ./../../http | ||
) | ||
|
||
require ( | ||
cloud.google.com/go v0.112.2 // indirect | ||
cloud.google.com/go/auth v0.3.0 // indirect | ||
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect | ||
cloud.google.com/go/profiler v0.4.0 // indirect | ||
github.com/go-logr/logr v1.4.1 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/golang/protobuf v1.5.4 // indirect | ||
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect | ||
github.com/google/s2a-go v0.1.7 // indirect | ||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect | ||
github.com/googleapis/gax-go/v2 v2.12.3 // indirect | ||
github.com/kr/pretty v0.1.0 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/nil-go/konf v1.1.0 // indirect | ||
github.com/nil-go/sloth v0.3.0 // indirect | ||
github.com/nil-go/sloth/otel v0.3.0 // indirect | ||
go.opencensus.io v0.24.0 // indirect | ||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect | ||
go.opentelemetry.io/otel v1.26.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.26.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.26.0 // indirect | ||
golang.org/x/crypto v0.22.0 // indirect | ||
golang.org/x/net v0.24.0 // indirect | ||
golang.org/x/oauth2 v0.19.0 // indirect | ||
golang.org/x/sync v0.7.0 // indirect | ||
golang.org/x/sys v0.19.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
google.golang.org/api v0.176.1 // indirect | ||
google.golang.org/genproto v0.0.0-20240415180920-8c6c420018be // indirect | ||
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect | ||
google.golang.org/grpc v1.63.2 // indirect | ||
google.golang.org/protobuf v1.33.0 // indirect | ||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.