Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update infratographer/x to enable event traces #38

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ COCKROACH_URL="postgresql://root@crdb:26257/location_api_dev?sslmode=disable"
ATLAS_DB_URI="postgresql://root@crdb:26257/atlas_migrations?sslmode=disable"
LOCATIONAPI_CRDB_URI="postgresql://root@crdb:26257/location_api_dev?sslmode=disable"
LOCATIONAPI_EVENTS_PUBLISHER_NATS_CREDSFILE="/workspaces/location-api/.devcontainer/nsc/nkeys/creds/LOCAL/LOC/USER.creds"
# LOCATIONAPI_TRACING_ENABLED="true"
# LOCATIONAPI_TRACING_PROVIDER="passthrough"

NKEYS_PATH="/workspaces/location-api/.devcontainer/nsc/nkeys"
NSC_HOME="/workspaces/location-api/.devcontainer/nsc/nats"
Expand Down
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
# Location API

Provides GraphQL APIs to manage locations

## Development and Contributing

- [Development Guide](docs/development.md)
- [Contributing](https://infratographer.com/community/contributing/)

### Getting Started

To begin start by opening the devcontainer as outlined in the [Development Guide](docs/development.md)

**To initialize the database:**
1. `go build`
1. `./location-api migrate up`

**To run the api**
```sh
make go-run
```

**Interacting with the GraphQL queries:**
> Go to localhost:XXXX/playground

## Example GraphQL Queries

### Create Location Mutation

Input:
```graphql
mutation {
locationCreate(input:{
name: "DA",
ownerID: "testtnt-123456",
description: "DA Metro"
}) {
location{
id
}
}
}
```

Output:
```json
{
"data": {
"locationCreate": {
"location": {
"id": "lctnloc-NW_5CWPx3xeOuh4Ak2WgS"
}
}
}
}
```
51 changes: 25 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.20
require (
entgo.io/contrib v0.4.5
entgo.io/ent v0.12.3
github.com/99designs/gqlgen v0.17.32-0.20230521032519-c313bf3d2899
github.com/99designs/gqlgen v0.17.34
github.com/Yamashou/gqlgenc v0.13.5
github.com/brianvoe/gofakeit/v6 v6.22.0
github.com/brianvoe/gofakeit/v6 v6.23.0
github.com/hashicorp/go-multierror v1.1.1
github.com/labstack/echo/v4 v4.10.2
github.com/lib/pq v1.10.9
Expand All @@ -16,11 +16,11 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go/modules/postgres v0.20.1
github.com/vektah/gqlparser/v2 v2.5.2-0.20230422221642-25e09f9d292d
github.com/testcontainers/testcontainers-go/modules/postgres v0.21.0
github.com/vektah/gqlparser/v2 v2.5.6
github.com/wundergraph/graphql-go-tools v1.63.0
go.infratographer.com/permissions-api v0.1.14
go.infratographer.com/x v0.3.2
go.infratographer.com/x v0.3.4
go.uber.org/zap v1.24.0
)

Expand All @@ -39,12 +39,12 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/cockroach-go/v2 v2.3.3 // indirect
github.com/cockroachdb/cockroach-go/v2 v2.3.5 // indirect
github.com/containerd/containerd v1.6.19 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v23.0.6+incompatible // indirect
github.com/docker/docker v24.0.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
Expand All @@ -63,10 +63,10 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
Expand All @@ -78,15 +78,15 @@ require (
github.com/jackc/pgx/v4 v4.18.1 // indirect
github.com/jaevor/go-nanoid v1.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/labstack/echo v3.3.10+incompatible // indirect
github.com/labstack/echo-contrib v0.15.0 // indirect
github.com/labstack/echo-jwt/v4 v4.2.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
Expand All @@ -104,24 +104,23 @@ require (
github.com/nats-io/nuid v1.0.1 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/opencontainers/runc v1.1.7 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pressly/goose/v3 v3.11.2 // indirect
github.com/pressly/goose/v3 v3.13.4 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.40.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/prometheus/procfs v0.11.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/testcontainers/testcontainers-go v0.20.1 // indirect
github.com/testcontainers/testcontainers-go v0.21.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.9 // indirect
Expand All @@ -143,19 +142,19 @@ require (
go.step.sm/crypto v0.31.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading