Compare commits

..

9 Commits

Author SHA1 Message Date
Jeff McCune
954dbd1ec8 (#126) Refactor id token acquisition to token package
And add a logout command that deletes the token cache.

The token package is intended for subcommands that need to make API
calls to the holos api server, getting a token should be a simple matter
of calling the token.Get() method, which takes minimal dependencies.
2024-04-12 13:15:03 -07:00
Jeff McCune
30b70e76aa (#126) Add login command
This copies the login command from the previous holos cli.  Wire
dependency injection and all the rest of the unnecessary stuff from
kubelogin are removed, streamlined down into a single function that
takes a few oidc related parameters.

This will need to be extracted out into an infrastructure service so
multiple other command line tools can easily re-use it and get the ID
token into the x-oidc-id-token header.
2024-04-12 12:13:33 -07:00
Jeff McCune
ec6d112711 (#126) Remove hydra and kratos databases
No longer needed for dev.
2024-04-12 10:24:26 -07:00
Jeff McCune
e796c6a763 (#126) Default to DATABASE_URL env var 2024-04-12 10:20:13 -07:00
Jeff McCune
be32201294 (#126) Basic User and Organization Ent models
Get rid of the previous UserIdentity model, this is no longer part of
the core domain and instead handled within the context of ZITADEL.
2024-04-12 09:59:40 -07:00
Jeff McCune
5ebc54b5b7 (#124) Go Tools 2024-04-12 09:14:13 -07:00
Jeff McCune
2954a57872 (#120) Fix NATS target namespace
The upstream nats charts don't specify namespaces for each attribute.
This works with helm update, but not helm template which holos uses to
render the yaml.

The missing namespace causes flux to fail.

This patch uses the flux kustomization to add the target namespace to
all resources.
2024-04-10 21:54:58 -07:00
Jeff McCune
df705bd79f (#121) Fix Multiple Charts cause holos render to fail
When rendering a holos component which contains more than one helm chart, rendering fails.  It should succeed.

```
holos render --cluster-name=k2 /home/jeff/workspace/holos-run/holos/docs/examples/platforms/reference/clusters/holos/... --log-level debug
```

```
9:03PM ERR could not execute version=0.64.2 err="could not rename: rename /home/jeff/workspace/holos-run/holos/docs/examples/platforms/reference/clusters/holos/nats/envs/vendor553679311 /home/jeff/workspace/holos-run/holos/docs/examples/platforms/reference/clusters/holos/nats/envs/vendor: file exists" loc=helm.go:145
```

This patch fixes the problem by moving each child item of the temporary
directory charts are installed into.  This avoids the problem of moving
the parent when the parent target already exists.
2024-04-10 21:27:39 -07:00
Jeff McCune
4e8ce3585d (#115) Minor clean up of cue code 2024-04-10 21:21:16 -07:00
60 changed files with 5388 additions and 4999 deletions

View File

@@ -30,14 +30,15 @@ jobs:
with:
go-version: stable
- name: Install tools
run: sudo apt update && sudo apt -qq -y install curl zip unzip tar bzip2 make
- name: Install Packages
run: sudo apt update && sudo apt -qq -y install git curl zip unzip tar bzip2 make
- name: Install Deps
- name: Install Tools
run: |
make go-deps
set -x
make tools
make buf
go generate ./...
make frontend-deps
make frontend
go mod tidy

View File

@@ -36,11 +36,12 @@ jobs:
# Necessary to run these outside of goreleaser, otherwise
# /home/runner/_work/holos/holos/internal/frontend/node_modules/.bin/protoc-gen-connect-query is not in PATH
- name: Install Deps
- name: Install Tools
run: |
make go-deps
set -x
make tools
make buf
go generate ./...
make frontend-deps
make frontend
go mod tidy

View File

@@ -28,8 +28,8 @@ jobs:
with:
go-version: stable
- name: Install tools
run: sudo apt update && sudo apt -qq -y install curl zip unzip tar bzip2 make
- name: Install Packages
run: sudo apt update && sudo apt -qq -y install git curl zip unzip tar bzip2 make
- name: Set up Helm
uses: azure/setup-helm@v4
@@ -37,11 +37,12 @@ jobs:
- name: Set up Kubectl
uses: azure/setup-kubectl@v3
- name: Install Deps
- name: Install Tools
run: |
make go-deps
set -x
make tools
make buf
go generate ./...
make frontend-deps
make frontend
go mod tidy

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
bin/
/bin/
vendor/
.idea/
coverage.out

View File

@@ -102,12 +102,15 @@ buf: ## buf generate
cd service && buf mod update
buf generate
.PHONY: tools
tools: go-deps frontend-deps ## install tool dependencies
.PHONY: go-deps
go-deps: ## install go executables
go install github.com/bufbuild/buf/cmd/buf@v1
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@v1
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@v1
go-deps: ## tool versions pinned in tools.go
go install github.com/bufbuild/buf/cmd/buf
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install connectrpc.com/connect/cmd/protoc-gen-connect-go
go install honnef.co/go/tools/cmd/staticcheck@latest
# curl https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash

View File

@@ -141,9 +141,25 @@ func cacheChart(ctx context.Context, path holos.InstancePath, chartDir string, c
log.Debug("helm pull", "stdout", helmOut.Stdout, "stderr", helmOut.Stderr)
cachePath := filepath.Join(string(path), chartDir)
if err := os.Rename(cacheTemp, cachePath); err != nil {
return errors.Wrap(fmt.Errorf("could not rename: %w", err))
if err := os.MkdirAll(cachePath, 0777); err != nil {
return errors.Wrap(fmt.Errorf("could not mkdir: %w", err))
}
items, err := os.ReadDir(cacheTemp)
if err != nil {
return errors.Wrap(fmt.Errorf("could not read directory: %w", err))
}
for _, item := range items {
src := filepath.Join(cacheTemp, item.Name())
dst := filepath.Join(cachePath, item.Name())
log.DebugContext(ctx, "rename", "src", src, "dst", dst)
if err := os.Rename(src, dst); err != nil {
return errors.Wrap(fmt.Errorf("could not rename: %w", err))
}
}
log.InfoContext(ctx, "cached", "chart", chart.Name, "version", chart.Version, "path", cachePath)
return nil

View File

@@ -0,0 +1,26 @@
package holos
// NOTE: Beyond the base reference platform, services should typically be added to #OptionalServices instead of directly to a managed namespace.
// ManagedNamespace is a namespace to manage across all clusters in the holos platform.
#ManagedNamespace: {
namespace: {
metadata: {
name: string
labels: [string]: string
}
}
// clusterNames represents the set of clusters the namespace is managed on. Usually all clusters.
clusterNames: [...string]
for cluster in clusterNames {
clusters: (cluster): name: cluster
}
}
// #ManagedNamepsaces is the union of all namespaces across all cluster types and optional services.
// Holos adopts the namespace sameness position of SIG Multicluster, refer to https://github.com/kubernetes/community/blob/dd4c8b704ef1c9c3bfd928c6fa9234276d61ad18/sig-multicluster/namespace-sameness-position-statement.md
#ManagedNamespaces: {
[Name=_]: #ManagedNamespace & {
namespace: metadata: name: Name
}
}

View File

@@ -1,6 +1,8 @@
// Controls optional feature flags for services distributed across multiple holos components.
// For example, enable issuing certificates in the provisioner cluster when an optional service is
// enabled for a workload cluster.
// enabled for a workload cluster. Another example is NATS, which isn't necessary on all clusters,
// but is necessary on clusters with a project like holos which depends on NATS.
package holos
import "list"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
# curl -LO https://github.com/nats-io/nack/releases/latest/download/crds.yml
resources:
- crds.yml

View File

@@ -0,0 +1,8 @@
package holos
// NATS NetStream Controller (NACK)
spec: components: KustomizeBuildList: [
#KustomizeBuild & {
metadata: name: "prod-nack-crds"
},
]

View File

@@ -0,0 +1,37 @@
package holos
// for Project in _Projects {
// spec: components: resources: (#ProjectTemplate & {project: Project}).workload.resources
// }
let Namespace = "jeff-holos"
#Kustomization: spec: targetNamespace: Namespace
spec: components: HelmChartList: [
#HelmChart & {
metadata: name: "jeff-holos-nats"
namespace: Namespace
_dependsOn: "prod-secrets-stores": _
chart: {
name: "nats"
version: "1.1.10"
repository: NatsRepository
}
},
#HelmChart & {
metadata: name: "jeff-holos-nack"
namespace: Namespace
_dependsOn: "jeff-holos-nats": _
chart: {
name: "nack"
version: "0.25.2"
repository: NatsRepository
}
},
]
let NatsRepository = {
name: "nats"
url: "https://nats-io.github.io/k8s/helm/charts/"
}

View File

@@ -0,0 +1,5 @@
# Holos
This subtree contains holos components for holos itself. We strive for minimal dependencies, so this is likely going to contain NATS and/or Postgres resources.
Components depend on the holos project and may iterate over the defined environments in the project stages.

View File

@@ -182,7 +182,7 @@ _apiVersion: "holos.run/v1alpha1"
pool?: string
// region is the geographic region of the cluster.
region?: string
// primary is true if name matches the primaryCluster name
// primary is true if the cluster is the primary cluster among a group of related clusters.
primary: bool
}
@@ -219,6 +219,7 @@ _apiVersion: "holos.run/v1alpha1"
primary: false
}
}
// TODO: Remove stages, they're in the subdomain of projects.
stages: [ID=_]: {
name: string & ID
environments: [...{name: string}]
@@ -226,9 +227,11 @@ _apiVersion: "holos.run/v1alpha1"
projects: [ID=_]: {
name: string & ID
}
// TODO: Remove services, they're in the subdomain of projects.
services: [ID=_]: {
name: string & ID
}
// authproxy configures the auth proxy attached to the default ingress gateway in the istio-ingress namespace.
authproxy: #AuthProxySpec & {
namespace: "istio-ingress"
@@ -277,29 +280,6 @@ _apiVersion: "holos.run/v1alpha1"
idTokenHeader: string | *"x-oidc-id-token"
}
// ManagedNamespace is a namespace to manage across all clusters in the holos platform.
#ManagedNamespace: {
namespace: {
metadata: {
name: string
labels: [string]: string
}
}
// clusterNames represents the set of clusters the namespace is managed on. Usually all clusters.
clusterNames: [...string]
for cluster in clusterNames {
clusters: (cluster): name: cluster
}
}
// #ManagedNamepsaces is the union of all namespaces across all cluster types and optional services.
// Holos adopts the namespace sameness position of SIG Multicluster, refer to https://github.com/kubernetes/community/blob/dd4c8b704ef1c9c3bfd928c6fa9234276d61ad18/sig-multicluster/namespace-sameness-position-statement.md
#ManagedNamespaces: {
[Name=_]: #ManagedNamespace & {
namespace: metadata: name: Name
}
}
// #Backups defines backup configuration.
// TODO: Consider the best place for this, possibly as part of the site platform config. This represents the primary location for backups.
#Backups: {

87
go.mod
View File

@@ -8,10 +8,12 @@ require (
connectrpc.com/validate v0.1.0
cuelang.org/go v0.8.0
entgo.io/ent v0.13.1
github.com/bufbuild/buf v1.30.1
github.com/coreos/go-oidc/v3 v3.10.0
github.com/fullstorydev/grpcurl v1.9.1
github.com/go-jose/go-jose/v3 v3.0.3
github.com/gofrs/uuid v4.4.0+incompatible
github.com/google/uuid v1.5.0
github.com/int128/kubelogin v1.28.0
github.com/jackc/pgx/v5 v5.5.5
github.com/lmittmann/tint v1.0.4
github.com/mattn/go-isatty v0.0.20
@@ -22,10 +24,11 @@ require (
github.com/sethvargo/go-retry v0.2.4
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
golang.org/x/net v0.22.0
golang.org/x/tools v0.19.0
google.golang.org/protobuf v1.33.0
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002
honnef.co/go/tools v0.4.7
k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
@@ -36,62 +39,123 @@ require (
require (
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
connectrpc.com/otelconnect v0.7.0 // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bufbuild/protovalidate-go v0.3.0 // indirect
github.com/bufbuild/protocompile v0.10.0 // indirect
github.com/bufbuild/protovalidate-go v0.6.0 // indirect
github.com/bufbuild/protoyaml-go v0.1.8 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v26.0.0+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v26.0.0+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/proto v1.10.0 // indirect
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/felixge/fgprof v0.9.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-chi/chi/v5 v5.0.12 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gofrs/uuid/v5 v5.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.17.4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-containerregistry v0.19.1 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240327155427-868f304927ed // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/google/wire v0.5.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/int128/listener v1.1.0 // indirect
github.com/int128/oauth2cli v1.14.0 // indirect
github.com/int128/oauth2dev v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jdx/go-netrc v1.0.0 // indirect
github.com/jhump/protoreflect v1.16.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/onsi/gomega v1.31.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/protocolbuffers/txtpbfmt v0.0.0-20230328191034-3462fbc510c0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rs/cors v1.10.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.25.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.25.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
@@ -100,8 +164,9 @@ require (
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect
google.golang.org/grpc v1.62.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

540
go.sum
View File

@@ -2,55 +2,173 @@ ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 h1:GwdJbXydHCYPedeeLt4x/lrl
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43/go.mod h1:uj3pm+hUTVN/X5yfdBexHlZv+1Xu5u5ZbZx7+CDavNU=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1 h1:2IGhRovxlsOIQgx2ekZWo4wTPAYpck41+18ICxs37is=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.33.0-20240401165935-b983156c5e99.1/go.mod h1:Tgn5bgL220vkFOI0KPStlcClPeOJzAv4uT+V8JXGUnw=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
connectrpc.com/connect v1.16.0 h1:rdtfQjZ0OyFkWPTegBNcH7cwquGAN1WzyJy80oFNibg=
connectrpc.com/connect v1.16.0/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw=
connectrpc.com/otelconnect v0.7.0 h1:ZH55ZZtcJOTKWWLy3qmL4Pam4RzRWBJFOqTPyAqCXkY=
connectrpc.com/otelconnect v0.7.0/go.mod h1:Bt2ivBymHZHqxvo4HkJ0EwHuUzQN6k2l0oH+mp/8nwc=
connectrpc.com/validate v0.1.0 h1:r55jirxMK7HO/xZwVHj3w2XkVFarsUM77ZDy367NtH4=
connectrpc.com/validate v0.1.0/go.mod h1:GU47c9/x/gd+u9wRSPkrQOP46gx2rMN+Wo37EHgI3Ow=
cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e h1:GwCVItFUPxwdsEYnlUcJ6PJxOjTeFFCKOh6QWg4oAzQ=
cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e/go.mod h1:ApHceQLLwcOkCEXM1+DyCXTHEJhNGDpJ2kmV6axsx24=
cuelang.org/go v0.8.0 h1:fO1XPe/SUGtc7dhnGnTPbpIDoQm/XxhDtoSF7jzO01c=
cuelang.org/go v0.8.0/go.mod h1:CoDbYolfMms4BhWUlhD+t5ORnihR7wvjcfgyO9lL5FI=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9 h1:goHVqTbFX3AIo0tzGr14pgfAW2ZfPChKO21Z9MGf/gk=
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bufbuild/protovalidate-go v0.3.0 h1:t9zKgM//9VtPnP0TvyFqWubLQtSbwLwEUVOxgtX9/os=
github.com/bufbuild/protovalidate-go v0.3.0/go.mod h1:4mZkDYMGJlnHHQ9rPOhVEZ4bA13iOJBRLzywxy8f/lo=
github.com/bufbuild/buf v1.30.1 h1:QFtanwsXodoGFAwzXFXGXpzBkb7N2u8ZDyA3jWB4Pbs=
github.com/bufbuild/buf v1.30.1/go.mod h1:7W8DJnj76wQa55EA3z2CmDxS0/nsHh8FqtE00dyDAdA=
github.com/bufbuild/protocompile v0.10.0 h1:+jW/wnLMLxaCEG8AX9lD0bQ5v9h1RUiMKOBOT5ll9dM=
github.com/bufbuild/protocompile v0.10.0/go.mod h1:G9qQIQo0xZ6Uyj6CMNz0saGmx2so+KONo8/KrELABiY=
github.com/bufbuild/protovalidate-go v0.6.0 h1:Jgs1kFuZ2LHvvdj8SpCLA1W/+pXS8QSM3F/E2l3InPY=
github.com/bufbuild/protovalidate-go v0.6.0/go.mod h1:1LamgoYHZ2NdIQH0XGczGTc6Z8YrTHjcJVmiBaar4t4=
github.com/bufbuild/protoyaml-go v0.1.8 h1:X9QDLfl9uEllh4gsXUGqPanZYCOKzd92uniRtW2OnAQ=
github.com/bufbuild/protoyaml-go v0.1.8/go.mod h1:R8vE2+l49bSiIExP4VJpxOXleHE+FDzZ6HVxr3cYunw=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
github.com/chromedp/chromedp v0.9.2/go.mod h1:LkSXJKONWTCHAfQasKFUZI+mxqS4tZqhmtGzzhLsnLs=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe h1:QQ3GSy+MqSHxm/d8nCtnAiZdYFd45cYZPs8vOOIYKfk=
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ=
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM=
github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg=
github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
github.com/coreos/go-oidc/v3 v3.10.0 h1:tDnXHnLyiTVyT/2zLDGj09pFPkhND8Gl8lnTRhoEaJU=
github.com/coreos/go-oidc/v3 v3.10.0/go.mod h1:5j11xcw0D3+SGxn6Z/WFADsgcWVMyNAlSQupk0KK3ac=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v26.0.0+incompatible h1:90BKrx1a1HKYpSnnBFR6AgDq/FqkHxwlUyzJVPxD30I=
github.com/docker/cli v26.0.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/proto v1.10.0 h1:pDGyFRVV5RvV+nkBK9iy3q67FBy9Xa7vwrOTE+g5aGw=
github.com/emicklei/proto v1.10.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI=
github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
github.com/felixge/fgprof v0.9.4 h1:ocDNwMFlnA0NU0zSB3I52xkO4sFXk80VK9lXjLClu88=
github.com/felixge/fgprof v0.9.4/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fullstorydev/grpcurl v1.9.1 h1:YxX1aCcCc4SDBQfj9uoWcTLe8t4NWrZe1y+mk83BQgo=
github.com/fullstorydev/grpcurl v1.9.1/go.mod h1:i8gKLIC6s93WdU3LSmkE5vtsCxyRmihUj5FK1cNW5EM=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k=
github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U=
github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
@@ -67,40 +185,114 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY=
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M=
github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/cel-go v0.17.4 h1:9556LOjSyIZlgnT0oaCYGq2uk9BM6fzuTXhzYHskonk=
github.com/google/cel-go v0.17.4/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84=
github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY=
github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/pprof v0.0.0-20240327155427-868f304927ed h1:n8QtJTrwsv3P7dNxPaMeNkMcxvUpqocsHLr8iDLGlQI=
github.com/google/pprof v0.0.0-20240327155427-868f304927ed/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8=
github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl/v2 v2.13.0 h1:0Apadu1w6M11dyGFxWnmhhcMjkbAiKCv7G1r/2QgCNc=
github.com/hashicorp/hcl/v2 v2.13.0/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/int128/kubelogin v1.28.0 h1:T1xQ/dw2aIX/Bvv3KtSk8m8u483acr/5lidVRLBgIQ4=
github.com/int128/kubelogin v1.28.0/go.mod h1:UM4ShH939mXO1Cd0ns13mYQsUctyLbfHFHq8a6NXMG0=
github.com/int128/listener v1.1.0 h1:2Jb41DWLpkQ3I9bIdBzO8H/tNwMvyl/OBZWtCV5Pjuw=
github.com/int128/listener v1.1.0/go.mod h1:68WkmTN8PQtLzc9DucIaagAKeGVyMnyyKIkW4Xn47UA=
github.com/int128/oauth2cli v1.14.0 h1:r63NoO10ybUXIXUQxih8WOmt5HQpJubdTmhWh22B9VE=
github.com/int128/oauth2cli v1.14.0/go.mod h1:LIoVAzgAsS2tDDBc8yopkcgY5oZR0+MJAeECkCwtxhA=
github.com/int128/oauth2dev v1.0.0 h1:emMhky6ssFEiyujCGcTpuUkeBg121IvcFey54CxW844=
github.com/int128/oauth2dev v1.0.0/go.mod h1:lLIeCHF2MzH+sQ35/2IgA+Lbti/K2ONjrwO3n3FKSAM=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
@@ -109,12 +301,22 @@ github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ=
github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8=
github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg=
github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -125,6 +327,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc=
@@ -137,13 +340,21 @@ github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/Qd
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
@@ -158,12 +369,19 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA=
github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
@@ -174,13 +392,19 @@ github.com/protocolbuffers/txtpbfmt v0.0.0-20230328191034-3462fbc510c0 h1:sadMIs
github.com/protocolbuffers/txtpbfmt v0.0.0-20230328191034-3462fbc510c0/go.mod h1:jgxiZysxFPM+iWKwQwPR+y+Jvo54ARd4EisXxKYpB5c=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -190,40 +414,131 @@ github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8w
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k=
go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 h1:dT33yIHtmsqpixFsSQPwNeY5drM9wTcoL8h0FWF4oGM=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0/go.mod h1:h95q0LBGh7hlAC08X2DhSeyIG02YQ0UyioTCVAqRPmc=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA=
go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s=
go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo=
go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw=
go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k=
go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY=
go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM=
go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I=
go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 h1:mchzmB1XO2pMaKFRqk/+MV3mgGG96aqaPXaMifQU47w=
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw=
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE=
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
@@ -231,22 +546,64 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI=
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -260,7 +617,9 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -270,11 +629,53 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
@@ -284,29 +685,117 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM=
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs=
google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002 h1:V7Da7qt0MkY3noVANIMVBk28nOnijADeOR3i5Hcvpj4=
google.golang.org/protobuf v1.33.1-0.20240408130810-98873a205002/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0=
k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A=
k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0=
k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8=
@@ -337,6 +826,9 @@ modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=

9
hack/tilt/bin/tilt Executable file
View File

@@ -0,0 +1,9 @@
#! /bin/bash
# Override kubeconfig so we can create it with local()
set -euo pipefail
TOPLEVEL="$(cd $(dirname "$0")/.. && pwd)"
export NAMESPACE="${USER}-holos"
export KUBECONFIG="${TOPLEVEL}/kubeconfig"
envsubst < "${KUBECONFIG}.template" > "${KUBECONFIG}"
export TILT_WRAPPER=1
exec tilt "$@"

View File

@@ -266,19 +266,9 @@ spec:
databases:
- holos
options: 'SUPERUSER'
- name: kratos
databases:
- kratos
options: 'SUPERUSER'
- name: hydra
databases:
- hydra
options: 'SUPERUSER'
- name: '{developer}'
databases:
- holos
- kratos
- hydra
- '{developer}'
options: 'SUPERUSER'
# https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/user-management

View File

@@ -15,9 +15,8 @@ import (
"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// Client is the client that holds all ent builders.
@@ -25,10 +24,10 @@ type Client struct {
config
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// Organization is the client for interacting with the Organization builders.
Organization *OrganizationClient
// User is the client for interacting with the User builders.
User *UserClient
// UserIdentity is the client for interacting with the UserIdentity builders.
UserIdentity *UserIdentityClient
}
// NewClient creates a new client configured with the given options.
@@ -40,8 +39,8 @@ func NewClient(opts ...Option) *Client {
func (c *Client) init() {
c.Schema = migrate.NewSchema(c.driver)
c.Organization = NewOrganizationClient(c.config)
c.User = NewUserClient(c.config)
c.UserIdentity = NewUserIdentityClient(c.config)
}
type (
@@ -134,8 +133,8 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
return &Tx{
ctx: ctx,
config: cfg,
Organization: NewOrganizationClient(cfg),
User: NewUserClient(cfg),
UserIdentity: NewUserIdentityClient(cfg),
}, nil
}
@@ -155,15 +154,15 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
return &Tx{
ctx: ctx,
config: cfg,
Organization: NewOrganizationClient(cfg),
User: NewUserClient(cfg),
UserIdentity: NewUserIdentityClient(cfg),
}, nil
}
// Debug returns a new debug-client. It's used to get verbose logging on specific operations.
//
// client.Debug().
// User.
// Organization.
// Query().
// Count(ctx)
func (c *Client) Debug() *Client {
@@ -185,29 +184,162 @@ func (c *Client) Close() error {
// Use adds the mutation hooks to all the entity clients.
// In order to add hooks to a specific client, call: `client.Node.Use(...)`.
func (c *Client) Use(hooks ...Hook) {
c.Organization.Use(hooks...)
c.User.Use(hooks...)
c.UserIdentity.Use(hooks...)
}
// Intercept adds the query interceptors to all the entity clients.
// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
func (c *Client) Intercept(interceptors ...Interceptor) {
c.Organization.Intercept(interceptors...)
c.User.Intercept(interceptors...)
c.UserIdentity.Intercept(interceptors...)
}
// Mutate implements the ent.Mutator interface.
func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
switch m := m.(type) {
case *OrganizationMutation:
return c.Organization.mutate(ctx, m)
case *UserMutation:
return c.User.mutate(ctx, m)
case *UserIdentityMutation:
return c.UserIdentity.mutate(ctx, m)
default:
return nil, fmt.Errorf("ent: unknown mutation type %T", m)
}
}
// OrganizationClient is a client for the Organization schema.
type OrganizationClient struct {
config
}
// NewOrganizationClient returns a client for the Organization from the given config.
func NewOrganizationClient(c config) *OrganizationClient {
return &OrganizationClient{config: c}
}
// Use adds a list of mutation hooks to the hooks stack.
// A call to `Use(f, g, h)` equals to `organization.Hooks(f(g(h())))`.
func (c *OrganizationClient) Use(hooks ...Hook) {
c.hooks.Organization = append(c.hooks.Organization, hooks...)
}
// Intercept adds a list of query interceptors to the interceptors stack.
// A call to `Intercept(f, g, h)` equals to `organization.Intercept(f(g(h())))`.
func (c *OrganizationClient) Intercept(interceptors ...Interceptor) {
c.inters.Organization = append(c.inters.Organization, interceptors...)
}
// Create returns a builder for creating a Organization entity.
func (c *OrganizationClient) Create() *OrganizationCreate {
mutation := newOrganizationMutation(c.config, OpCreate)
return &OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// CreateBulk returns a builder for creating a bulk of Organization entities.
func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk {
return &OrganizationCreateBulk{config: c.config, builders: builders}
}
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
// a builder and applies setFunc on it.
func (c *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk {
rv := reflect.ValueOf(slice)
if rv.Kind() != reflect.Slice {
return &OrganizationCreateBulk{err: fmt.Errorf("calling to OrganizationClient.MapCreateBulk with wrong type %T, need slice", slice)}
}
builders := make([]*OrganizationCreate, rv.Len())
for i := 0; i < rv.Len(); i++ {
builders[i] = c.Create()
setFunc(builders[i], i)
}
return &OrganizationCreateBulk{config: c.config, builders: builders}
}
// Update returns an update builder for Organization.
func (c *OrganizationClient) Update() *OrganizationUpdate {
mutation := newOrganizationMutation(c.config, OpUpdate)
return &OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// UpdateOne returns an update builder for the given entity.
func (c *OrganizationClient) UpdateOne(o *Organization) *OrganizationUpdateOne {
mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganization(o))
return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// UpdateOneID returns an update builder for the given id.
func (c *OrganizationClient) UpdateOneID(id uuid.UUID) *OrganizationUpdateOne {
mutation := newOrganizationMutation(c.config, OpUpdateOne, withOrganizationID(id))
return &OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// Delete returns a delete builder for Organization.
func (c *OrganizationClient) Delete() *OrganizationDelete {
mutation := newOrganizationMutation(c.config, OpDelete)
return &OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a builder for deleting the given entity.
func (c *OrganizationClient) DeleteOne(o *Organization) *OrganizationDeleteOne {
return c.DeleteOneID(o.ID)
}
// DeleteOneID returns a builder for deleting the given entity by its id.
func (c *OrganizationClient) DeleteOneID(id uuid.UUID) *OrganizationDeleteOne {
builder := c.Delete().Where(organization.ID(id))
builder.mutation.id = &id
builder.mutation.op = OpDeleteOne
return &OrganizationDeleteOne{builder}
}
// Query returns a query builder for Organization.
func (c *OrganizationClient) Query() *OrganizationQuery {
return &OrganizationQuery{
config: c.config,
ctx: &QueryContext{Type: TypeOrganization},
inters: c.Interceptors(),
}
}
// Get returns a Organization entity by its id.
func (c *OrganizationClient) Get(ctx context.Context, id uuid.UUID) (*Organization, error) {
return c.Query().Where(organization.ID(id)).Only(ctx)
}
// GetX is like Get, but panics if an error occurs.
func (c *OrganizationClient) GetX(ctx context.Context, id uuid.UUID) *Organization {
obj, err := c.Get(ctx, id)
if err != nil {
panic(err)
}
return obj
}
// Hooks returns the client hooks.
func (c *OrganizationClient) Hooks() []Hook {
return c.hooks.Organization
}
// Interceptors returns the client interceptors.
func (c *OrganizationClient) Interceptors() []Interceptor {
return c.inters.Organization
}
func (c *OrganizationClient) mutate(ctx context.Context, m *OrganizationMutation) (Value, error) {
switch m.Op() {
case OpCreate:
return (&OrganizationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpUpdate:
return (&OrganizationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpUpdateOne:
return (&OrganizationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpDelete, OpDeleteOne:
return (&OrganizationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
default:
return nil, fmt.Errorf("ent: unknown Organization mutation op: %q", m.Op())
}
}
// UserClient is a client for the User schema.
type UserClient struct {
config
@@ -316,22 +448,6 @@ func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User {
return obj
}
// QueryIdentities queries the identities edge of a User.
func (c *UserClient) QueryIdentities(u *User) *UserIdentityQuery {
query := (&UserIdentityClient{config: c.config}).Query()
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
id := u.ID
step := sqlgraph.NewStep(
sqlgraph.From(user.Table, user.FieldID, id),
sqlgraph.To(useridentity.Table, useridentity.FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, user.IdentitiesTable, user.IdentitiesColumn),
)
fromV = sqlgraph.Neighbors(u.driver.Dialect(), step)
return fromV, nil
}
return query
}
// Hooks returns the client hooks.
func (c *UserClient) Hooks() []Hook {
return c.hooks.User
@@ -357,161 +473,12 @@ func (c *UserClient) mutate(ctx context.Context, m *UserMutation) (Value, error)
}
}
// UserIdentityClient is a client for the UserIdentity schema.
type UserIdentityClient struct {
config
}
// NewUserIdentityClient returns a client for the UserIdentity from the given config.
func NewUserIdentityClient(c config) *UserIdentityClient {
return &UserIdentityClient{config: c}
}
// Use adds a list of mutation hooks to the hooks stack.
// A call to `Use(f, g, h)` equals to `useridentity.Hooks(f(g(h())))`.
func (c *UserIdentityClient) Use(hooks ...Hook) {
c.hooks.UserIdentity = append(c.hooks.UserIdentity, hooks...)
}
// Intercept adds a list of query interceptors to the interceptors stack.
// A call to `Intercept(f, g, h)` equals to `useridentity.Intercept(f(g(h())))`.
func (c *UserIdentityClient) Intercept(interceptors ...Interceptor) {
c.inters.UserIdentity = append(c.inters.UserIdentity, interceptors...)
}
// Create returns a builder for creating a UserIdentity entity.
func (c *UserIdentityClient) Create() *UserIdentityCreate {
mutation := newUserIdentityMutation(c.config, OpCreate)
return &UserIdentityCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// CreateBulk returns a builder for creating a bulk of UserIdentity entities.
func (c *UserIdentityClient) CreateBulk(builders ...*UserIdentityCreate) *UserIdentityCreateBulk {
return &UserIdentityCreateBulk{config: c.config, builders: builders}
}
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
// a builder and applies setFunc on it.
func (c *UserIdentityClient) MapCreateBulk(slice any, setFunc func(*UserIdentityCreate, int)) *UserIdentityCreateBulk {
rv := reflect.ValueOf(slice)
if rv.Kind() != reflect.Slice {
return &UserIdentityCreateBulk{err: fmt.Errorf("calling to UserIdentityClient.MapCreateBulk with wrong type %T, need slice", slice)}
}
builders := make([]*UserIdentityCreate, rv.Len())
for i := 0; i < rv.Len(); i++ {
builders[i] = c.Create()
setFunc(builders[i], i)
}
return &UserIdentityCreateBulk{config: c.config, builders: builders}
}
// Update returns an update builder for UserIdentity.
func (c *UserIdentityClient) Update() *UserIdentityUpdate {
mutation := newUserIdentityMutation(c.config, OpUpdate)
return &UserIdentityUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// UpdateOne returns an update builder for the given entity.
func (c *UserIdentityClient) UpdateOne(ui *UserIdentity) *UserIdentityUpdateOne {
mutation := newUserIdentityMutation(c.config, OpUpdateOne, withUserIdentity(ui))
return &UserIdentityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// UpdateOneID returns an update builder for the given id.
func (c *UserIdentityClient) UpdateOneID(id uuid.UUID) *UserIdentityUpdateOne {
mutation := newUserIdentityMutation(c.config, OpUpdateOne, withUserIdentityID(id))
return &UserIdentityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// Delete returns a delete builder for UserIdentity.
func (c *UserIdentityClient) Delete() *UserIdentityDelete {
mutation := newUserIdentityMutation(c.config, OpDelete)
return &UserIdentityDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a builder for deleting the given entity.
func (c *UserIdentityClient) DeleteOne(ui *UserIdentity) *UserIdentityDeleteOne {
return c.DeleteOneID(ui.ID)
}
// DeleteOneID returns a builder for deleting the given entity by its id.
func (c *UserIdentityClient) DeleteOneID(id uuid.UUID) *UserIdentityDeleteOne {
builder := c.Delete().Where(useridentity.ID(id))
builder.mutation.id = &id
builder.mutation.op = OpDeleteOne
return &UserIdentityDeleteOne{builder}
}
// Query returns a query builder for UserIdentity.
func (c *UserIdentityClient) Query() *UserIdentityQuery {
return &UserIdentityQuery{
config: c.config,
ctx: &QueryContext{Type: TypeUserIdentity},
inters: c.Interceptors(),
}
}
// Get returns a UserIdentity entity by its id.
func (c *UserIdentityClient) Get(ctx context.Context, id uuid.UUID) (*UserIdentity, error) {
return c.Query().Where(useridentity.ID(id)).Only(ctx)
}
// GetX is like Get, but panics if an error occurs.
func (c *UserIdentityClient) GetX(ctx context.Context, id uuid.UUID) *UserIdentity {
obj, err := c.Get(ctx, id)
if err != nil {
panic(err)
}
return obj
}
// QueryUser queries the user edge of a UserIdentity.
func (c *UserIdentityClient) QueryUser(ui *UserIdentity) *UserQuery {
query := (&UserClient{config: c.config}).Query()
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
id := ui.ID
step := sqlgraph.NewStep(
sqlgraph.From(useridentity.Table, useridentity.FieldID, id),
sqlgraph.To(user.Table, user.FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, useridentity.UserTable, useridentity.UserColumn),
)
fromV = sqlgraph.Neighbors(ui.driver.Dialect(), step)
return fromV, nil
}
return query
}
// Hooks returns the client hooks.
func (c *UserIdentityClient) Hooks() []Hook {
return c.hooks.UserIdentity
}
// Interceptors returns the client interceptors.
func (c *UserIdentityClient) Interceptors() []Interceptor {
return c.inters.UserIdentity
}
func (c *UserIdentityClient) mutate(ctx context.Context, m *UserIdentityMutation) (Value, error) {
switch m.Op() {
case OpCreate:
return (&UserIdentityCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpUpdate:
return (&UserIdentityUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpUpdateOne:
return (&UserIdentityUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
case OpDelete, OpDeleteOne:
return (&UserIdentityDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
default:
return nil, fmt.Errorf("ent: unknown UserIdentity mutation op: %q", m.Op())
}
}
// hooks and interceptors per client, for fast access.
type (
hooks struct {
User, UserIdentity []ent.Hook
Organization, User []ent.Hook
}
inters struct {
User, UserIdentity []ent.Interceptor
Organization, User []ent.Interceptor
}
)

View File

@@ -12,8 +12,8 @@ import (
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// ent aliases to avoid import conflicts in user's code.
@@ -74,8 +74,8 @@ var (
func checkColumn(table, column string) error {
initCheck.Do(func() {
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
organization.Table: organization.ValidColumn,
user.Table: user.ValidColumn,
useridentity.Table: useridentity.ValidColumn,
})
})
return columnCheck(table, column)

View File

@@ -9,6 +9,18 @@ import (
"github.com/holos-run/holos/internal/ent"
)
// The OrganizationFunc type is an adapter to allow the use of ordinary
// function as Organization mutator.
type OrganizationFunc func(context.Context, *ent.OrganizationMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f OrganizationFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.OrganizationMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.OrganizationMutation", m)
}
// The UserFunc type is an adapter to allow the use of ordinary
// function as User mutator.
type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error)
@@ -21,18 +33,6 @@ func (f UserFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error)
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.UserMutation", m)
}
// The UserIdentityFunc type is an adapter to allow the use of ordinary
// function as UserIdentity mutator.
type UserIdentityFunc func(context.Context, *ent.UserIdentityMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f UserIdentityFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.UserIdentityMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.UserIdentityMutation", m)
}
// Condition is a hook condition function.
type Condition func(context.Context, ent.Mutation) bool

View File

@@ -8,13 +8,28 @@ import (
)
var (
// OrganizationsColumns holds the columns for the "organizations" table.
OrganizationsColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "name", Type: field.TypeString, Unique: true},
{Name: "display_name", Type: field.TypeString},
}
// OrganizationsTable holds the schema information for the "organizations" table.
OrganizationsTable = &schema.Table{
Name: "organizations",
Columns: OrganizationsColumns,
PrimaryKey: []*schema.Column{OrganizationsColumns[0]},
}
// UsersColumns holds the columns for the "users" table.
UsersColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "email", Type: field.TypeString, Unique: true},
{Name: "email_verified", Type: field.TypeBool, Default: false},
{Name: "iss", Type: field.TypeString},
{Name: "sub", Type: field.TypeString},
{Name: "name", Type: field.TypeString},
}
// UsersTable holds the schema information for the "users" table.
@@ -23,46 +38,12 @@ var (
Columns: UsersColumns,
PrimaryKey: []*schema.Column{UsersColumns[0]},
}
// UserIdentitiesColumns holds the columns for the "user_identities" table.
UserIdentitiesColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "iss", Type: field.TypeString},
{Name: "sub", Type: field.TypeString},
{Name: "email", Type: field.TypeString},
{Name: "email_verified", Type: field.TypeBool, Default: false},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "user_id", Type: field.TypeUUID},
}
// UserIdentitiesTable holds the schema information for the "user_identities" table.
UserIdentitiesTable = &schema.Table{
Name: "user_identities",
Columns: UserIdentitiesColumns,
PrimaryKey: []*schema.Column{UserIdentitiesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "user_identities_users_identities",
Columns: []*schema.Column{UserIdentitiesColumns[8]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.Cascade,
},
},
Indexes: []*schema.Index{
{
Name: "useridentity_iss_sub",
Unique: true,
Columns: []*schema.Column{UserIdentitiesColumns[3], UserIdentitiesColumns[4]},
},
},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
OrganizationsTable,
UsersTable,
UserIdentitiesTable,
}
)
func init() {
UserIdentitiesTable.ForeignKeys[0].RefTable = UsersTable
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/organization"
)
// Organization is the model entity for the Organization schema.
type Organization struct {
config `json:"-"`
// ID of the ent.
ID uuid.UUID `json:"id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// DisplayName holds the value of the "display_name" field.
DisplayName string `json:"display_name,omitempty"`
selectValues sql.SelectValues
}
// scanValues returns the types for scanning values from sql.Rows.
func (*Organization) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case organization.FieldName, organization.FieldDisplayName:
values[i] = new(sql.NullString)
case organization.FieldCreatedAt, organization.FieldUpdatedAt:
values[i] = new(sql.NullTime)
case organization.FieldID:
values[i] = new(uuid.UUID)
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the Organization fields.
func (o *Organization) assignValues(columns []string, values []any) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case organization.FieldID:
if value, ok := values[i].(*uuid.UUID); !ok {
return fmt.Errorf("unexpected type %T for field id", values[i])
} else if value != nil {
o.ID = *value
}
case organization.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field created_at", values[i])
} else if value.Valid {
o.CreatedAt = value.Time
}
case organization.FieldUpdatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
} else if value.Valid {
o.UpdatedAt = value.Time
}
case organization.FieldName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field name", values[i])
} else if value.Valid {
o.Name = value.String
}
case organization.FieldDisplayName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field display_name", values[i])
} else if value.Valid {
o.DisplayName = value.String
}
default:
o.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the Organization.
// This includes values selected through modifiers, order, etc.
func (o *Organization) Value(name string) (ent.Value, error) {
return o.selectValues.Get(name)
}
// Update returns a builder for updating this Organization.
// Note that you need to call Organization.Unwrap() before calling this method if this Organization
// was returned from a transaction, and the transaction was committed or rolled back.
func (o *Organization) Update() *OrganizationUpdateOne {
return NewOrganizationClient(o.config).UpdateOne(o)
}
// Unwrap unwraps the Organization entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (o *Organization) Unwrap() *Organization {
_tx, ok := o.config.driver.(*txDriver)
if !ok {
panic("ent: Organization is not a transactional entity")
}
o.config.driver = _tx.drv
return o
}
// String implements the fmt.Stringer.
func (o *Organization) String() string {
var builder strings.Builder
builder.WriteString("Organization(")
builder.WriteString(fmt.Sprintf("id=%v, ", o.ID))
builder.WriteString("created_at=")
builder.WriteString(o.CreatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("updated_at=")
builder.WriteString(o.UpdatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("name=")
builder.WriteString(o.Name)
builder.WriteString(", ")
builder.WriteString("display_name=")
builder.WriteString(o.DisplayName)
builder.WriteByte(')')
return builder.String()
}
// Organizations is a parsable slice of Organization.
type Organizations []*Organization

View File

@@ -0,0 +1,87 @@
// Code generated by ent, DO NOT EDIT.
package organization
import (
"time"
"entgo.io/ent/dialect/sql"
"github.com/gofrs/uuid"
)
const (
// Label holds the string label denoting the organization type in the database.
Label = "organization"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldDisplayName holds the string denoting the display_name field in the database.
FieldDisplayName = "display_name"
// Table holds the table name of the organization in the database.
Table = "organizations"
)
// Columns holds all SQL columns for organization fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldName,
FieldDisplayName,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
// NameValidator is a validator for the "name" field. It is called by the builders before save.
NameValidator func(string) error
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the Organization queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByDisplayName orders the results by the display_name field.
func ByDisplayName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDisplayName, opts...).ToFunc()
}

View File

@@ -0,0 +1,301 @@
// Code generated by ent, DO NOT EDIT.
package organization
import (
"time"
"entgo.io/ent/dialect/sql"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
)
// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.Organization {
return predicate.Organization(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldUpdatedAt, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldName, v))
}
// DisplayName applies equality check predicate on the "display_name" field. It's identical to DisplayNameEQ.
func DisplayName(v string) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldDisplayName, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.Organization {
return predicate.Organization(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Organization {
return predicate.Organization(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.Organization {
return predicate.Organization(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Organization {
return predicate.Organization(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.Organization {
return predicate.Organization(sql.FieldLTE(FieldUpdatedAt, v))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldName, v))
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.Organization {
return predicate.Organization(sql.FieldNEQ(FieldName, v))
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.Organization {
return predicate.Organization(sql.FieldIn(FieldName, vs...))
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.Organization {
return predicate.Organization(sql.FieldNotIn(FieldName, vs...))
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.Organization {
return predicate.Organization(sql.FieldGT(FieldName, v))
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.Organization {
return predicate.Organization(sql.FieldGTE(FieldName, v))
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.Organization {
return predicate.Organization(sql.FieldLT(FieldName, v))
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.Organization {
return predicate.Organization(sql.FieldLTE(FieldName, v))
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.Organization {
return predicate.Organization(sql.FieldContains(FieldName, v))
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.Organization {
return predicate.Organization(sql.FieldHasPrefix(FieldName, v))
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.Organization {
return predicate.Organization(sql.FieldHasSuffix(FieldName, v))
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.Organization {
return predicate.Organization(sql.FieldEqualFold(FieldName, v))
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.Organization {
return predicate.Organization(sql.FieldContainsFold(FieldName, v))
}
// DisplayNameEQ applies the EQ predicate on the "display_name" field.
func DisplayNameEQ(v string) predicate.Organization {
return predicate.Organization(sql.FieldEQ(FieldDisplayName, v))
}
// DisplayNameNEQ applies the NEQ predicate on the "display_name" field.
func DisplayNameNEQ(v string) predicate.Organization {
return predicate.Organization(sql.FieldNEQ(FieldDisplayName, v))
}
// DisplayNameIn applies the In predicate on the "display_name" field.
func DisplayNameIn(vs ...string) predicate.Organization {
return predicate.Organization(sql.FieldIn(FieldDisplayName, vs...))
}
// DisplayNameNotIn applies the NotIn predicate on the "display_name" field.
func DisplayNameNotIn(vs ...string) predicate.Organization {
return predicate.Organization(sql.FieldNotIn(FieldDisplayName, vs...))
}
// DisplayNameGT applies the GT predicate on the "display_name" field.
func DisplayNameGT(v string) predicate.Organization {
return predicate.Organization(sql.FieldGT(FieldDisplayName, v))
}
// DisplayNameGTE applies the GTE predicate on the "display_name" field.
func DisplayNameGTE(v string) predicate.Organization {
return predicate.Organization(sql.FieldGTE(FieldDisplayName, v))
}
// DisplayNameLT applies the LT predicate on the "display_name" field.
func DisplayNameLT(v string) predicate.Organization {
return predicate.Organization(sql.FieldLT(FieldDisplayName, v))
}
// DisplayNameLTE applies the LTE predicate on the "display_name" field.
func DisplayNameLTE(v string) predicate.Organization {
return predicate.Organization(sql.FieldLTE(FieldDisplayName, v))
}
// DisplayNameContains applies the Contains predicate on the "display_name" field.
func DisplayNameContains(v string) predicate.Organization {
return predicate.Organization(sql.FieldContains(FieldDisplayName, v))
}
// DisplayNameHasPrefix applies the HasPrefix predicate on the "display_name" field.
func DisplayNameHasPrefix(v string) predicate.Organization {
return predicate.Organization(sql.FieldHasPrefix(FieldDisplayName, v))
}
// DisplayNameHasSuffix applies the HasSuffix predicate on the "display_name" field.
func DisplayNameHasSuffix(v string) predicate.Organization {
return predicate.Organization(sql.FieldHasSuffix(FieldDisplayName, v))
}
// DisplayNameEqualFold applies the EqualFold predicate on the "display_name" field.
func DisplayNameEqualFold(v string) predicate.Organization {
return predicate.Organization(sql.FieldEqualFold(FieldDisplayName, v))
}
// DisplayNameContainsFold applies the ContainsFold predicate on the "display_name" field.
func DisplayNameContainsFold(v string) predicate.Organization {
return predicate.Organization(sql.FieldContainsFold(FieldDisplayName, v))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Organization) predicate.Organization {
return predicate.Organization(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Organization) predicate.Organization {
return predicate.Organization(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Organization) predicate.Organization {
return predicate.Organization(sql.NotPredicates(p))
}

View File

@@ -0,0 +1,663 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"time"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/organization"
)
// OrganizationCreate is the builder for creating a Organization entity.
type OrganizationCreate struct {
config
mutation *OrganizationMutation
hooks []Hook
conflict []sql.ConflictOption
}
// SetCreatedAt sets the "created_at" field.
func (oc *OrganizationCreate) SetCreatedAt(t time.Time) *OrganizationCreate {
oc.mutation.SetCreatedAt(t)
return oc
}
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (oc *OrganizationCreate) SetNillableCreatedAt(t *time.Time) *OrganizationCreate {
if t != nil {
oc.SetCreatedAt(*t)
}
return oc
}
// SetUpdatedAt sets the "updated_at" field.
func (oc *OrganizationCreate) SetUpdatedAt(t time.Time) *OrganizationCreate {
oc.mutation.SetUpdatedAt(t)
return oc
}
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (oc *OrganizationCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationCreate {
if t != nil {
oc.SetUpdatedAt(*t)
}
return oc
}
// SetName sets the "name" field.
func (oc *OrganizationCreate) SetName(s string) *OrganizationCreate {
oc.mutation.SetName(s)
return oc
}
// SetDisplayName sets the "display_name" field.
func (oc *OrganizationCreate) SetDisplayName(s string) *OrganizationCreate {
oc.mutation.SetDisplayName(s)
return oc
}
// SetID sets the "id" field.
func (oc *OrganizationCreate) SetID(u uuid.UUID) *OrganizationCreate {
oc.mutation.SetID(u)
return oc
}
// SetNillableID sets the "id" field if the given value is not nil.
func (oc *OrganizationCreate) SetNillableID(u *uuid.UUID) *OrganizationCreate {
if u != nil {
oc.SetID(*u)
}
return oc
}
// Mutation returns the OrganizationMutation object of the builder.
func (oc *OrganizationCreate) Mutation() *OrganizationMutation {
return oc.mutation
}
// Save creates the Organization in the database.
func (oc *OrganizationCreate) Save(ctx context.Context) (*Organization, error) {
oc.defaults()
return withHooks(ctx, oc.sqlSave, oc.mutation, oc.hooks)
}
// SaveX calls Save and panics if Save returns an error.
func (oc *OrganizationCreate) SaveX(ctx context.Context) *Organization {
v, err := oc.Save(ctx)
if err != nil {
panic(err)
}
return v
}
// Exec executes the query.
func (oc *OrganizationCreate) Exec(ctx context.Context) error {
_, err := oc.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (oc *OrganizationCreate) ExecX(ctx context.Context) {
if err := oc.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (oc *OrganizationCreate) defaults() {
if _, ok := oc.mutation.CreatedAt(); !ok {
v := organization.DefaultCreatedAt()
oc.mutation.SetCreatedAt(v)
}
if _, ok := oc.mutation.UpdatedAt(); !ok {
v := organization.DefaultUpdatedAt()
oc.mutation.SetUpdatedAt(v)
}
if _, ok := oc.mutation.ID(); !ok {
v := organization.DefaultID()
oc.mutation.SetID(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (oc *OrganizationCreate) check() error {
if _, ok := oc.mutation.CreatedAt(); !ok {
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Organization.created_at"`)}
}
if _, ok := oc.mutation.UpdatedAt(); !ok {
return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Organization.updated_at"`)}
}
if _, ok := oc.mutation.Name(); !ok {
return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Organization.name"`)}
}
if v, ok := oc.mutation.Name(); ok {
if err := organization.NameValidator(v); err != nil {
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)}
}
}
if _, ok := oc.mutation.DisplayName(); !ok {
return &ValidationError{Name: "display_name", err: errors.New(`ent: missing required field "Organization.display_name"`)}
}
return nil
}
func (oc *OrganizationCreate) sqlSave(ctx context.Context) (*Organization, error) {
if err := oc.check(); err != nil {
return nil, err
}
_node, _spec := oc.createSpec()
if err := sqlgraph.CreateNode(ctx, oc.driver, _spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
if _spec.ID.Value != nil {
if id, ok := _spec.ID.Value.(*uuid.UUID); ok {
_node.ID = *id
} else if err := _node.ID.Scan(_spec.ID.Value); err != nil {
return nil, err
}
}
oc.mutation.id = &_node.ID
oc.mutation.done = true
return _node, nil
}
func (oc *OrganizationCreate) createSpec() (*Organization, *sqlgraph.CreateSpec) {
var (
_node = &Organization{config: oc.config}
_spec = sqlgraph.NewCreateSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUUID))
)
_spec.OnConflict = oc.conflict
if id, ok := oc.mutation.ID(); ok {
_node.ID = id
_spec.ID.Value = &id
}
if value, ok := oc.mutation.CreatedAt(); ok {
_spec.SetField(organization.FieldCreatedAt, field.TypeTime, value)
_node.CreatedAt = value
}
if value, ok := oc.mutation.UpdatedAt(); ok {
_spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value)
_node.UpdatedAt = value
}
if value, ok := oc.mutation.Name(); ok {
_spec.SetField(organization.FieldName, field.TypeString, value)
_node.Name = value
}
if value, ok := oc.mutation.DisplayName(); ok {
_spec.SetField(organization.FieldDisplayName, field.TypeString, value)
_node.DisplayName = value
}
return _node, _spec
}
// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
// client.Organization.Create().
// SetCreatedAt(v).
// OnConflict(
// // Update the row with the new values
// // the was proposed for insertion.
// sql.ResolveWithNewValues(),
// ).
// // Override some of the fields with custom
// // update values.
// Update(func(u *ent.OrganizationUpsert) {
// SetCreatedAt(v+v).
// }).
// Exec(ctx)
func (oc *OrganizationCreate) OnConflict(opts ...sql.ConflictOption) *OrganizationUpsertOne {
oc.conflict = opts
return &OrganizationUpsertOne{
create: oc,
}
}
// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(sql.ConflictColumns(columns...)).
// Exec(ctx)
func (oc *OrganizationCreate) OnConflictColumns(columns ...string) *OrganizationUpsertOne {
oc.conflict = append(oc.conflict, sql.ConflictColumns(columns...))
return &OrganizationUpsertOne{
create: oc,
}
}
type (
// OrganizationUpsertOne is the builder for "upsert"-ing
// one Organization node.
OrganizationUpsertOne struct {
create *OrganizationCreate
}
// OrganizationUpsert is the "OnConflict" setter.
OrganizationUpsert struct {
*sql.UpdateSet
}
)
// SetUpdatedAt sets the "updated_at" field.
func (u *OrganizationUpsert) SetUpdatedAt(v time.Time) *OrganizationUpsert {
u.Set(organization.FieldUpdatedAt, v)
return u
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *OrganizationUpsert) UpdateUpdatedAt() *OrganizationUpsert {
u.SetExcluded(organization.FieldUpdatedAt)
return u
}
// SetName sets the "name" field.
func (u *OrganizationUpsert) SetName(v string) *OrganizationUpsert {
u.Set(organization.FieldName, v)
return u
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *OrganizationUpsert) UpdateName() *OrganizationUpsert {
u.SetExcluded(organization.FieldName)
return u
}
// SetDisplayName sets the "display_name" field.
func (u *OrganizationUpsert) SetDisplayName(v string) *OrganizationUpsert {
u.Set(organization.FieldDisplayName, v)
return u
}
// UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (u *OrganizationUpsert) UpdateDisplayName() *OrganizationUpsert {
u.SetExcluded(organization.FieldDisplayName)
return u
}
// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
// Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(
// sql.ResolveWithNewValues(),
// sql.ResolveWith(func(u *sql.UpdateSet) {
// u.SetIgnore(organization.FieldID)
// }),
// ).
// Exec(ctx)
func (u *OrganizationUpsertOne) UpdateNewValues() *OrganizationUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
if _, exists := u.create.mutation.ID(); exists {
s.SetIgnore(organization.FieldID)
}
if _, exists := u.create.mutation.CreatedAt(); exists {
s.SetIgnore(organization.FieldCreatedAt)
}
}))
return u
}
// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(sql.ResolveWithIgnore()).
// Exec(ctx)
func (u *OrganizationUpsertOne) Ignore() *OrganizationUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
return u
}
// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *OrganizationUpsertOne) DoNothing() *OrganizationUpsertOne {
u.create.conflict = append(u.create.conflict, sql.DoNothing())
return u
}
// Update allows overriding fields `UPDATE` values. See the OrganizationCreate.OnConflict
// documentation for more info.
func (u *OrganizationUpsertOne) Update(set func(*OrganizationUpsert)) *OrganizationUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
set(&OrganizationUpsert{UpdateSet: update})
}))
return u
}
// SetUpdatedAt sets the "updated_at" field.
func (u *OrganizationUpsertOne) SetUpdatedAt(v time.Time) *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.SetUpdatedAt(v)
})
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *OrganizationUpsertOne) UpdateUpdatedAt() *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateUpdatedAt()
})
}
// SetName sets the "name" field.
func (u *OrganizationUpsertOne) SetName(v string) *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.SetName(v)
})
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *OrganizationUpsertOne) UpdateName() *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateName()
})
}
// SetDisplayName sets the "display_name" field.
func (u *OrganizationUpsertOne) SetDisplayName(v string) *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.SetDisplayName(v)
})
}
// UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (u *OrganizationUpsertOne) UpdateDisplayName() *OrganizationUpsertOne {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateDisplayName()
})
}
// Exec executes the query.
func (u *OrganizationUpsertOne) Exec(ctx context.Context) error {
if len(u.create.conflict) == 0 {
return errors.New("ent: missing options for OrganizationCreate.OnConflict")
}
return u.create.Exec(ctx)
}
// ExecX is like Exec, but panics if an error occurs.
func (u *OrganizationUpsertOne) ExecX(ctx context.Context) {
if err := u.create.Exec(ctx); err != nil {
panic(err)
}
}
// Exec executes the UPSERT query and returns the inserted/updated ID.
func (u *OrganizationUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error) {
if u.create.driver.Dialect() == dialect.MySQL {
// In case of "ON CONFLICT", there is no way to get back non-numeric ID
// fields from the database since MySQL does not support the RETURNING clause.
return id, errors.New("ent: OrganizationUpsertOne.ID is not supported by MySQL driver. Use OrganizationUpsertOne.Exec instead")
}
node, err := u.create.Save(ctx)
if err != nil {
return id, err
}
return node.ID, nil
}
// IDX is like ID, but panics if an error occurs.
func (u *OrganizationUpsertOne) IDX(ctx context.Context) uuid.UUID {
id, err := u.ID(ctx)
if err != nil {
panic(err)
}
return id
}
// OrganizationCreateBulk is the builder for creating many Organization entities in bulk.
type OrganizationCreateBulk struct {
config
err error
builders []*OrganizationCreate
conflict []sql.ConflictOption
}
// Save creates the Organization entities in the database.
func (ocb *OrganizationCreateBulk) Save(ctx context.Context) ([]*Organization, error) {
if ocb.err != nil {
return nil, ocb.err
}
specs := make([]*sqlgraph.CreateSpec, len(ocb.builders))
nodes := make([]*Organization, len(ocb.builders))
mutators := make([]Mutator, len(ocb.builders))
for i := range ocb.builders {
func(i int, root context.Context) {
builder := ocb.builders[i]
builder.defaults()
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
mutation, ok := m.(*OrganizationMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T", m)
}
if err := builder.check(); err != nil {
return nil, err
}
builder.mutation = mutation
var err error
nodes[i], specs[i] = builder.createSpec()
if i < len(mutators)-1 {
_, err = mutators[i+1].Mutate(root, ocb.builders[i+1].mutation)
} else {
spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
spec.OnConflict = ocb.conflict
// Invoke the actual operation on the latest mutation in the chain.
if err = sqlgraph.BatchCreate(ctx, ocb.driver, spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
}
}
if err != nil {
return nil, err
}
mutation.id = &nodes[i].ID
mutation.done = true
return nodes[i], nil
})
for i := len(builder.hooks) - 1; i >= 0; i-- {
mut = builder.hooks[i](mut)
}
mutators[i] = mut
}(i, ctx)
}
if len(mutators) > 0 {
if _, err := mutators[0].Mutate(ctx, ocb.builders[0].mutation); err != nil {
return nil, err
}
}
return nodes, nil
}
// SaveX is like Save, but panics if an error occurs.
func (ocb *OrganizationCreateBulk) SaveX(ctx context.Context) []*Organization {
v, err := ocb.Save(ctx)
if err != nil {
panic(err)
}
return v
}
// Exec executes the query.
func (ocb *OrganizationCreateBulk) Exec(ctx context.Context) error {
_, err := ocb.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (ocb *OrganizationCreateBulk) ExecX(ctx context.Context) {
if err := ocb.Exec(ctx); err != nil {
panic(err)
}
}
// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
// client.Organization.CreateBulk(builders...).
// OnConflict(
// // Update the row with the new values
// // the was proposed for insertion.
// sql.ResolveWithNewValues(),
// ).
// // Override some of the fields with custom
// // update values.
// Update(func(u *ent.OrganizationUpsert) {
// SetCreatedAt(v+v).
// }).
// Exec(ctx)
func (ocb *OrganizationCreateBulk) OnConflict(opts ...sql.ConflictOption) *OrganizationUpsertBulk {
ocb.conflict = opts
return &OrganizationUpsertBulk{
create: ocb,
}
}
// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(sql.ConflictColumns(columns...)).
// Exec(ctx)
func (ocb *OrganizationCreateBulk) OnConflictColumns(columns ...string) *OrganizationUpsertBulk {
ocb.conflict = append(ocb.conflict, sql.ConflictColumns(columns...))
return &OrganizationUpsertBulk{
create: ocb,
}
}
// OrganizationUpsertBulk is the builder for "upsert"-ing
// a bulk of Organization nodes.
type OrganizationUpsertBulk struct {
create *OrganizationCreateBulk
}
// UpdateNewValues updates the mutable fields using the new values that
// were set on create. Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(
// sql.ResolveWithNewValues(),
// sql.ResolveWith(func(u *sql.UpdateSet) {
// u.SetIgnore(organization.FieldID)
// }),
// ).
// Exec(ctx)
func (u *OrganizationUpsertBulk) UpdateNewValues() *OrganizationUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
for _, b := range u.create.builders {
if _, exists := b.mutation.ID(); exists {
s.SetIgnore(organization.FieldID)
}
if _, exists := b.mutation.CreatedAt(); exists {
s.SetIgnore(organization.FieldCreatedAt)
}
}
}))
return u
}
// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
// client.Organization.Create().
// OnConflict(sql.ResolveWithIgnore()).
// Exec(ctx)
func (u *OrganizationUpsertBulk) Ignore() *OrganizationUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
return u
}
// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *OrganizationUpsertBulk) DoNothing() *OrganizationUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.DoNothing())
return u
}
// Update allows overriding fields `UPDATE` values. See the OrganizationCreateBulk.OnConflict
// documentation for more info.
func (u *OrganizationUpsertBulk) Update(set func(*OrganizationUpsert)) *OrganizationUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
set(&OrganizationUpsert{UpdateSet: update})
}))
return u
}
// SetUpdatedAt sets the "updated_at" field.
func (u *OrganizationUpsertBulk) SetUpdatedAt(v time.Time) *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.SetUpdatedAt(v)
})
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *OrganizationUpsertBulk) UpdateUpdatedAt() *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateUpdatedAt()
})
}
// SetName sets the "name" field.
func (u *OrganizationUpsertBulk) SetName(v string) *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.SetName(v)
})
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *OrganizationUpsertBulk) UpdateName() *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateName()
})
}
// SetDisplayName sets the "display_name" field.
func (u *OrganizationUpsertBulk) SetDisplayName(v string) *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.SetDisplayName(v)
})
}
// UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (u *OrganizationUpsertBulk) UpdateDisplayName() *OrganizationUpsertBulk {
return u.Update(func(s *OrganizationUpsert) {
s.UpdateDisplayName()
})
}
// Exec executes the query.
func (u *OrganizationUpsertBulk) Exec(ctx context.Context) error {
if u.create.err != nil {
return u.create.err
}
for i, b := range u.create.builders {
if len(b.conflict) != 0 {
return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the OrganizationCreateBulk instead", i)
}
}
if len(u.create.conflict) == 0 {
return errors.New("ent: missing options for OrganizationCreateBulk.OnConflict")
}
return u.create.Exec(ctx)
}
// ExecX is like Exec, but panics if an error occurs.
func (u *OrganizationUpsertBulk) ExecX(ctx context.Context) {
if err := u.create.Exec(ctx); err != nil {
panic(err)
}
}

View File

@@ -0,0 +1,88 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/predicate"
)
// OrganizationDelete is the builder for deleting a Organization entity.
type OrganizationDelete struct {
config
hooks []Hook
mutation *OrganizationMutation
}
// Where appends a list predicates to the OrganizationDelete builder.
func (od *OrganizationDelete) Where(ps ...predicate.Organization) *OrganizationDelete {
od.mutation.Where(ps...)
return od
}
// Exec executes the deletion query and returns how many vertices were deleted.
func (od *OrganizationDelete) Exec(ctx context.Context) (int, error) {
return withHooks(ctx, od.sqlExec, od.mutation, od.hooks)
}
// ExecX is like Exec, but panics if an error occurs.
func (od *OrganizationDelete) ExecX(ctx context.Context) int {
n, err := od.Exec(ctx)
if err != nil {
panic(err)
}
return n
}
func (od *OrganizationDelete) sqlExec(ctx context.Context) (int, error) {
_spec := sqlgraph.NewDeleteSpec(organization.Table, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUUID))
if ps := od.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
affected, err := sqlgraph.DeleteNodes(ctx, od.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
od.mutation.done = true
return affected, err
}
// OrganizationDeleteOne is the builder for deleting a single Organization entity.
type OrganizationDeleteOne struct {
od *OrganizationDelete
}
// Where appends a list predicates to the OrganizationDelete builder.
func (odo *OrganizationDeleteOne) Where(ps ...predicate.Organization) *OrganizationDeleteOne {
odo.od.mutation.Where(ps...)
return odo
}
// Exec executes the deletion query.
func (odo *OrganizationDeleteOne) Exec(ctx context.Context) error {
n, err := odo.od.Exec(ctx)
switch {
case err != nil:
return err
case n == 0:
return &NotFoundError{organization.Label}
default:
return nil
}
}
// ExecX is like Exec, but panics if an error occurs.
func (odo *OrganizationDeleteOne) ExecX(ctx context.Context) {
if err := odo.Exec(ctx); err != nil {
panic(err)
}
}

View File

@@ -0,0 +1,527 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"fmt"
"math"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/predicate"
)
// OrganizationQuery is the builder for querying Organization entities.
type OrganizationQuery struct {
config
ctx *QueryContext
order []organization.OrderOption
inters []Interceptor
predicates []predicate.Organization
// intermediate query (i.e. traversal path).
sql *sql.Selector
path func(context.Context) (*sql.Selector, error)
}
// Where adds a new predicate for the OrganizationQuery builder.
func (oq *OrganizationQuery) Where(ps ...predicate.Organization) *OrganizationQuery {
oq.predicates = append(oq.predicates, ps...)
return oq
}
// Limit the number of records to be returned by this query.
func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery {
oq.ctx.Limit = &limit
return oq
}
// Offset to start from.
func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery {
oq.ctx.Offset = &offset
return oq
}
// Unique configures the query builder to filter duplicate records on query.
// By default, unique is set to true, and can be disabled using this method.
func (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery {
oq.ctx.Unique = &unique
return oq
}
// Order specifies how the records should be ordered.
func (oq *OrganizationQuery) Order(o ...organization.OrderOption) *OrganizationQuery {
oq.order = append(oq.order, o...)
return oq
}
// First returns the first Organization entity from the query.
// Returns a *NotFoundError when no Organization was found.
func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error) {
nodes, err := oq.Limit(1).All(setContextOp(ctx, oq.ctx, "First"))
if err != nil {
return nil, err
}
if len(nodes) == 0 {
return nil, &NotFoundError{organization.Label}
}
return nodes[0], nil
}
// FirstX is like First, but panics if an error occurs.
func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization {
node, err := oq.First(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return node
}
// FirstID returns the first Organization ID from the query.
// Returns a *NotFoundError when no Organization ID was found.
func (oq *OrganizationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
var ids []uuid.UUID
if ids, err = oq.Limit(1).IDs(setContextOp(ctx, oq.ctx, "FirstID")); err != nil {
return
}
if len(ids) == 0 {
err = &NotFoundError{organization.Label}
return
}
return ids[0], nil
}
// FirstIDX is like FirstID, but panics if an error occurs.
func (oq *OrganizationQuery) FirstIDX(ctx context.Context) uuid.UUID {
id, err := oq.FirstID(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return id
}
// Only returns a single Organization entity found by the query, ensuring it only returns one.
// Returns a *NotSingularError when more than one Organization entity is found.
// Returns a *NotFoundError when no Organization entities are found.
func (oq *OrganizationQuery) Only(ctx context.Context) (*Organization, error) {
nodes, err := oq.Limit(2).All(setContextOp(ctx, oq.ctx, "Only"))
if err != nil {
return nil, err
}
switch len(nodes) {
case 1:
return nodes[0], nil
case 0:
return nil, &NotFoundError{organization.Label}
default:
return nil, &NotSingularError{organization.Label}
}
}
// OnlyX is like Only, but panics if an error occurs.
func (oq *OrganizationQuery) OnlyX(ctx context.Context) *Organization {
node, err := oq.Only(ctx)
if err != nil {
panic(err)
}
return node
}
// OnlyID is like Only, but returns the only Organization ID in the query.
// Returns a *NotSingularError when more than one Organization ID is found.
// Returns a *NotFoundError when no entities are found.
func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) {
var ids []uuid.UUID
if ids, err = oq.Limit(2).IDs(setContextOp(ctx, oq.ctx, "OnlyID")); err != nil {
return
}
switch len(ids) {
case 1:
id = ids[0]
case 0:
err = &NotFoundError{organization.Label}
default:
err = &NotSingularError{organization.Label}
}
return
}
// OnlyIDX is like OnlyID, but panics if an error occurs.
func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) uuid.UUID {
id, err := oq.OnlyID(ctx)
if err != nil {
panic(err)
}
return id
}
// All executes the query and returns a list of Organizations.
func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error) {
ctx = setContextOp(ctx, oq.ctx, "All")
if err := oq.prepareQuery(ctx); err != nil {
return nil, err
}
qr := querierAll[[]*Organization, *OrganizationQuery]()
return withInterceptors[[]*Organization](ctx, oq, qr, oq.inters)
}
// AllX is like All, but panics if an error occurs.
func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization {
nodes, err := oq.All(ctx)
if err != nil {
panic(err)
}
return nodes
}
// IDs executes the query and returns a list of Organization IDs.
func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error) {
if oq.ctx.Unique == nil && oq.path != nil {
oq.Unique(true)
}
ctx = setContextOp(ctx, oq.ctx, "IDs")
if err = oq.Select(organization.FieldID).Scan(ctx, &ids); err != nil {
return nil, err
}
return ids, nil
}
// IDsX is like IDs, but panics if an error occurs.
func (oq *OrganizationQuery) IDsX(ctx context.Context) []uuid.UUID {
ids, err := oq.IDs(ctx)
if err != nil {
panic(err)
}
return ids
}
// Count returns the count of the given query.
func (oq *OrganizationQuery) Count(ctx context.Context) (int, error) {
ctx = setContextOp(ctx, oq.ctx, "Count")
if err := oq.prepareQuery(ctx); err != nil {
return 0, err
}
return withInterceptors[int](ctx, oq, querierCount[*OrganizationQuery](), oq.inters)
}
// CountX is like Count, but panics if an error occurs.
func (oq *OrganizationQuery) CountX(ctx context.Context) int {
count, err := oq.Count(ctx)
if err != nil {
panic(err)
}
return count
}
// Exist returns true if the query has elements in the graph.
func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error) {
ctx = setContextOp(ctx, oq.ctx, "Exist")
switch _, err := oq.FirstID(ctx); {
case IsNotFound(err):
return false, nil
case err != nil:
return false, fmt.Errorf("ent: check existence: %w", err)
default:
return true, nil
}
}
// ExistX is like Exist, but panics if an error occurs.
func (oq *OrganizationQuery) ExistX(ctx context.Context) bool {
exist, err := oq.Exist(ctx)
if err != nil {
panic(err)
}
return exist
}
// Clone returns a duplicate of the OrganizationQuery builder, including all associated steps. It can be
// used to prepare common query builders and use them differently after the clone is made.
func (oq *OrganizationQuery) Clone() *OrganizationQuery {
if oq == nil {
return nil
}
return &OrganizationQuery{
config: oq.config,
ctx: oq.ctx.Clone(),
order: append([]organization.OrderOption{}, oq.order...),
inters: append([]Interceptor{}, oq.inters...),
predicates: append([]predicate.Organization{}, oq.predicates...),
// clone intermediate query.
sql: oq.sql.Clone(),
path: oq.path,
}
}
// GroupBy is used to group vertices by one or more fields/columns.
// It is often used with aggregate functions, like: count, max, mean, min, sum.
//
// Example:
//
// var v []struct {
// CreatedAt time.Time `json:"created_at,omitempty"`
// Count int `json:"count,omitempty"`
// }
//
// client.Organization.Query().
// GroupBy(organization.FieldCreatedAt).
// Aggregate(ent.Count()).
// Scan(ctx, &v)
func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy {
oq.ctx.Fields = append([]string{field}, fields...)
grbuild := &OrganizationGroupBy{build: oq}
grbuild.flds = &oq.ctx.Fields
grbuild.label = organization.Label
grbuild.scan = grbuild.Scan
return grbuild
}
// Select allows the selection one or more fields/columns for the given query,
// instead of selecting all fields in the entity.
//
// Example:
//
// var v []struct {
// CreatedAt time.Time `json:"created_at,omitempty"`
// }
//
// client.Organization.Query().
// Select(organization.FieldCreatedAt).
// Scan(ctx, &v)
func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect {
oq.ctx.Fields = append(oq.ctx.Fields, fields...)
sbuild := &OrganizationSelect{OrganizationQuery: oq}
sbuild.label = organization.Label
sbuild.flds, sbuild.scan = &oq.ctx.Fields, sbuild.Scan
return sbuild
}
// Aggregate returns a OrganizationSelect configured with the given aggregations.
func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect {
return oq.Select().Aggregate(fns...)
}
func (oq *OrganizationQuery) prepareQuery(ctx context.Context) error {
for _, inter := range oq.inters {
if inter == nil {
return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
}
if trv, ok := inter.(Traverser); ok {
if err := trv.Traverse(ctx, oq); err != nil {
return err
}
}
}
for _, f := range oq.ctx.Fields {
if !organization.ValidColumn(f) {
return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
}
}
if oq.path != nil {
prev, err := oq.path(ctx)
if err != nil {
return err
}
oq.sql = prev
}
return nil
}
func (oq *OrganizationQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Organization, error) {
var (
nodes = []*Organization{}
_spec = oq.querySpec()
)
_spec.ScanValues = func(columns []string) ([]any, error) {
return (*Organization).scanValues(nil, columns)
}
_spec.Assign = func(columns []string, values []any) error {
node := &Organization{config: oq.config}
nodes = append(nodes, node)
return node.assignValues(columns, values)
}
for i := range hooks {
hooks[i](ctx, _spec)
}
if err := sqlgraph.QueryNodes(ctx, oq.driver, _spec); err != nil {
return nil, err
}
if len(nodes) == 0 {
return nodes, nil
}
return nodes, nil
}
func (oq *OrganizationQuery) sqlCount(ctx context.Context) (int, error) {
_spec := oq.querySpec()
_spec.Node.Columns = oq.ctx.Fields
if len(oq.ctx.Fields) > 0 {
_spec.Unique = oq.ctx.Unique != nil && *oq.ctx.Unique
}
return sqlgraph.CountNodes(ctx, oq.driver, _spec)
}
func (oq *OrganizationQuery) querySpec() *sqlgraph.QuerySpec {
_spec := sqlgraph.NewQuerySpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUUID))
_spec.From = oq.sql
if unique := oq.ctx.Unique; unique != nil {
_spec.Unique = *unique
} else if oq.path != nil {
_spec.Unique = true
}
if fields := oq.ctx.Fields; len(fields) > 0 {
_spec.Node.Columns = make([]string, 0, len(fields))
_spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID)
for i := range fields {
if fields[i] != organization.FieldID {
_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
}
}
}
if ps := oq.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if limit := oq.ctx.Limit; limit != nil {
_spec.Limit = *limit
}
if offset := oq.ctx.Offset; offset != nil {
_spec.Offset = *offset
}
if ps := oq.order; len(ps) > 0 {
_spec.Order = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
return _spec
}
func (oq *OrganizationQuery) sqlQuery(ctx context.Context) *sql.Selector {
builder := sql.Dialect(oq.driver.Dialect())
t1 := builder.Table(organization.Table)
columns := oq.ctx.Fields
if len(columns) == 0 {
columns = organization.Columns
}
selector := builder.Select(t1.Columns(columns...)...).From(t1)
if oq.sql != nil {
selector = oq.sql
selector.Select(selector.Columns(columns...)...)
}
if oq.ctx.Unique != nil && *oq.ctx.Unique {
selector.Distinct()
}
for _, p := range oq.predicates {
p(selector)
}
for _, p := range oq.order {
p(selector)
}
if offset := oq.ctx.Offset; offset != nil {
// limit is mandatory for offset clause. We start
// with default value, and override it below if needed.
selector.Offset(*offset).Limit(math.MaxInt32)
}
if limit := oq.ctx.Limit; limit != nil {
selector.Limit(*limit)
}
return selector
}
// OrganizationGroupBy is the group-by builder for Organization entities.
type OrganizationGroupBy struct {
selector
build *OrganizationQuery
}
// Aggregate adds the given aggregation functions to the group-by query.
func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy {
ogb.fns = append(ogb.fns, fns...)
return ogb
}
// Scan applies the selector query and scans the result into the given value.
func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, ogb.build.ctx, "GroupBy")
if err := ogb.build.prepareQuery(ctx); err != nil {
return err
}
return scanWithInterceptors[*OrganizationQuery, *OrganizationGroupBy](ctx, ogb.build, ogb, ogb.build.inters, v)
}
func (ogb *OrganizationGroupBy) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error {
selector := root.sqlQuery(ctx).Select()
aggregation := make([]string, 0, len(ogb.fns))
for _, fn := range ogb.fns {
aggregation = append(aggregation, fn(selector))
}
if len(selector.SelectedColumns()) == 0 {
columns := make([]string, 0, len(*ogb.flds)+len(ogb.fns))
for _, f := range *ogb.flds {
columns = append(columns, selector.C(f))
}
columns = append(columns, aggregation...)
selector.Select(columns...)
}
selector.GroupBy(selector.Columns(*ogb.flds...)...)
if err := selector.Err(); err != nil {
return err
}
rows := &sql.Rows{}
query, args := selector.Query()
if err := ogb.build.driver.Query(ctx, query, args, rows); err != nil {
return err
}
defer rows.Close()
return sql.ScanSlice(rows, v)
}
// OrganizationSelect is the builder for selecting fields of Organization entities.
type OrganizationSelect struct {
*OrganizationQuery
selector
}
// Aggregate adds the given aggregation functions to the selector query.
func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect {
os.fns = append(os.fns, fns...)
return os
}
// Scan applies the selector query and scans the result into the given value.
func (os *OrganizationSelect) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, os.ctx, "Select")
if err := os.prepareQuery(ctx); err != nil {
return err
}
return scanWithInterceptors[*OrganizationQuery, *OrganizationSelect](ctx, os.OrganizationQuery, os, os.inters, v)
}
func (os *OrganizationSelect) sqlScan(ctx context.Context, root *OrganizationQuery, v any) error {
selector := root.sqlQuery(ctx)
aggregation := make([]string, 0, len(os.fns))
for _, fn := range os.fns {
aggregation = append(aggregation, fn(selector))
}
switch n := len(*os.selector.flds); {
case n == 0 && len(aggregation) > 0:
selector.Select(aggregation...)
case n != 0 && len(aggregation) > 0:
selector.AppendSelect(aggregation...)
}
rows := &sql.Rows{}
query, args := selector.Query()
if err := os.driver.Query(ctx, query, args, rows); err != nil {
return err
}
defer rows.Close()
return sql.ScanSlice(rows, v)
}

View File

@@ -0,0 +1,306 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/predicate"
)
// OrganizationUpdate is the builder for updating Organization entities.
type OrganizationUpdate struct {
config
hooks []Hook
mutation *OrganizationMutation
}
// Where appends a list predicates to the OrganizationUpdate builder.
func (ou *OrganizationUpdate) Where(ps ...predicate.Organization) *OrganizationUpdate {
ou.mutation.Where(ps...)
return ou
}
// SetUpdatedAt sets the "updated_at" field.
func (ou *OrganizationUpdate) SetUpdatedAt(t time.Time) *OrganizationUpdate {
ou.mutation.SetUpdatedAt(t)
return ou
}
// SetName sets the "name" field.
func (ou *OrganizationUpdate) SetName(s string) *OrganizationUpdate {
ou.mutation.SetName(s)
return ou
}
// SetNillableName sets the "name" field if the given value is not nil.
func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate {
if s != nil {
ou.SetName(*s)
}
return ou
}
// SetDisplayName sets the "display_name" field.
func (ou *OrganizationUpdate) SetDisplayName(s string) *OrganizationUpdate {
ou.mutation.SetDisplayName(s)
return ou
}
// SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (ou *OrganizationUpdate) SetNillableDisplayName(s *string) *OrganizationUpdate {
if s != nil {
ou.SetDisplayName(*s)
}
return ou
}
// Mutation returns the OrganizationMutation object of the builder.
func (ou *OrganizationUpdate) Mutation() *OrganizationMutation {
return ou.mutation
}
// Save executes the query and returns the number of nodes affected by the update operation.
func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error) {
ou.defaults()
return withHooks(ctx, ou.sqlSave, ou.mutation, ou.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (ou *OrganizationUpdate) SaveX(ctx context.Context) int {
affected, err := ou.Save(ctx)
if err != nil {
panic(err)
}
return affected
}
// Exec executes the query.
func (ou *OrganizationUpdate) Exec(ctx context.Context) error {
_, err := ou.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (ou *OrganizationUpdate) ExecX(ctx context.Context) {
if err := ou.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (ou *OrganizationUpdate) defaults() {
if _, ok := ou.mutation.UpdatedAt(); !ok {
v := organization.UpdateDefaultUpdatedAt()
ou.mutation.SetUpdatedAt(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (ou *OrganizationUpdate) check() error {
if v, ok := ou.mutation.Name(); ok {
if err := organization.NameValidator(v); err != nil {
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)}
}
}
return nil
}
func (ou *OrganizationUpdate) sqlSave(ctx context.Context) (n int, err error) {
if err := ou.check(); err != nil {
return n, err
}
_spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUUID))
if ps := ou.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := ou.mutation.UpdatedAt(); ok {
_spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value)
}
if value, ok := ou.mutation.Name(); ok {
_spec.SetField(organization.FieldName, field.TypeString, value)
}
if value, ok := ou.mutation.DisplayName(); ok {
_spec.SetField(organization.FieldDisplayName, field.TypeString, value)
}
if n, err = sqlgraph.UpdateNodes(ctx, ou.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{organization.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
ou.mutation.done = true
return n, nil
}
// OrganizationUpdateOne is the builder for updating a single Organization entity.
type OrganizationUpdateOne struct {
config
fields []string
hooks []Hook
mutation *OrganizationMutation
}
// SetUpdatedAt sets the "updated_at" field.
func (ouo *OrganizationUpdateOne) SetUpdatedAt(t time.Time) *OrganizationUpdateOne {
ouo.mutation.SetUpdatedAt(t)
return ouo
}
// SetName sets the "name" field.
func (ouo *OrganizationUpdateOne) SetName(s string) *OrganizationUpdateOne {
ouo.mutation.SetName(s)
return ouo
}
// SetNillableName sets the "name" field if the given value is not nil.
func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne {
if s != nil {
ouo.SetName(*s)
}
return ouo
}
// SetDisplayName sets the "display_name" field.
func (ouo *OrganizationUpdateOne) SetDisplayName(s string) *OrganizationUpdateOne {
ouo.mutation.SetDisplayName(s)
return ouo
}
// SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (ouo *OrganizationUpdateOne) SetNillableDisplayName(s *string) *OrganizationUpdateOne {
if s != nil {
ouo.SetDisplayName(*s)
}
return ouo
}
// Mutation returns the OrganizationMutation object of the builder.
func (ouo *OrganizationUpdateOne) Mutation() *OrganizationMutation {
return ouo.mutation
}
// Where appends a list predicates to the OrganizationUpdate builder.
func (ouo *OrganizationUpdateOne) Where(ps ...predicate.Organization) *OrganizationUpdateOne {
ouo.mutation.Where(ps...)
return ouo
}
// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne {
ouo.fields = append([]string{field}, fields...)
return ouo
}
// Save executes the query and returns the updated Organization entity.
func (ouo *OrganizationUpdateOne) Save(ctx context.Context) (*Organization, error) {
ouo.defaults()
return withHooks(ctx, ouo.sqlSave, ouo.mutation, ouo.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (ouo *OrganizationUpdateOne) SaveX(ctx context.Context) *Organization {
node, err := ouo.Save(ctx)
if err != nil {
panic(err)
}
return node
}
// Exec executes the query on the entity.
func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error {
_, err := ouo.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context) {
if err := ouo.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (ouo *OrganizationUpdateOne) defaults() {
if _, ok := ouo.mutation.UpdatedAt(); !ok {
v := organization.UpdateDefaultUpdatedAt()
ouo.mutation.SetUpdatedAt(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (ouo *OrganizationUpdateOne) check() error {
if v, ok := ouo.mutation.Name(); ok {
if err := organization.NameValidator(v); err != nil {
return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Organization.name": %w`, err)}
}
}
return nil
}
func (ouo *OrganizationUpdateOne) sqlSave(ctx context.Context) (_node *Organization, err error) {
if err := ouo.check(); err != nil {
return _node, err
}
_spec := sqlgraph.NewUpdateSpec(organization.Table, organization.Columns, sqlgraph.NewFieldSpec(organization.FieldID, field.TypeUUID))
id, ok := ouo.mutation.ID()
if !ok {
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Organization.id" for update`)}
}
_spec.Node.ID.Value = id
if fields := ouo.fields; len(fields) > 0 {
_spec.Node.Columns = make([]string, 0, len(fields))
_spec.Node.Columns = append(_spec.Node.Columns, organization.FieldID)
for _, f := range fields {
if !organization.ValidColumn(f) {
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
}
if f != organization.FieldID {
_spec.Node.Columns = append(_spec.Node.Columns, f)
}
}
}
if ps := ouo.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := ouo.mutation.UpdatedAt(); ok {
_spec.SetField(organization.FieldUpdatedAt, field.TypeTime, value)
}
if value, ok := ouo.mutation.Name(); ok {
_spec.SetField(organization.FieldName, field.TypeString, value)
}
if value, ok := ouo.mutation.DisplayName(); ok {
_spec.SetField(organization.FieldDisplayName, field.TypeString, value)
}
_node = &Organization{config: ouo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues
if err = sqlgraph.UpdateNode(ctx, ouo.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{organization.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
ouo.mutation.done = true
return _node, nil
}

View File

@@ -6,8 +6,8 @@ import (
"entgo.io/ent/dialect/sql"
)
// Organization is the predicate function for organization builders.
type Organization func(*sql.Selector)
// User is the predicate function for user builders.
type User func(*sql.Selector)
// UserIdentity is the predicate function for useridentity builders.
type UserIdentity func(*sql.Selector)

View File

@@ -6,15 +6,40 @@ import (
"time"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/organization"
"github.com/holos-run/holos/internal/ent/schema"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
organizationMixin := schema.Organization{}.Mixin()
organizationMixinFields0 := organizationMixin[0].Fields()
_ = organizationMixinFields0
organizationMixinFields1 := organizationMixin[1].Fields()
_ = organizationMixinFields1
organizationFields := schema.Organization{}.Fields()
_ = organizationFields
// organizationDescCreatedAt is the schema descriptor for created_at field.
organizationDescCreatedAt := organizationMixinFields1[0].Descriptor()
// organization.DefaultCreatedAt holds the default value on creation for the created_at field.
organization.DefaultCreatedAt = organizationDescCreatedAt.Default.(func() time.Time)
// organizationDescUpdatedAt is the schema descriptor for updated_at field.
organizationDescUpdatedAt := organizationMixinFields1[1].Descriptor()
// organization.DefaultUpdatedAt holds the default value on creation for the updated_at field.
organization.DefaultUpdatedAt = organizationDescUpdatedAt.Default.(func() time.Time)
// organization.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
organization.UpdateDefaultUpdatedAt = organizationDescUpdatedAt.UpdateDefault.(func() time.Time)
// organizationDescName is the schema descriptor for name field.
organizationDescName := organizationFields[0].Descriptor()
// organization.NameValidator is a validator for the "name" field. It is called by the builders before save.
organization.NameValidator = organizationDescName.Validators[0].(func(string) error)
// organizationDescID is the schema descriptor for id field.
organizationDescID := organizationMixinFields0[0].Descriptor()
// organization.DefaultID holds the default value on creation for the id field.
organization.DefaultID = organizationDescID.Default.(func() uuid.UUID)
userMixin := schema.User{}.Mixin()
userMixinFields0 := userMixin[0].Fields()
_ = userMixinFields0
@@ -36,49 +61,8 @@ func init() {
userDescEmail := userFields[0].Descriptor()
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
// userDescEmailVerified is the schema descriptor for email_verified field.
userDescEmailVerified := userFields[1].Descriptor()
// user.DefaultEmailVerified holds the default value on creation for the email_verified field.
user.DefaultEmailVerified = userDescEmailVerified.Default.(bool)
// userDescID is the schema descriptor for id field.
userDescID := userMixinFields0[0].Descriptor()
// user.DefaultID holds the default value on creation for the id field.
user.DefaultID = userDescID.Default.(func() uuid.UUID)
useridentityMixin := schema.UserIdentity{}.Mixin()
useridentityMixinFields0 := useridentityMixin[0].Fields()
_ = useridentityMixinFields0
useridentityMixinFields1 := useridentityMixin[1].Fields()
_ = useridentityMixinFields1
useridentityFields := schema.UserIdentity{}.Fields()
_ = useridentityFields
// useridentityDescCreatedAt is the schema descriptor for created_at field.
useridentityDescCreatedAt := useridentityMixinFields1[0].Descriptor()
// useridentity.DefaultCreatedAt holds the default value on creation for the created_at field.
useridentity.DefaultCreatedAt = useridentityDescCreatedAt.Default.(func() time.Time)
// useridentityDescUpdatedAt is the schema descriptor for updated_at field.
useridentityDescUpdatedAt := useridentityMixinFields1[1].Descriptor()
// useridentity.DefaultUpdatedAt holds the default value on creation for the updated_at field.
useridentity.DefaultUpdatedAt = useridentityDescUpdatedAt.Default.(func() time.Time)
// useridentity.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
useridentity.UpdateDefaultUpdatedAt = useridentityDescUpdatedAt.UpdateDefault.(func() time.Time)
// useridentityDescIss is the schema descriptor for iss field.
useridentityDescIss := useridentityFields[0].Descriptor()
// useridentity.IssValidator is a validator for the "iss" field. It is called by the builders before save.
useridentity.IssValidator = useridentityDescIss.Validators[0].(func(string) error)
// useridentityDescSub is the schema descriptor for sub field.
useridentityDescSub := useridentityFields[1].Descriptor()
// useridentity.SubValidator is a validator for the "sub" field. It is called by the builders before save.
useridentity.SubValidator = useridentityDescSub.Validators[0].(func(string) error)
// useridentityDescEmail is the schema descriptor for email field.
useridentityDescEmail := useridentityFields[2].Descriptor()
// useridentity.EmailValidator is a validator for the "email" field. It is called by the builders before save.
useridentity.EmailValidator = useridentityDescEmail.Validators[0].(func(string) error)
// useridentityDescEmailVerified is the schema descriptor for email_verified field.
useridentityDescEmailVerified := useridentityFields[3].Descriptor()
// useridentity.DefaultEmailVerified holds the default value on creation for the email_verified field.
useridentity.DefaultEmailVerified = useridentityDescEmailVerified.Default.(bool)
// useridentityDescID is the schema descriptor for id field.
useridentityDescID := useridentityMixinFields0[0].Descriptor()
// useridentity.DefaultID holds the default value on creation for the id field.
useridentity.DefaultID = useridentityDescID.Default.(func() uuid.UUID)
}

View File

@@ -0,0 +1,27 @@
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
// User holds the schema definition for the User entity, the internal
// representation and identity of a single human user. Users are scoped
// globally.
type Organization struct {
ent.Schema
}
func (Organization) Fields() []ent.Field {
return []ent.Field{
field.String("name").NotEmpty().Unique(),
field.String("display_name"),
}
}
func (Organization) Mixin() []ent.Mixin {
return []ent.Mixin{
BaseMixin{},
TimeMixin{},
}
}

View File

@@ -2,10 +2,7 @@ package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// User holds the schema definition for the User entity, the internal
@@ -26,64 +23,8 @@ func (User) Mixin() []ent.Mixin {
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("email").NotEmpty().Unique(),
field.Bool("email_verified").Default(false),
field.String("iss"),
field.String("sub"),
field.String("name"),
}
}
// Edges of the User.
func (User) Edges() []ent.Edge {
return []ent.Edge{
edge.To("identities", UserIdentity.Type).
StorageKey(edge.Column("user_id")).
Annotations(entsql.OnDelete(entsql.Cascade)),
}
}
// UserIdentity holds the schema definition for the UserIdentity entity, a
// representation of an identity from an oidc provider typically implemented as
// an oidc id token.
type UserIdentity struct {
ent.Schema
}
func (UserIdentity) Mixin() []ent.Mixin {
return []ent.Mixin{
BaseMixin{},
TimeMixin{},
}
}
// Fields of the UserIdentity. Assumes an oidc id token is available for the user with
// the openid scope `iss`, `aud`, `exp`, `iat`, and `at_hash` claims. Assumes
// the profile scope as well, with claims family_name, given_name, middle_name,
// nickname, picture, and updated_at. Claims are defined by the [standard
// claims][1].
//
// [1]: https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
func (UserIdentity) Fields() []ent.Field {
return []ent.Field{
field.String("iss").NotEmpty(),
field.String("sub").NotEmpty(),
field.String("email").NotEmpty(),
field.Bool("email_verified").Default(false),
field.String("name").Optional().Nillable(),
}
}
func (UserIdentity) Indexes() []ent.Index {
return []ent.Index{
index.Fields("iss", "sub").Unique(),
}
}
// Edges of the UserIdentity.
func (UserIdentity) Edges() []ent.Edge {
return []ent.Edge{
edge.From("user", User.Type).
Ref("identities").
Required().
Immutable().
Unique(),
}
}

View File

@@ -12,10 +12,10 @@ import (
// Tx is a transactional client that is created by calling Client.Tx().
type Tx struct {
config
// Organization is the client for interacting with the Organization builders.
Organization *OrganizationClient
// User is the client for interacting with the User builders.
User *UserClient
// UserIdentity is the client for interacting with the UserIdentity builders.
UserIdentity *UserIdentityClient
// lazily loaded.
client *Client
@@ -147,8 +147,8 @@ func (tx *Tx) Client() *Client {
}
func (tx *Tx) init() {
tx.Organization = NewOrganizationClient(tx.config)
tx.User = NewUserClient(tx.config)
tx.UserIdentity = NewUserIdentityClient(tx.config)
}
// txDriver wraps the given dialect.Tx with a nop dialect.Driver implementation.
@@ -158,7 +158,7 @@ func (tx *Tx) init() {
// of them in order to commit or rollback the transaction.
//
// If a closed transaction is embedded in one of the generated entities, and the entity
// applies a query, for example: User.QueryXXX(), the query will be executed
// applies a query, for example: Organization.QueryXXX(), the query will be executed
// through the driver which created this transaction.
//
// Note that txDriver is not goroutine safe.

View File

@@ -24,42 +24,21 @@ type User struct {
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Email holds the value of the "email" field.
Email string `json:"email,omitempty"`
// EmailVerified holds the value of the "email_verified" field.
EmailVerified bool `json:"email_verified,omitempty"`
// Iss holds the value of the "iss" field.
Iss string `json:"iss,omitempty"`
// Sub holds the value of the "sub" field.
Sub string `json:"sub,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the UserQuery when eager-loading is set.
Edges UserEdges `json:"edges"`
Name string `json:"name,omitempty"`
selectValues sql.SelectValues
}
// UserEdges holds the relations/edges for other nodes in the graph.
type UserEdges struct {
// Identities holds the value of the identities edge.
Identities []*UserIdentity `json:"identities,omitempty"`
// loadedTypes holds the information for reporting if a
// type was loaded (or requested) in eager-loading or not.
loadedTypes [1]bool
}
// IdentitiesOrErr returns the Identities value or an error if the edge
// was not loaded in eager-loading.
func (e UserEdges) IdentitiesOrErr() ([]*UserIdentity, error) {
if e.loadedTypes[0] {
return e.Identities, nil
}
return nil, &NotLoadedError{edge: "identities"}
}
// scanValues returns the types for scanning values from sql.Rows.
func (*User) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case user.FieldEmailVerified:
values[i] = new(sql.NullBool)
case user.FieldEmail, user.FieldName:
case user.FieldEmail, user.FieldIss, user.FieldSub, user.FieldName:
values[i] = new(sql.NullString)
case user.FieldCreatedAt, user.FieldUpdatedAt:
values[i] = new(sql.NullTime)
@@ -104,11 +83,17 @@ func (u *User) assignValues(columns []string, values []any) error {
} else if value.Valid {
u.Email = value.String
}
case user.FieldEmailVerified:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field email_verified", values[i])
case user.FieldIss:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field iss", values[i])
} else if value.Valid {
u.EmailVerified = value.Bool
u.Iss = value.String
}
case user.FieldSub:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field sub", values[i])
} else if value.Valid {
u.Sub = value.String
}
case user.FieldName:
if value, ok := values[i].(*sql.NullString); !ok {
@@ -129,11 +114,6 @@ func (u *User) Value(name string) (ent.Value, error) {
return u.selectValues.Get(name)
}
// QueryIdentities queries the "identities" edge of the User entity.
func (u *User) QueryIdentities() *UserIdentityQuery {
return NewUserClient(u.config).QueryIdentities(u)
}
// Update returns a builder for updating this User.
// Note that you need to call User.Unwrap() before calling this method if this User
// was returned from a transaction, and the transaction was committed or rolled back.
@@ -166,8 +146,11 @@ func (u *User) String() string {
builder.WriteString("email=")
builder.WriteString(u.Email)
builder.WriteString(", ")
builder.WriteString("email_verified=")
builder.WriteString(fmt.Sprintf("%v", u.EmailVerified))
builder.WriteString("iss=")
builder.WriteString(u.Iss)
builder.WriteString(", ")
builder.WriteString("sub=")
builder.WriteString(u.Sub)
builder.WriteString(", ")
builder.WriteString("name=")
builder.WriteString(u.Name)

View File

@@ -6,7 +6,6 @@ import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/gofrs/uuid"
)
@@ -21,21 +20,14 @@ const (
FieldUpdatedAt = "updated_at"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldEmailVerified holds the string denoting the email_verified field in the database.
FieldEmailVerified = "email_verified"
// FieldIss holds the string denoting the iss field in the database.
FieldIss = "iss"
// FieldSub holds the string denoting the sub field in the database.
FieldSub = "sub"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// EdgeIdentities holds the string denoting the identities edge name in mutations.
EdgeIdentities = "identities"
// Table holds the table name of the user in the database.
Table = "users"
// IdentitiesTable is the table that holds the identities relation/edge.
IdentitiesTable = "user_identities"
// IdentitiesInverseTable is the table name for the UserIdentity entity.
// It exists in this package in order to avoid circular dependency with the "useridentity" package.
IdentitiesInverseTable = "user_identities"
// IdentitiesColumn is the table column denoting the identities relation/edge.
IdentitiesColumn = "user_id"
)
// Columns holds all SQL columns for user fields.
@@ -44,7 +36,8 @@ var Columns = []string{
FieldCreatedAt,
FieldUpdatedAt,
FieldEmail,
FieldEmailVerified,
FieldIss,
FieldSub,
FieldName,
}
@@ -67,8 +60,6 @@ var (
UpdateDefaultUpdatedAt func() time.Time
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
EmailValidator func(string) error
// DefaultEmailVerified holds the default value on creation for the "email_verified" field.
DefaultEmailVerified bool
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
@@ -96,33 +87,17 @@ func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByEmailVerified orders the results by the email_verified field.
func ByEmailVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmailVerified, opts...).ToFunc()
// ByIss orders the results by the iss field.
func ByIss(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIss, opts...).ToFunc()
}
// BySub orders the results by the sub field.
func BySub(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSub, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByIdentitiesCount orders the results by identities count.
func ByIdentitiesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newIdentitiesStep(), opts...)
}
}
// ByIdentities orders the results by identities terms.
func ByIdentities(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newIdentitiesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newIdentitiesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(IdentitiesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, IdentitiesTable, IdentitiesColumn),
)
}

View File

@@ -6,7 +6,6 @@ import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
)
@@ -71,9 +70,14 @@ func Email(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmail, v))
}
// EmailVerified applies equality check predicate on the "email_verified" field. It's identical to EmailVerifiedEQ.
func EmailVerified(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmailVerified, v))
// Iss applies equality check predicate on the "iss" field. It's identical to IssEQ.
func Iss(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldIss, v))
}
// Sub applies equality check predicate on the "sub" field. It's identical to SubEQ.
func Sub(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldSub, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
@@ -226,14 +230,134 @@ func EmailContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldEmail, v))
}
// EmailVerifiedEQ applies the EQ predicate on the "email_verified" field.
func EmailVerifiedEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldEmailVerified, v))
// IssEQ applies the EQ predicate on the "iss" field.
func IssEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldIss, v))
}
// EmailVerifiedNEQ applies the NEQ predicate on the "email_verified" field.
func EmailVerifiedNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldEmailVerified, v))
// IssNEQ applies the NEQ predicate on the "iss" field.
func IssNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldIss, v))
}
// IssIn applies the In predicate on the "iss" field.
func IssIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldIss, vs...))
}
// IssNotIn applies the NotIn predicate on the "iss" field.
func IssNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldIss, vs...))
}
// IssGT applies the GT predicate on the "iss" field.
func IssGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldIss, v))
}
// IssGTE applies the GTE predicate on the "iss" field.
func IssGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldIss, v))
}
// IssLT applies the LT predicate on the "iss" field.
func IssLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldIss, v))
}
// IssLTE applies the LTE predicate on the "iss" field.
func IssLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldIss, v))
}
// IssContains applies the Contains predicate on the "iss" field.
func IssContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldIss, v))
}
// IssHasPrefix applies the HasPrefix predicate on the "iss" field.
func IssHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldIss, v))
}
// IssHasSuffix applies the HasSuffix predicate on the "iss" field.
func IssHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldIss, v))
}
// IssEqualFold applies the EqualFold predicate on the "iss" field.
func IssEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldIss, v))
}
// IssContainsFold applies the ContainsFold predicate on the "iss" field.
func IssContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldIss, v))
}
// SubEQ applies the EQ predicate on the "sub" field.
func SubEQ(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldSub, v))
}
// SubNEQ applies the NEQ predicate on the "sub" field.
func SubNEQ(v string) predicate.User {
return predicate.User(sql.FieldNEQ(FieldSub, v))
}
// SubIn applies the In predicate on the "sub" field.
func SubIn(vs ...string) predicate.User {
return predicate.User(sql.FieldIn(FieldSub, vs...))
}
// SubNotIn applies the NotIn predicate on the "sub" field.
func SubNotIn(vs ...string) predicate.User {
return predicate.User(sql.FieldNotIn(FieldSub, vs...))
}
// SubGT applies the GT predicate on the "sub" field.
func SubGT(v string) predicate.User {
return predicate.User(sql.FieldGT(FieldSub, v))
}
// SubGTE applies the GTE predicate on the "sub" field.
func SubGTE(v string) predicate.User {
return predicate.User(sql.FieldGTE(FieldSub, v))
}
// SubLT applies the LT predicate on the "sub" field.
func SubLT(v string) predicate.User {
return predicate.User(sql.FieldLT(FieldSub, v))
}
// SubLTE applies the LTE predicate on the "sub" field.
func SubLTE(v string) predicate.User {
return predicate.User(sql.FieldLTE(FieldSub, v))
}
// SubContains applies the Contains predicate on the "sub" field.
func SubContains(v string) predicate.User {
return predicate.User(sql.FieldContains(FieldSub, v))
}
// SubHasPrefix applies the HasPrefix predicate on the "sub" field.
func SubHasPrefix(v string) predicate.User {
return predicate.User(sql.FieldHasPrefix(FieldSub, v))
}
// SubHasSuffix applies the HasSuffix predicate on the "sub" field.
func SubHasSuffix(v string) predicate.User {
return predicate.User(sql.FieldHasSuffix(FieldSub, v))
}
// SubEqualFold applies the EqualFold predicate on the "sub" field.
func SubEqualFold(v string) predicate.User {
return predicate.User(sql.FieldEqualFold(FieldSub, v))
}
// SubContainsFold applies the ContainsFold predicate on the "sub" field.
func SubContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldSub, v))
}
// NameEQ applies the EQ predicate on the "name" field.
@@ -301,29 +425,6 @@ func NameContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldName, v))
}
// HasIdentities applies the HasEdge predicate on the "identities" edge.
func HasIdentities() predicate.User {
return predicate.User(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, IdentitiesTable, IdentitiesColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasIdentitiesWith applies the HasEdge predicate on the "identities" edge with a given conditions (other predicates).
func HasIdentitiesWith(preds ...predicate.UserIdentity) predicate.User {
return predicate.User(func(s *sql.Selector) {
step := newIdentitiesStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.User) predicate.User {
return predicate.User(sql.AndPredicates(predicates...))

View File

@@ -14,7 +14,6 @@ import (
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserCreate is the builder for creating a User entity.
@@ -59,17 +58,15 @@ func (uc *UserCreate) SetEmail(s string) *UserCreate {
return uc
}
// SetEmailVerified sets the "email_verified" field.
func (uc *UserCreate) SetEmailVerified(b bool) *UserCreate {
uc.mutation.SetEmailVerified(b)
// SetIss sets the "iss" field.
func (uc *UserCreate) SetIss(s string) *UserCreate {
uc.mutation.SetIss(s)
return uc
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uc *UserCreate) SetNillableEmailVerified(b *bool) *UserCreate {
if b != nil {
uc.SetEmailVerified(*b)
}
// SetSub sets the "sub" field.
func (uc *UserCreate) SetSub(s string) *UserCreate {
uc.mutation.SetSub(s)
return uc
}
@@ -93,21 +90,6 @@ func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate {
return uc
}
// AddIdentityIDs adds the "identities" edge to the UserIdentity entity by IDs.
func (uc *UserCreate) AddIdentityIDs(ids ...uuid.UUID) *UserCreate {
uc.mutation.AddIdentityIDs(ids...)
return uc
}
// AddIdentities adds the "identities" edges to the UserIdentity entity.
func (uc *UserCreate) AddIdentities(u ...*UserIdentity) *UserCreate {
ids := make([]uuid.UUID, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uc.AddIdentityIDs(ids...)
}
// Mutation returns the UserMutation object of the builder.
func (uc *UserCreate) Mutation() *UserMutation {
return uc.mutation
@@ -151,10 +133,6 @@ func (uc *UserCreate) defaults() {
v := user.DefaultUpdatedAt()
uc.mutation.SetUpdatedAt(v)
}
if _, ok := uc.mutation.EmailVerified(); !ok {
v := user.DefaultEmailVerified
uc.mutation.SetEmailVerified(v)
}
if _, ok := uc.mutation.ID(); !ok {
v := user.DefaultID()
uc.mutation.SetID(v)
@@ -177,8 +155,11 @@ func (uc *UserCreate) check() error {
return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "User.email": %w`, err)}
}
}
if _, ok := uc.mutation.EmailVerified(); !ok {
return &ValidationError{Name: "email_verified", err: errors.New(`ent: missing required field "User.email_verified"`)}
if _, ok := uc.mutation.Iss(); !ok {
return &ValidationError{Name: "iss", err: errors.New(`ent: missing required field "User.iss"`)}
}
if _, ok := uc.mutation.Sub(); !ok {
return &ValidationError{Name: "sub", err: errors.New(`ent: missing required field "User.sub"`)}
}
if _, ok := uc.mutation.Name(); !ok {
return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "User.name"`)}
@@ -231,30 +212,18 @@ func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
_spec.SetField(user.FieldEmail, field.TypeString, value)
_node.Email = value
}
if value, ok := uc.mutation.EmailVerified(); ok {
_spec.SetField(user.FieldEmailVerified, field.TypeBool, value)
_node.EmailVerified = value
if value, ok := uc.mutation.Iss(); ok {
_spec.SetField(user.FieldIss, field.TypeString, value)
_node.Iss = value
}
if value, ok := uc.mutation.Sub(); ok {
_spec.SetField(user.FieldSub, field.TypeString, value)
_node.Sub = value
}
if value, ok := uc.mutation.Name(); ok {
_spec.SetField(user.FieldName, field.TypeString, value)
_node.Name = value
}
if nodes := uc.mutation.IdentitiesIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges = append(_spec.Edges, edge)
}
return _node, _spec
}
@@ -331,15 +300,27 @@ func (u *UserUpsert) UpdateEmail() *UserUpsert {
return u
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserUpsert) SetEmailVerified(v bool) *UserUpsert {
u.Set(user.FieldEmailVerified, v)
// SetIss sets the "iss" field.
func (u *UserUpsert) SetIss(v string) *UserUpsert {
u.Set(user.FieldIss, v)
return u
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserUpsert) UpdateEmailVerified() *UserUpsert {
u.SetExcluded(user.FieldEmailVerified)
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserUpsert) UpdateIss() *UserUpsert {
u.SetExcluded(user.FieldIss)
return u
}
// SetSub sets the "sub" field.
func (u *UserUpsert) SetSub(v string) *UserUpsert {
u.Set(user.FieldSub, v)
return u
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserUpsert) UpdateSub() *UserUpsert {
u.SetExcluded(user.FieldSub)
return u
}
@@ -434,17 +415,31 @@ func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne {
})
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserUpsertOne) SetEmailVerified(v bool) *UserUpsertOne {
// SetIss sets the "iss" field.
func (u *UserUpsertOne) SetIss(v string) *UserUpsertOne {
return u.Update(func(s *UserUpsert) {
s.SetEmailVerified(v)
s.SetIss(v)
})
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserUpsertOne) UpdateEmailVerified() *UserUpsertOne {
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserUpsertOne) UpdateIss() *UserUpsertOne {
return u.Update(func(s *UserUpsert) {
s.UpdateEmailVerified()
s.UpdateIss()
})
}
// SetSub sets the "sub" field.
func (u *UserUpsertOne) SetSub(v string) *UserUpsertOne {
return u.Update(func(s *UserUpsert) {
s.SetSub(v)
})
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserUpsertOne) UpdateSub() *UserUpsertOne {
return u.Update(func(s *UserUpsert) {
s.UpdateSub()
})
}
@@ -708,17 +703,31 @@ func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk {
})
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserUpsertBulk) SetEmailVerified(v bool) *UserUpsertBulk {
// SetIss sets the "iss" field.
func (u *UserUpsertBulk) SetIss(v string) *UserUpsertBulk {
return u.Update(func(s *UserUpsert) {
s.SetEmailVerified(v)
s.SetIss(v)
})
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserUpsertBulk) UpdateEmailVerified() *UserUpsertBulk {
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserUpsertBulk) UpdateIss() *UserUpsertBulk {
return u.Update(func(s *UserUpsert) {
s.UpdateEmailVerified()
s.UpdateIss()
})
}
// SetSub sets the "sub" field.
func (u *UserUpsertBulk) SetSub(v string) *UserUpsertBulk {
return u.Update(func(s *UserUpsert) {
s.SetSub(v)
})
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserUpsertBulk) UpdateSub() *UserUpsertBulk {
return u.Update(func(s *UserUpsert) {
s.UpdateSub()
})
}

View File

@@ -4,7 +4,6 @@ package ent
import (
"context"
"database/sql/driver"
"fmt"
"math"
@@ -14,17 +13,15 @@ import (
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserQuery is the builder for querying User entities.
type UserQuery struct {
config
ctx *QueryContext
order []user.OrderOption
inters []Interceptor
predicates []predicate.User
withIdentities *UserIdentityQuery
ctx *QueryContext
order []user.OrderOption
inters []Interceptor
predicates []predicate.User
// intermediate query (i.e. traversal path).
sql *sql.Selector
path func(context.Context) (*sql.Selector, error)
@@ -61,28 +58,6 @@ func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery {
return uq
}
// QueryIdentities chains the current query on the "identities" edge.
func (uq *UserQuery) QueryIdentities() *UserIdentityQuery {
query := (&UserIdentityClient{config: uq.config}).Query()
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := uq.prepareQuery(ctx); err != nil {
return nil, err
}
selector := uq.sqlQuery(ctx)
if err := selector.Err(); err != nil {
return nil, err
}
step := sqlgraph.NewStep(
sqlgraph.From(user.Table, user.FieldID, selector),
sqlgraph.To(useridentity.Table, useridentity.FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, user.IdentitiesTable, user.IdentitiesColumn),
)
fromU = sqlgraph.SetNeighbors(uq.driver.Dialect(), step)
return fromU, nil
}
return query
}
// First returns the first User entity from the query.
// Returns a *NotFoundError when no User was found.
func (uq *UserQuery) First(ctx context.Context) (*User, error) {
@@ -270,29 +245,17 @@ func (uq *UserQuery) Clone() *UserQuery {
return nil
}
return &UserQuery{
config: uq.config,
ctx: uq.ctx.Clone(),
order: append([]user.OrderOption{}, uq.order...),
inters: append([]Interceptor{}, uq.inters...),
predicates: append([]predicate.User{}, uq.predicates...),
withIdentities: uq.withIdentities.Clone(),
config: uq.config,
ctx: uq.ctx.Clone(),
order: append([]user.OrderOption{}, uq.order...),
inters: append([]Interceptor{}, uq.inters...),
predicates: append([]predicate.User{}, uq.predicates...),
// clone intermediate query.
sql: uq.sql.Clone(),
path: uq.path,
}
}
// WithIdentities tells the query-builder to eager-load the nodes that are connected to
// the "identities" edge. The optional arguments are used to configure the query builder of the edge.
func (uq *UserQuery) WithIdentities(opts ...func(*UserIdentityQuery)) *UserQuery {
query := (&UserIdentityClient{config: uq.config}).Query()
for _, opt := range opts {
opt(query)
}
uq.withIdentities = query
return uq
}
// GroupBy is used to group vertices by one or more fields/columns.
// It is often used with aggregate functions, like: count, max, mean, min, sum.
//
@@ -369,11 +332,8 @@ func (uq *UserQuery) prepareQuery(ctx context.Context) error {
func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, error) {
var (
nodes = []*User{}
_spec = uq.querySpec()
loadedTypes = [1]bool{
uq.withIdentities != nil,
}
nodes = []*User{}
_spec = uq.querySpec()
)
_spec.ScanValues = func(columns []string) ([]any, error) {
return (*User).scanValues(nil, columns)
@@ -381,7 +341,6 @@ func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, e
_spec.Assign = func(columns []string, values []any) error {
node := &User{config: uq.config}
nodes = append(nodes, node)
node.Edges.loadedTypes = loadedTypes
return node.assignValues(columns, values)
}
for i := range hooks {
@@ -393,48 +352,9 @@ func (uq *UserQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*User, e
if len(nodes) == 0 {
return nodes, nil
}
if query := uq.withIdentities; query != nil {
if err := uq.loadIdentities(ctx, query, nodes,
func(n *User) { n.Edges.Identities = []*UserIdentity{} },
func(n *User, e *UserIdentity) { n.Edges.Identities = append(n.Edges.Identities, e) }); err != nil {
return nil, err
}
}
return nodes, nil
}
func (uq *UserQuery) loadIdentities(ctx context.Context, query *UserIdentityQuery, nodes []*User, init func(*User), assign func(*User, *UserIdentity)) error {
fks := make([]driver.Value, 0, len(nodes))
nodeids := make(map[uuid.UUID]*User)
for i := range nodes {
fks = append(fks, nodes[i].ID)
nodeids[nodes[i].ID] = nodes[i]
if init != nil {
init(nodes[i])
}
}
query.withFKs = true
query.Where(predicate.UserIdentity(func(s *sql.Selector) {
s.Where(sql.InValues(s.C(user.IdentitiesColumn), fks...))
}))
neighbors, err := query.All(ctx)
if err != nil {
return err
}
for _, n := range neighbors {
fk := n.user_id
if fk == nil {
return fmt.Errorf(`foreign-key "user_id" is nil for node %v`, n.ID)
}
node, ok := nodeids[*fk]
if !ok {
return fmt.Errorf(`unexpected referenced foreign-key "user_id" returned %v for node %v`, *fk, n.ID)
}
assign(node, n)
}
return nil
}
func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) {
_spec := uq.querySpec()
_spec.Node.Columns = uq.ctx.Fields

View File

@@ -11,10 +11,8 @@ import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserUpdate is the builder for updating User entities.
@@ -50,16 +48,30 @@ func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate {
return uu
}
// SetEmailVerified sets the "email_verified" field.
func (uu *UserUpdate) SetEmailVerified(b bool) *UserUpdate {
uu.mutation.SetEmailVerified(b)
// SetIss sets the "iss" field.
func (uu *UserUpdate) SetIss(s string) *UserUpdate {
uu.mutation.SetIss(s)
return uu
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uu *UserUpdate) SetNillableEmailVerified(b *bool) *UserUpdate {
if b != nil {
uu.SetEmailVerified(*b)
// SetNillableIss sets the "iss" field if the given value is not nil.
func (uu *UserUpdate) SetNillableIss(s *string) *UserUpdate {
if s != nil {
uu.SetIss(*s)
}
return uu
}
// SetSub sets the "sub" field.
func (uu *UserUpdate) SetSub(s string) *UserUpdate {
uu.mutation.SetSub(s)
return uu
}
// SetNillableSub sets the "sub" field if the given value is not nil.
func (uu *UserUpdate) SetNillableSub(s *string) *UserUpdate {
if s != nil {
uu.SetSub(*s)
}
return uu
}
@@ -78,47 +90,11 @@ func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate {
return uu
}
// AddIdentityIDs adds the "identities" edge to the UserIdentity entity by IDs.
func (uu *UserUpdate) AddIdentityIDs(ids ...uuid.UUID) *UserUpdate {
uu.mutation.AddIdentityIDs(ids...)
return uu
}
// AddIdentities adds the "identities" edges to the UserIdentity entity.
func (uu *UserUpdate) AddIdentities(u ...*UserIdentity) *UserUpdate {
ids := make([]uuid.UUID, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uu.AddIdentityIDs(ids...)
}
// Mutation returns the UserMutation object of the builder.
func (uu *UserUpdate) Mutation() *UserMutation {
return uu.mutation
}
// ClearIdentities clears all "identities" edges to the UserIdentity entity.
func (uu *UserUpdate) ClearIdentities() *UserUpdate {
uu.mutation.ClearIdentities()
return uu
}
// RemoveIdentityIDs removes the "identities" edge to UserIdentity entities by IDs.
func (uu *UserUpdate) RemoveIdentityIDs(ids ...uuid.UUID) *UserUpdate {
uu.mutation.RemoveIdentityIDs(ids...)
return uu
}
// RemoveIdentities removes "identities" edges to UserIdentity entities.
func (uu *UserUpdate) RemoveIdentities(u ...*UserIdentity) *UserUpdate {
ids := make([]uuid.UUID, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uu.RemoveIdentityIDs(ids...)
}
// Save executes the query and returns the number of nodes affected by the update operation.
func (uu *UserUpdate) Save(ctx context.Context) (int, error) {
uu.defaults()
@@ -183,57 +159,15 @@ func (uu *UserUpdate) sqlSave(ctx context.Context) (n int, err error) {
if value, ok := uu.mutation.Email(); ok {
_spec.SetField(user.FieldEmail, field.TypeString, value)
}
if value, ok := uu.mutation.EmailVerified(); ok {
_spec.SetField(user.FieldEmailVerified, field.TypeBool, value)
if value, ok := uu.mutation.Iss(); ok {
_spec.SetField(user.FieldIss, field.TypeString, value)
}
if value, ok := uu.mutation.Sub(); ok {
_spec.SetField(user.FieldSub, field.TypeString, value)
}
if value, ok := uu.mutation.Name(); ok {
_spec.SetField(user.FieldName, field.TypeString, value)
}
if uu.mutation.IdentitiesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.RemovedIdentitiesIDs(); len(nodes) > 0 && !uu.mutation.IdentitiesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uu.mutation.IdentitiesIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
if n, err = sqlgraph.UpdateNodes(ctx, uu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{user.Label}
@@ -274,16 +208,30 @@ func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne {
return uuo
}
// SetEmailVerified sets the "email_verified" field.
func (uuo *UserUpdateOne) SetEmailVerified(b bool) *UserUpdateOne {
uuo.mutation.SetEmailVerified(b)
// SetIss sets the "iss" field.
func (uuo *UserUpdateOne) SetIss(s string) *UserUpdateOne {
uuo.mutation.SetIss(s)
return uuo
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableEmailVerified(b *bool) *UserUpdateOne {
if b != nil {
uuo.SetEmailVerified(*b)
// SetNillableIss sets the "iss" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableIss(s *string) *UserUpdateOne {
if s != nil {
uuo.SetIss(*s)
}
return uuo
}
// SetSub sets the "sub" field.
func (uuo *UserUpdateOne) SetSub(s string) *UserUpdateOne {
uuo.mutation.SetSub(s)
return uuo
}
// SetNillableSub sets the "sub" field if the given value is not nil.
func (uuo *UserUpdateOne) SetNillableSub(s *string) *UserUpdateOne {
if s != nil {
uuo.SetSub(*s)
}
return uuo
}
@@ -302,47 +250,11 @@ func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne {
return uuo
}
// AddIdentityIDs adds the "identities" edge to the UserIdentity entity by IDs.
func (uuo *UserUpdateOne) AddIdentityIDs(ids ...uuid.UUID) *UserUpdateOne {
uuo.mutation.AddIdentityIDs(ids...)
return uuo
}
// AddIdentities adds the "identities" edges to the UserIdentity entity.
func (uuo *UserUpdateOne) AddIdentities(u ...*UserIdentity) *UserUpdateOne {
ids := make([]uuid.UUID, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uuo.AddIdentityIDs(ids...)
}
// Mutation returns the UserMutation object of the builder.
func (uuo *UserUpdateOne) Mutation() *UserMutation {
return uuo.mutation
}
// ClearIdentities clears all "identities" edges to the UserIdentity entity.
func (uuo *UserUpdateOne) ClearIdentities() *UserUpdateOne {
uuo.mutation.ClearIdentities()
return uuo
}
// RemoveIdentityIDs removes the "identities" edge to UserIdentity entities by IDs.
func (uuo *UserUpdateOne) RemoveIdentityIDs(ids ...uuid.UUID) *UserUpdateOne {
uuo.mutation.RemoveIdentityIDs(ids...)
return uuo
}
// RemoveIdentities removes "identities" edges to UserIdentity entities.
func (uuo *UserUpdateOne) RemoveIdentities(u ...*UserIdentity) *UserUpdateOne {
ids := make([]uuid.UUID, len(u))
for i := range u {
ids[i] = u[i].ID
}
return uuo.RemoveIdentityIDs(ids...)
}
// Where appends a list predicates to the UserUpdate builder.
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne {
uuo.mutation.Where(ps...)
@@ -437,57 +349,15 @@ func (uuo *UserUpdateOne) sqlSave(ctx context.Context) (_node *User, err error)
if value, ok := uuo.mutation.Email(); ok {
_spec.SetField(user.FieldEmail, field.TypeString, value)
}
if value, ok := uuo.mutation.EmailVerified(); ok {
_spec.SetField(user.FieldEmailVerified, field.TypeBool, value)
if value, ok := uuo.mutation.Iss(); ok {
_spec.SetField(user.FieldIss, field.TypeString, value)
}
if value, ok := uuo.mutation.Sub(); ok {
_spec.SetField(user.FieldSub, field.TypeString, value)
}
if value, ok := uuo.mutation.Name(); ok {
_spec.SetField(user.FieldName, field.TypeString, value)
}
if uuo.mutation.IdentitiesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.RemovedIdentitiesIDs(); len(nodes) > 0 && !uuo.mutation.IdentitiesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
}
if nodes := uuo.mutation.IdentitiesIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
Inverse: false,
Table: user.IdentitiesTable,
Columns: []string{user.IdentitiesColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_spec.Edges.Add = append(_spec.Edges.Add, edge)
}
_node = &User{config: uuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues

View File

@@ -1,217 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserIdentity is the model entity for the UserIdentity schema.
type UserIdentity struct {
config `json:"-"`
// ID of the ent.
ID uuid.UUID `json:"id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Iss holds the value of the "iss" field.
Iss string `json:"iss,omitempty"`
// Sub holds the value of the "sub" field.
Sub string `json:"sub,omitempty"`
// Email holds the value of the "email" field.
Email string `json:"email,omitempty"`
// EmailVerified holds the value of the "email_verified" field.
EmailVerified bool `json:"email_verified,omitempty"`
// Name holds the value of the "name" field.
Name *string `json:"name,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the UserIdentityQuery when eager-loading is set.
Edges UserIdentityEdges `json:"edges"`
user_id *uuid.UUID
selectValues sql.SelectValues
}
// UserIdentityEdges holds the relations/edges for other nodes in the graph.
type UserIdentityEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// loadedTypes holds the information for reporting if a
// type was loaded (or requested) in eager-loading or not.
loadedTypes [1]bool
}
// UserOrErr returns the User value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e UserIdentityEdges) UserOrErr() (*User, error) {
if e.User != nil {
return e.User, nil
} else if e.loadedTypes[0] {
return nil, &NotFoundError{label: user.Label}
}
return nil, &NotLoadedError{edge: "user"}
}
// scanValues returns the types for scanning values from sql.Rows.
func (*UserIdentity) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case useridentity.FieldEmailVerified:
values[i] = new(sql.NullBool)
case useridentity.FieldIss, useridentity.FieldSub, useridentity.FieldEmail, useridentity.FieldName:
values[i] = new(sql.NullString)
case useridentity.FieldCreatedAt, useridentity.FieldUpdatedAt:
values[i] = new(sql.NullTime)
case useridentity.FieldID:
values[i] = new(uuid.UUID)
case useridentity.ForeignKeys[0]: // user_id
values[i] = &sql.NullScanner{S: new(uuid.UUID)}
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the UserIdentity fields.
func (ui *UserIdentity) assignValues(columns []string, values []any) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case useridentity.FieldID:
if value, ok := values[i].(*uuid.UUID); !ok {
return fmt.Errorf("unexpected type %T for field id", values[i])
} else if value != nil {
ui.ID = *value
}
case useridentity.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field created_at", values[i])
} else if value.Valid {
ui.CreatedAt = value.Time
}
case useridentity.FieldUpdatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
} else if value.Valid {
ui.UpdatedAt = value.Time
}
case useridentity.FieldIss:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field iss", values[i])
} else if value.Valid {
ui.Iss = value.String
}
case useridentity.FieldSub:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field sub", values[i])
} else if value.Valid {
ui.Sub = value.String
}
case useridentity.FieldEmail:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field email", values[i])
} else if value.Valid {
ui.Email = value.String
}
case useridentity.FieldEmailVerified:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field email_verified", values[i])
} else if value.Valid {
ui.EmailVerified = value.Bool
}
case useridentity.FieldName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field name", values[i])
} else if value.Valid {
ui.Name = new(string)
*ui.Name = value.String
}
case useridentity.ForeignKeys[0]:
if value, ok := values[i].(*sql.NullScanner); !ok {
return fmt.Errorf("unexpected type %T for field user_id", values[i])
} else if value.Valid {
ui.user_id = new(uuid.UUID)
*ui.user_id = *value.S.(*uuid.UUID)
}
default:
ui.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the UserIdentity.
// This includes values selected through modifiers, order, etc.
func (ui *UserIdentity) Value(name string) (ent.Value, error) {
return ui.selectValues.Get(name)
}
// QueryUser queries the "user" edge of the UserIdentity entity.
func (ui *UserIdentity) QueryUser() *UserQuery {
return NewUserIdentityClient(ui.config).QueryUser(ui)
}
// Update returns a builder for updating this UserIdentity.
// Note that you need to call UserIdentity.Unwrap() before calling this method if this UserIdentity
// was returned from a transaction, and the transaction was committed or rolled back.
func (ui *UserIdentity) Update() *UserIdentityUpdateOne {
return NewUserIdentityClient(ui.config).UpdateOne(ui)
}
// Unwrap unwraps the UserIdentity entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (ui *UserIdentity) Unwrap() *UserIdentity {
_tx, ok := ui.config.driver.(*txDriver)
if !ok {
panic("ent: UserIdentity is not a transactional entity")
}
ui.config.driver = _tx.drv
return ui
}
// String implements the fmt.Stringer.
func (ui *UserIdentity) String() string {
var builder strings.Builder
builder.WriteString("UserIdentity(")
builder.WriteString(fmt.Sprintf("id=%v, ", ui.ID))
builder.WriteString("created_at=")
builder.WriteString(ui.CreatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("updated_at=")
builder.WriteString(ui.UpdatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("iss=")
builder.WriteString(ui.Iss)
builder.WriteString(", ")
builder.WriteString("sub=")
builder.WriteString(ui.Sub)
builder.WriteString(", ")
builder.WriteString("email=")
builder.WriteString(ui.Email)
builder.WriteString(", ")
builder.WriteString("email_verified=")
builder.WriteString(fmt.Sprintf("%v", ui.EmailVerified))
builder.WriteString(", ")
if v := ui.Name; v != nil {
builder.WriteString("name=")
builder.WriteString(*v)
}
builder.WriteByte(')')
return builder.String()
}
// UserIdentities is a parsable slice of UserIdentity.
type UserIdentities []*UserIdentity

View File

@@ -1,152 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package useridentity
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/gofrs/uuid"
)
const (
// Label holds the string label denoting the useridentity type in the database.
Label = "user_identity"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldIss holds the string denoting the iss field in the database.
FieldIss = "iss"
// FieldSub holds the string denoting the sub field in the database.
FieldSub = "sub"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldEmailVerified holds the string denoting the email_verified field in the database.
FieldEmailVerified = "email_verified"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// Table holds the table name of the useridentity in the database.
Table = "user_identities"
// UserTable is the table that holds the user relation/edge.
UserTable = "user_identities"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_id"
)
// Columns holds all SQL columns for useridentity fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldIss,
FieldSub,
FieldEmail,
FieldEmailVerified,
FieldName,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "user_identities"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"user_id",
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
var (
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
// IssValidator is a validator for the "iss" field. It is called by the builders before save.
IssValidator func(string) error
// SubValidator is a validator for the "sub" field. It is called by the builders before save.
SubValidator func(string) error
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
EmailValidator func(string) error
// DefaultEmailVerified holds the default value on creation for the "email_verified" field.
DefaultEmailVerified bool
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the UserIdentity queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByIss orders the results by the iss field.
func ByIss(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIss, opts...).ToFunc()
}
// BySub orders the results by the sub field.
func BySub(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSub, opts...).ToFunc()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByEmailVerified orders the results by the email_verified field.
func ByEmailVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmailVerified, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByUserField orders the results by user field.
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
}
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}

View File

@@ -1,490 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package useridentity
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
)
// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldUpdatedAt, v))
}
// Iss applies equality check predicate on the "iss" field. It's identical to IssEQ.
func Iss(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldIss, v))
}
// Sub applies equality check predicate on the "sub" field. It's identical to SubEQ.
func Sub(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldSub, v))
}
// Email applies equality check predicate on the "email" field. It's identical to EmailEQ.
func Email(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldEmail, v))
}
// EmailVerified applies equality check predicate on the "email_verified" field. It's identical to EmailVerifiedEQ.
func EmailVerified(v bool) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldEmailVerified, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldName, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldUpdatedAt, v))
}
// IssEQ applies the EQ predicate on the "iss" field.
func IssEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldIss, v))
}
// IssNEQ applies the NEQ predicate on the "iss" field.
func IssNEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldIss, v))
}
// IssIn applies the In predicate on the "iss" field.
func IssIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldIss, vs...))
}
// IssNotIn applies the NotIn predicate on the "iss" field.
func IssNotIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldIss, vs...))
}
// IssGT applies the GT predicate on the "iss" field.
func IssGT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldIss, v))
}
// IssGTE applies the GTE predicate on the "iss" field.
func IssGTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldIss, v))
}
// IssLT applies the LT predicate on the "iss" field.
func IssLT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldIss, v))
}
// IssLTE applies the LTE predicate on the "iss" field.
func IssLTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldIss, v))
}
// IssContains applies the Contains predicate on the "iss" field.
func IssContains(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContains(FieldIss, v))
}
// IssHasPrefix applies the HasPrefix predicate on the "iss" field.
func IssHasPrefix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasPrefix(FieldIss, v))
}
// IssHasSuffix applies the HasSuffix predicate on the "iss" field.
func IssHasSuffix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasSuffix(FieldIss, v))
}
// IssEqualFold applies the EqualFold predicate on the "iss" field.
func IssEqualFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEqualFold(FieldIss, v))
}
// IssContainsFold applies the ContainsFold predicate on the "iss" field.
func IssContainsFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContainsFold(FieldIss, v))
}
// SubEQ applies the EQ predicate on the "sub" field.
func SubEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldSub, v))
}
// SubNEQ applies the NEQ predicate on the "sub" field.
func SubNEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldSub, v))
}
// SubIn applies the In predicate on the "sub" field.
func SubIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldSub, vs...))
}
// SubNotIn applies the NotIn predicate on the "sub" field.
func SubNotIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldSub, vs...))
}
// SubGT applies the GT predicate on the "sub" field.
func SubGT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldSub, v))
}
// SubGTE applies the GTE predicate on the "sub" field.
func SubGTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldSub, v))
}
// SubLT applies the LT predicate on the "sub" field.
func SubLT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldSub, v))
}
// SubLTE applies the LTE predicate on the "sub" field.
func SubLTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldSub, v))
}
// SubContains applies the Contains predicate on the "sub" field.
func SubContains(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContains(FieldSub, v))
}
// SubHasPrefix applies the HasPrefix predicate on the "sub" field.
func SubHasPrefix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasPrefix(FieldSub, v))
}
// SubHasSuffix applies the HasSuffix predicate on the "sub" field.
func SubHasSuffix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasSuffix(FieldSub, v))
}
// SubEqualFold applies the EqualFold predicate on the "sub" field.
func SubEqualFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEqualFold(FieldSub, v))
}
// SubContainsFold applies the ContainsFold predicate on the "sub" field.
func SubContainsFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContainsFold(FieldSub, v))
}
// EmailEQ applies the EQ predicate on the "email" field.
func EmailEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldEmail, v))
}
// EmailNEQ applies the NEQ predicate on the "email" field.
func EmailNEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldEmail, v))
}
// EmailIn applies the In predicate on the "email" field.
func EmailIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldEmail, vs...))
}
// EmailNotIn applies the NotIn predicate on the "email" field.
func EmailNotIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldEmail, vs...))
}
// EmailGT applies the GT predicate on the "email" field.
func EmailGT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldEmail, v))
}
// EmailGTE applies the GTE predicate on the "email" field.
func EmailGTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldEmail, v))
}
// EmailLT applies the LT predicate on the "email" field.
func EmailLT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldEmail, v))
}
// EmailLTE applies the LTE predicate on the "email" field.
func EmailLTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldEmail, v))
}
// EmailContains applies the Contains predicate on the "email" field.
func EmailContains(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContains(FieldEmail, v))
}
// EmailHasPrefix applies the HasPrefix predicate on the "email" field.
func EmailHasPrefix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasPrefix(FieldEmail, v))
}
// EmailHasSuffix applies the HasSuffix predicate on the "email" field.
func EmailHasSuffix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasSuffix(FieldEmail, v))
}
// EmailEqualFold applies the EqualFold predicate on the "email" field.
func EmailEqualFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEqualFold(FieldEmail, v))
}
// EmailContainsFold applies the ContainsFold predicate on the "email" field.
func EmailContainsFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContainsFold(FieldEmail, v))
}
// EmailVerifiedEQ applies the EQ predicate on the "email_verified" field.
func EmailVerifiedEQ(v bool) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldEmailVerified, v))
}
// EmailVerifiedNEQ applies the NEQ predicate on the "email_verified" field.
func EmailVerifiedNEQ(v bool) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldEmailVerified, v))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEQ(FieldName, v))
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNEQ(FieldName, v))
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIn(FieldName, vs...))
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotIn(FieldName, vs...))
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGT(FieldName, v))
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldGTE(FieldName, v))
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLT(FieldName, v))
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldLTE(FieldName, v))
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContains(FieldName, v))
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasPrefix(FieldName, v))
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldHasSuffix(FieldName, v))
}
// NameIsNil applies the IsNil predicate on the "name" field.
func NameIsNil() predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldIsNull(FieldName))
}
// NameNotNil applies the NotNil predicate on the "name" field.
func NameNotNil() predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldNotNull(FieldName))
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldEqualFold(FieldName, v))
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.UserIdentity {
return predicate.UserIdentity(sql.FieldContainsFold(FieldName, v))
}
// HasUser applies the HasEdge predicate on the "user" edge.
func HasUser() predicate.UserIdentity {
return predicate.UserIdentity(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func HasUserWith(preds ...predicate.User) predicate.UserIdentity {
return predicate.UserIdentity(func(s *sql.Selector) {
step := newUserStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.UserIdentity) predicate.UserIdentity {
return predicate.UserIdentity(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.UserIdentity) predicate.UserIdentity {
return predicate.UserIdentity(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.UserIdentity) predicate.UserIdentity {
return predicate.UserIdentity(sql.NotPredicates(p))
}

View File

@@ -1,901 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"time"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserIdentityCreate is the builder for creating a UserIdentity entity.
type UserIdentityCreate struct {
config
mutation *UserIdentityMutation
hooks []Hook
conflict []sql.ConflictOption
}
// SetCreatedAt sets the "created_at" field.
func (uic *UserIdentityCreate) SetCreatedAt(t time.Time) *UserIdentityCreate {
uic.mutation.SetCreatedAt(t)
return uic
}
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (uic *UserIdentityCreate) SetNillableCreatedAt(t *time.Time) *UserIdentityCreate {
if t != nil {
uic.SetCreatedAt(*t)
}
return uic
}
// SetUpdatedAt sets the "updated_at" field.
func (uic *UserIdentityCreate) SetUpdatedAt(t time.Time) *UserIdentityCreate {
uic.mutation.SetUpdatedAt(t)
return uic
}
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (uic *UserIdentityCreate) SetNillableUpdatedAt(t *time.Time) *UserIdentityCreate {
if t != nil {
uic.SetUpdatedAt(*t)
}
return uic
}
// SetIss sets the "iss" field.
func (uic *UserIdentityCreate) SetIss(s string) *UserIdentityCreate {
uic.mutation.SetIss(s)
return uic
}
// SetSub sets the "sub" field.
func (uic *UserIdentityCreate) SetSub(s string) *UserIdentityCreate {
uic.mutation.SetSub(s)
return uic
}
// SetEmail sets the "email" field.
func (uic *UserIdentityCreate) SetEmail(s string) *UserIdentityCreate {
uic.mutation.SetEmail(s)
return uic
}
// SetEmailVerified sets the "email_verified" field.
func (uic *UserIdentityCreate) SetEmailVerified(b bool) *UserIdentityCreate {
uic.mutation.SetEmailVerified(b)
return uic
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uic *UserIdentityCreate) SetNillableEmailVerified(b *bool) *UserIdentityCreate {
if b != nil {
uic.SetEmailVerified(*b)
}
return uic
}
// SetName sets the "name" field.
func (uic *UserIdentityCreate) SetName(s string) *UserIdentityCreate {
uic.mutation.SetName(s)
return uic
}
// SetNillableName sets the "name" field if the given value is not nil.
func (uic *UserIdentityCreate) SetNillableName(s *string) *UserIdentityCreate {
if s != nil {
uic.SetName(*s)
}
return uic
}
// SetID sets the "id" field.
func (uic *UserIdentityCreate) SetID(u uuid.UUID) *UserIdentityCreate {
uic.mutation.SetID(u)
return uic
}
// SetNillableID sets the "id" field if the given value is not nil.
func (uic *UserIdentityCreate) SetNillableID(u *uuid.UUID) *UserIdentityCreate {
if u != nil {
uic.SetID(*u)
}
return uic
}
// SetUserID sets the "user" edge to the User entity by ID.
func (uic *UserIdentityCreate) SetUserID(id uuid.UUID) *UserIdentityCreate {
uic.mutation.SetUserID(id)
return uic
}
// SetUser sets the "user" edge to the User entity.
func (uic *UserIdentityCreate) SetUser(u *User) *UserIdentityCreate {
return uic.SetUserID(u.ID)
}
// Mutation returns the UserIdentityMutation object of the builder.
func (uic *UserIdentityCreate) Mutation() *UserIdentityMutation {
return uic.mutation
}
// Save creates the UserIdentity in the database.
func (uic *UserIdentityCreate) Save(ctx context.Context) (*UserIdentity, error) {
uic.defaults()
return withHooks(ctx, uic.sqlSave, uic.mutation, uic.hooks)
}
// SaveX calls Save and panics if Save returns an error.
func (uic *UserIdentityCreate) SaveX(ctx context.Context) *UserIdentity {
v, err := uic.Save(ctx)
if err != nil {
panic(err)
}
return v
}
// Exec executes the query.
func (uic *UserIdentityCreate) Exec(ctx context.Context) error {
_, err := uic.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uic *UserIdentityCreate) ExecX(ctx context.Context) {
if err := uic.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (uic *UserIdentityCreate) defaults() {
if _, ok := uic.mutation.CreatedAt(); !ok {
v := useridentity.DefaultCreatedAt()
uic.mutation.SetCreatedAt(v)
}
if _, ok := uic.mutation.UpdatedAt(); !ok {
v := useridentity.DefaultUpdatedAt()
uic.mutation.SetUpdatedAt(v)
}
if _, ok := uic.mutation.EmailVerified(); !ok {
v := useridentity.DefaultEmailVerified
uic.mutation.SetEmailVerified(v)
}
if _, ok := uic.mutation.ID(); !ok {
v := useridentity.DefaultID()
uic.mutation.SetID(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (uic *UserIdentityCreate) check() error {
if _, ok := uic.mutation.CreatedAt(); !ok {
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "UserIdentity.created_at"`)}
}
if _, ok := uic.mutation.UpdatedAt(); !ok {
return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "UserIdentity.updated_at"`)}
}
if _, ok := uic.mutation.Iss(); !ok {
return &ValidationError{Name: "iss", err: errors.New(`ent: missing required field "UserIdentity.iss"`)}
}
if v, ok := uic.mutation.Iss(); ok {
if err := useridentity.IssValidator(v); err != nil {
return &ValidationError{Name: "iss", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.iss": %w`, err)}
}
}
if _, ok := uic.mutation.Sub(); !ok {
return &ValidationError{Name: "sub", err: errors.New(`ent: missing required field "UserIdentity.sub"`)}
}
if v, ok := uic.mutation.Sub(); ok {
if err := useridentity.SubValidator(v); err != nil {
return &ValidationError{Name: "sub", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.sub": %w`, err)}
}
}
if _, ok := uic.mutation.Email(); !ok {
return &ValidationError{Name: "email", err: errors.New(`ent: missing required field "UserIdentity.email"`)}
}
if v, ok := uic.mutation.Email(); ok {
if err := useridentity.EmailValidator(v); err != nil {
return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.email": %w`, err)}
}
}
if _, ok := uic.mutation.EmailVerified(); !ok {
return &ValidationError{Name: "email_verified", err: errors.New(`ent: missing required field "UserIdentity.email_verified"`)}
}
if _, ok := uic.mutation.UserID(); !ok {
return &ValidationError{Name: "user", err: errors.New(`ent: missing required edge "UserIdentity.user"`)}
}
return nil
}
func (uic *UserIdentityCreate) sqlSave(ctx context.Context) (*UserIdentity, error) {
if err := uic.check(); err != nil {
return nil, err
}
_node, _spec := uic.createSpec()
if err := sqlgraph.CreateNode(ctx, uic.driver, _spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
if _spec.ID.Value != nil {
if id, ok := _spec.ID.Value.(*uuid.UUID); ok {
_node.ID = *id
} else if err := _node.ID.Scan(_spec.ID.Value); err != nil {
return nil, err
}
}
uic.mutation.id = &_node.ID
uic.mutation.done = true
return _node, nil
}
func (uic *UserIdentityCreate) createSpec() (*UserIdentity, *sqlgraph.CreateSpec) {
var (
_node = &UserIdentity{config: uic.config}
_spec = sqlgraph.NewCreateSpec(useridentity.Table, sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID))
)
_spec.OnConflict = uic.conflict
if id, ok := uic.mutation.ID(); ok {
_node.ID = id
_spec.ID.Value = &id
}
if value, ok := uic.mutation.CreatedAt(); ok {
_spec.SetField(useridentity.FieldCreatedAt, field.TypeTime, value)
_node.CreatedAt = value
}
if value, ok := uic.mutation.UpdatedAt(); ok {
_spec.SetField(useridentity.FieldUpdatedAt, field.TypeTime, value)
_node.UpdatedAt = value
}
if value, ok := uic.mutation.Iss(); ok {
_spec.SetField(useridentity.FieldIss, field.TypeString, value)
_node.Iss = value
}
if value, ok := uic.mutation.Sub(); ok {
_spec.SetField(useridentity.FieldSub, field.TypeString, value)
_node.Sub = value
}
if value, ok := uic.mutation.Email(); ok {
_spec.SetField(useridentity.FieldEmail, field.TypeString, value)
_node.Email = value
}
if value, ok := uic.mutation.EmailVerified(); ok {
_spec.SetField(useridentity.FieldEmailVerified, field.TypeBool, value)
_node.EmailVerified = value
}
if value, ok := uic.mutation.Name(); ok {
_spec.SetField(useridentity.FieldName, field.TypeString, value)
_node.Name = &value
}
if nodes := uic.mutation.UserIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
Inverse: true,
Table: useridentity.UserTable,
Columns: []string{useridentity.UserColumn},
Bidi: false,
Target: &sqlgraph.EdgeTarget{
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
},
}
for _, k := range nodes {
edge.Target.Nodes = append(edge.Target.Nodes, k)
}
_node.user_id = &nodes[0]
_spec.Edges = append(_spec.Edges, edge)
}
return _node, _spec
}
// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
// client.UserIdentity.Create().
// SetCreatedAt(v).
// OnConflict(
// // Update the row with the new values
// // the was proposed for insertion.
// sql.ResolveWithNewValues(),
// ).
// // Override some of the fields with custom
// // update values.
// Update(func(u *ent.UserIdentityUpsert) {
// SetCreatedAt(v+v).
// }).
// Exec(ctx)
func (uic *UserIdentityCreate) OnConflict(opts ...sql.ConflictOption) *UserIdentityUpsertOne {
uic.conflict = opts
return &UserIdentityUpsertOne{
create: uic,
}
}
// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(sql.ConflictColumns(columns...)).
// Exec(ctx)
func (uic *UserIdentityCreate) OnConflictColumns(columns ...string) *UserIdentityUpsertOne {
uic.conflict = append(uic.conflict, sql.ConflictColumns(columns...))
return &UserIdentityUpsertOne{
create: uic,
}
}
type (
// UserIdentityUpsertOne is the builder for "upsert"-ing
// one UserIdentity node.
UserIdentityUpsertOne struct {
create *UserIdentityCreate
}
// UserIdentityUpsert is the "OnConflict" setter.
UserIdentityUpsert struct {
*sql.UpdateSet
}
)
// SetUpdatedAt sets the "updated_at" field.
func (u *UserIdentityUpsert) SetUpdatedAt(v time.Time) *UserIdentityUpsert {
u.Set(useridentity.FieldUpdatedAt, v)
return u
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateUpdatedAt() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldUpdatedAt)
return u
}
// SetIss sets the "iss" field.
func (u *UserIdentityUpsert) SetIss(v string) *UserIdentityUpsert {
u.Set(useridentity.FieldIss, v)
return u
}
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateIss() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldIss)
return u
}
// SetSub sets the "sub" field.
func (u *UserIdentityUpsert) SetSub(v string) *UserIdentityUpsert {
u.Set(useridentity.FieldSub, v)
return u
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateSub() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldSub)
return u
}
// SetEmail sets the "email" field.
func (u *UserIdentityUpsert) SetEmail(v string) *UserIdentityUpsert {
u.Set(useridentity.FieldEmail, v)
return u
}
// UpdateEmail sets the "email" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateEmail() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldEmail)
return u
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserIdentityUpsert) SetEmailVerified(v bool) *UserIdentityUpsert {
u.Set(useridentity.FieldEmailVerified, v)
return u
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateEmailVerified() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldEmailVerified)
return u
}
// SetName sets the "name" field.
func (u *UserIdentityUpsert) SetName(v string) *UserIdentityUpsert {
u.Set(useridentity.FieldName, v)
return u
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *UserIdentityUpsert) UpdateName() *UserIdentityUpsert {
u.SetExcluded(useridentity.FieldName)
return u
}
// ClearName clears the value of the "name" field.
func (u *UserIdentityUpsert) ClearName() *UserIdentityUpsert {
u.SetNull(useridentity.FieldName)
return u
}
// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
// Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(
// sql.ResolveWithNewValues(),
// sql.ResolveWith(func(u *sql.UpdateSet) {
// u.SetIgnore(useridentity.FieldID)
// }),
// ).
// Exec(ctx)
func (u *UserIdentityUpsertOne) UpdateNewValues() *UserIdentityUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
if _, exists := u.create.mutation.ID(); exists {
s.SetIgnore(useridentity.FieldID)
}
if _, exists := u.create.mutation.CreatedAt(); exists {
s.SetIgnore(useridentity.FieldCreatedAt)
}
}))
return u
}
// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(sql.ResolveWithIgnore()).
// Exec(ctx)
func (u *UserIdentityUpsertOne) Ignore() *UserIdentityUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
return u
}
// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *UserIdentityUpsertOne) DoNothing() *UserIdentityUpsertOne {
u.create.conflict = append(u.create.conflict, sql.DoNothing())
return u
}
// Update allows overriding fields `UPDATE` values. See the UserIdentityCreate.OnConflict
// documentation for more info.
func (u *UserIdentityUpsertOne) Update(set func(*UserIdentityUpsert)) *UserIdentityUpsertOne {
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
set(&UserIdentityUpsert{UpdateSet: update})
}))
return u
}
// SetUpdatedAt sets the "updated_at" field.
func (u *UserIdentityUpsertOne) SetUpdatedAt(v time.Time) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetUpdatedAt(v)
})
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateUpdatedAt() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateUpdatedAt()
})
}
// SetIss sets the "iss" field.
func (u *UserIdentityUpsertOne) SetIss(v string) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetIss(v)
})
}
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateIss() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateIss()
})
}
// SetSub sets the "sub" field.
func (u *UserIdentityUpsertOne) SetSub(v string) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetSub(v)
})
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateSub() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateSub()
})
}
// SetEmail sets the "email" field.
func (u *UserIdentityUpsertOne) SetEmail(v string) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetEmail(v)
})
}
// UpdateEmail sets the "email" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateEmail() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateEmail()
})
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserIdentityUpsertOne) SetEmailVerified(v bool) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetEmailVerified(v)
})
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateEmailVerified() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateEmailVerified()
})
}
// SetName sets the "name" field.
func (u *UserIdentityUpsertOne) SetName(v string) *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.SetName(v)
})
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *UserIdentityUpsertOne) UpdateName() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateName()
})
}
// ClearName clears the value of the "name" field.
func (u *UserIdentityUpsertOne) ClearName() *UserIdentityUpsertOne {
return u.Update(func(s *UserIdentityUpsert) {
s.ClearName()
})
}
// Exec executes the query.
func (u *UserIdentityUpsertOne) Exec(ctx context.Context) error {
if len(u.create.conflict) == 0 {
return errors.New("ent: missing options for UserIdentityCreate.OnConflict")
}
return u.create.Exec(ctx)
}
// ExecX is like Exec, but panics if an error occurs.
func (u *UserIdentityUpsertOne) ExecX(ctx context.Context) {
if err := u.create.Exec(ctx); err != nil {
panic(err)
}
}
// Exec executes the UPSERT query and returns the inserted/updated ID.
func (u *UserIdentityUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error) {
if u.create.driver.Dialect() == dialect.MySQL {
// In case of "ON CONFLICT", there is no way to get back non-numeric ID
// fields from the database since MySQL does not support the RETURNING clause.
return id, errors.New("ent: UserIdentityUpsertOne.ID is not supported by MySQL driver. Use UserIdentityUpsertOne.Exec instead")
}
node, err := u.create.Save(ctx)
if err != nil {
return id, err
}
return node.ID, nil
}
// IDX is like ID, but panics if an error occurs.
func (u *UserIdentityUpsertOne) IDX(ctx context.Context) uuid.UUID {
id, err := u.ID(ctx)
if err != nil {
panic(err)
}
return id
}
// UserIdentityCreateBulk is the builder for creating many UserIdentity entities in bulk.
type UserIdentityCreateBulk struct {
config
err error
builders []*UserIdentityCreate
conflict []sql.ConflictOption
}
// Save creates the UserIdentity entities in the database.
func (uicb *UserIdentityCreateBulk) Save(ctx context.Context) ([]*UserIdentity, error) {
if uicb.err != nil {
return nil, uicb.err
}
specs := make([]*sqlgraph.CreateSpec, len(uicb.builders))
nodes := make([]*UserIdentity, len(uicb.builders))
mutators := make([]Mutator, len(uicb.builders))
for i := range uicb.builders {
func(i int, root context.Context) {
builder := uicb.builders[i]
builder.defaults()
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
mutation, ok := m.(*UserIdentityMutation)
if !ok {
return nil, fmt.Errorf("unexpected mutation type %T", m)
}
if err := builder.check(); err != nil {
return nil, err
}
builder.mutation = mutation
var err error
nodes[i], specs[i] = builder.createSpec()
if i < len(mutators)-1 {
_, err = mutators[i+1].Mutate(root, uicb.builders[i+1].mutation)
} else {
spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
spec.OnConflict = uicb.conflict
// Invoke the actual operation on the latest mutation in the chain.
if err = sqlgraph.BatchCreate(ctx, uicb.driver, spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
}
}
if err != nil {
return nil, err
}
mutation.id = &nodes[i].ID
mutation.done = true
return nodes[i], nil
})
for i := len(builder.hooks) - 1; i >= 0; i-- {
mut = builder.hooks[i](mut)
}
mutators[i] = mut
}(i, ctx)
}
if len(mutators) > 0 {
if _, err := mutators[0].Mutate(ctx, uicb.builders[0].mutation); err != nil {
return nil, err
}
}
return nodes, nil
}
// SaveX is like Save, but panics if an error occurs.
func (uicb *UserIdentityCreateBulk) SaveX(ctx context.Context) []*UserIdentity {
v, err := uicb.Save(ctx)
if err != nil {
panic(err)
}
return v
}
// Exec executes the query.
func (uicb *UserIdentityCreateBulk) Exec(ctx context.Context) error {
_, err := uicb.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uicb *UserIdentityCreateBulk) ExecX(ctx context.Context) {
if err := uicb.Exec(ctx); err != nil {
panic(err)
}
}
// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
// of the `INSERT` statement. For example:
//
// client.UserIdentity.CreateBulk(builders...).
// OnConflict(
// // Update the row with the new values
// // the was proposed for insertion.
// sql.ResolveWithNewValues(),
// ).
// // Override some of the fields with custom
// // update values.
// Update(func(u *ent.UserIdentityUpsert) {
// SetCreatedAt(v+v).
// }).
// Exec(ctx)
func (uicb *UserIdentityCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserIdentityUpsertBulk {
uicb.conflict = opts
return &UserIdentityUpsertBulk{
create: uicb,
}
}
// OnConflictColumns calls `OnConflict` and configures the columns
// as conflict target. Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(sql.ConflictColumns(columns...)).
// Exec(ctx)
func (uicb *UserIdentityCreateBulk) OnConflictColumns(columns ...string) *UserIdentityUpsertBulk {
uicb.conflict = append(uicb.conflict, sql.ConflictColumns(columns...))
return &UserIdentityUpsertBulk{
create: uicb,
}
}
// UserIdentityUpsertBulk is the builder for "upsert"-ing
// a bulk of UserIdentity nodes.
type UserIdentityUpsertBulk struct {
create *UserIdentityCreateBulk
}
// UpdateNewValues updates the mutable fields using the new values that
// were set on create. Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(
// sql.ResolveWithNewValues(),
// sql.ResolveWith(func(u *sql.UpdateSet) {
// u.SetIgnore(useridentity.FieldID)
// }),
// ).
// Exec(ctx)
func (u *UserIdentityUpsertBulk) UpdateNewValues() *UserIdentityUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
for _, b := range u.create.builders {
if _, exists := b.mutation.ID(); exists {
s.SetIgnore(useridentity.FieldID)
}
if _, exists := b.mutation.CreatedAt(); exists {
s.SetIgnore(useridentity.FieldCreatedAt)
}
}
}))
return u
}
// Ignore sets each column to itself in case of conflict.
// Using this option is equivalent to using:
//
// client.UserIdentity.Create().
// OnConflict(sql.ResolveWithIgnore()).
// Exec(ctx)
func (u *UserIdentityUpsertBulk) Ignore() *UserIdentityUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
return u
}
// DoNothing configures the conflict_action to `DO NOTHING`.
// Supported only by SQLite and PostgreSQL.
func (u *UserIdentityUpsertBulk) DoNothing() *UserIdentityUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.DoNothing())
return u
}
// Update allows overriding fields `UPDATE` values. See the UserIdentityCreateBulk.OnConflict
// documentation for more info.
func (u *UserIdentityUpsertBulk) Update(set func(*UserIdentityUpsert)) *UserIdentityUpsertBulk {
u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
set(&UserIdentityUpsert{UpdateSet: update})
}))
return u
}
// SetUpdatedAt sets the "updated_at" field.
func (u *UserIdentityUpsertBulk) SetUpdatedAt(v time.Time) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetUpdatedAt(v)
})
}
// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateUpdatedAt() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateUpdatedAt()
})
}
// SetIss sets the "iss" field.
func (u *UserIdentityUpsertBulk) SetIss(v string) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetIss(v)
})
}
// UpdateIss sets the "iss" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateIss() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateIss()
})
}
// SetSub sets the "sub" field.
func (u *UserIdentityUpsertBulk) SetSub(v string) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetSub(v)
})
}
// UpdateSub sets the "sub" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateSub() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateSub()
})
}
// SetEmail sets the "email" field.
func (u *UserIdentityUpsertBulk) SetEmail(v string) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetEmail(v)
})
}
// UpdateEmail sets the "email" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateEmail() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateEmail()
})
}
// SetEmailVerified sets the "email_verified" field.
func (u *UserIdentityUpsertBulk) SetEmailVerified(v bool) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetEmailVerified(v)
})
}
// UpdateEmailVerified sets the "email_verified" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateEmailVerified() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateEmailVerified()
})
}
// SetName sets the "name" field.
func (u *UserIdentityUpsertBulk) SetName(v string) *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.SetName(v)
})
}
// UpdateName sets the "name" field to the value that was provided on create.
func (u *UserIdentityUpsertBulk) UpdateName() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.UpdateName()
})
}
// ClearName clears the value of the "name" field.
func (u *UserIdentityUpsertBulk) ClearName() *UserIdentityUpsertBulk {
return u.Update(func(s *UserIdentityUpsert) {
s.ClearName()
})
}
// Exec executes the query.
func (u *UserIdentityUpsertBulk) Exec(ctx context.Context) error {
if u.create.err != nil {
return u.create.err
}
for i, b := range u.create.builders {
if len(b.conflict) != 0 {
return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the UserIdentityCreateBulk instead", i)
}
}
if len(u.create.conflict) == 0 {
return errors.New("ent: missing options for UserIdentityCreateBulk.OnConflict")
}
return u.create.Exec(ctx)
}
// ExecX is like Exec, but panics if an error occurs.
func (u *UserIdentityUpsertBulk) ExecX(ctx context.Context) {
if err := u.create.Exec(ctx); err != nil {
panic(err)
}
}

View File

@@ -1,88 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/holos-run/holos/internal/ent/predicate"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserIdentityDelete is the builder for deleting a UserIdentity entity.
type UserIdentityDelete struct {
config
hooks []Hook
mutation *UserIdentityMutation
}
// Where appends a list predicates to the UserIdentityDelete builder.
func (uid *UserIdentityDelete) Where(ps ...predicate.UserIdentity) *UserIdentityDelete {
uid.mutation.Where(ps...)
return uid
}
// Exec executes the deletion query and returns how many vertices were deleted.
func (uid *UserIdentityDelete) Exec(ctx context.Context) (int, error) {
return withHooks(ctx, uid.sqlExec, uid.mutation, uid.hooks)
}
// ExecX is like Exec, but panics if an error occurs.
func (uid *UserIdentityDelete) ExecX(ctx context.Context) int {
n, err := uid.Exec(ctx)
if err != nil {
panic(err)
}
return n
}
func (uid *UserIdentityDelete) sqlExec(ctx context.Context) (int, error) {
_spec := sqlgraph.NewDeleteSpec(useridentity.Table, sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID))
if ps := uid.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
affected, err := sqlgraph.DeleteNodes(ctx, uid.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
uid.mutation.done = true
return affected, err
}
// UserIdentityDeleteOne is the builder for deleting a single UserIdentity entity.
type UserIdentityDeleteOne struct {
uid *UserIdentityDelete
}
// Where appends a list predicates to the UserIdentityDelete builder.
func (uido *UserIdentityDeleteOne) Where(ps ...predicate.UserIdentity) *UserIdentityDeleteOne {
uido.uid.mutation.Where(ps...)
return uido
}
// Exec executes the deletion query.
func (uido *UserIdentityDeleteOne) Exec(ctx context.Context) error {
n, err := uido.uid.Exec(ctx)
switch {
case err != nil:
return err
case n == 0:
return &NotFoundError{useridentity.Label}
default:
return nil
}
}
// ExecX is like Exec, but panics if an error occurs.
func (uido *UserIdentityDeleteOne) ExecX(ctx context.Context) {
if err := uido.Exec(ctx); err != nil {
panic(err)
}
}

View File

@@ -1,614 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"fmt"
"math"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/gofrs/uuid"
"github.com/holos-run/holos/internal/ent/predicate"
"github.com/holos-run/holos/internal/ent/user"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserIdentityQuery is the builder for querying UserIdentity entities.
type UserIdentityQuery struct {
config
ctx *QueryContext
order []useridentity.OrderOption
inters []Interceptor
predicates []predicate.UserIdentity
withUser *UserQuery
withFKs bool
// intermediate query (i.e. traversal path).
sql *sql.Selector
path func(context.Context) (*sql.Selector, error)
}
// Where adds a new predicate for the UserIdentityQuery builder.
func (uiq *UserIdentityQuery) Where(ps ...predicate.UserIdentity) *UserIdentityQuery {
uiq.predicates = append(uiq.predicates, ps...)
return uiq
}
// Limit the number of records to be returned by this query.
func (uiq *UserIdentityQuery) Limit(limit int) *UserIdentityQuery {
uiq.ctx.Limit = &limit
return uiq
}
// Offset to start from.
func (uiq *UserIdentityQuery) Offset(offset int) *UserIdentityQuery {
uiq.ctx.Offset = &offset
return uiq
}
// Unique configures the query builder to filter duplicate records on query.
// By default, unique is set to true, and can be disabled using this method.
func (uiq *UserIdentityQuery) Unique(unique bool) *UserIdentityQuery {
uiq.ctx.Unique = &unique
return uiq
}
// Order specifies how the records should be ordered.
func (uiq *UserIdentityQuery) Order(o ...useridentity.OrderOption) *UserIdentityQuery {
uiq.order = append(uiq.order, o...)
return uiq
}
// QueryUser chains the current query on the "user" edge.
func (uiq *UserIdentityQuery) QueryUser() *UserQuery {
query := (&UserClient{config: uiq.config}).Query()
query.path = func(ctx context.Context) (fromU *sql.Selector, err error) {
if err := uiq.prepareQuery(ctx); err != nil {
return nil, err
}
selector := uiq.sqlQuery(ctx)
if err := selector.Err(); err != nil {
return nil, err
}
step := sqlgraph.NewStep(
sqlgraph.From(useridentity.Table, useridentity.FieldID, selector),
sqlgraph.To(user.Table, user.FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, useridentity.UserTable, useridentity.UserColumn),
)
fromU = sqlgraph.SetNeighbors(uiq.driver.Dialect(), step)
return fromU, nil
}
return query
}
// First returns the first UserIdentity entity from the query.
// Returns a *NotFoundError when no UserIdentity was found.
func (uiq *UserIdentityQuery) First(ctx context.Context) (*UserIdentity, error) {
nodes, err := uiq.Limit(1).All(setContextOp(ctx, uiq.ctx, "First"))
if err != nil {
return nil, err
}
if len(nodes) == 0 {
return nil, &NotFoundError{useridentity.Label}
}
return nodes[0], nil
}
// FirstX is like First, but panics if an error occurs.
func (uiq *UserIdentityQuery) FirstX(ctx context.Context) *UserIdentity {
node, err := uiq.First(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return node
}
// FirstID returns the first UserIdentity ID from the query.
// Returns a *NotFoundError when no UserIdentity ID was found.
func (uiq *UserIdentityQuery) FirstID(ctx context.Context) (id uuid.UUID, err error) {
var ids []uuid.UUID
if ids, err = uiq.Limit(1).IDs(setContextOp(ctx, uiq.ctx, "FirstID")); err != nil {
return
}
if len(ids) == 0 {
err = &NotFoundError{useridentity.Label}
return
}
return ids[0], nil
}
// FirstIDX is like FirstID, but panics if an error occurs.
func (uiq *UserIdentityQuery) FirstIDX(ctx context.Context) uuid.UUID {
id, err := uiq.FirstID(ctx)
if err != nil && !IsNotFound(err) {
panic(err)
}
return id
}
// Only returns a single UserIdentity entity found by the query, ensuring it only returns one.
// Returns a *NotSingularError when more than one UserIdentity entity is found.
// Returns a *NotFoundError when no UserIdentity entities are found.
func (uiq *UserIdentityQuery) Only(ctx context.Context) (*UserIdentity, error) {
nodes, err := uiq.Limit(2).All(setContextOp(ctx, uiq.ctx, "Only"))
if err != nil {
return nil, err
}
switch len(nodes) {
case 1:
return nodes[0], nil
case 0:
return nil, &NotFoundError{useridentity.Label}
default:
return nil, &NotSingularError{useridentity.Label}
}
}
// OnlyX is like Only, but panics if an error occurs.
func (uiq *UserIdentityQuery) OnlyX(ctx context.Context) *UserIdentity {
node, err := uiq.Only(ctx)
if err != nil {
panic(err)
}
return node
}
// OnlyID is like Only, but returns the only UserIdentity ID in the query.
// Returns a *NotSingularError when more than one UserIdentity ID is found.
// Returns a *NotFoundError when no entities are found.
func (uiq *UserIdentityQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error) {
var ids []uuid.UUID
if ids, err = uiq.Limit(2).IDs(setContextOp(ctx, uiq.ctx, "OnlyID")); err != nil {
return
}
switch len(ids) {
case 1:
id = ids[0]
case 0:
err = &NotFoundError{useridentity.Label}
default:
err = &NotSingularError{useridentity.Label}
}
return
}
// OnlyIDX is like OnlyID, but panics if an error occurs.
func (uiq *UserIdentityQuery) OnlyIDX(ctx context.Context) uuid.UUID {
id, err := uiq.OnlyID(ctx)
if err != nil {
panic(err)
}
return id
}
// All executes the query and returns a list of UserIdentities.
func (uiq *UserIdentityQuery) All(ctx context.Context) ([]*UserIdentity, error) {
ctx = setContextOp(ctx, uiq.ctx, "All")
if err := uiq.prepareQuery(ctx); err != nil {
return nil, err
}
qr := querierAll[[]*UserIdentity, *UserIdentityQuery]()
return withInterceptors[[]*UserIdentity](ctx, uiq, qr, uiq.inters)
}
// AllX is like All, but panics if an error occurs.
func (uiq *UserIdentityQuery) AllX(ctx context.Context) []*UserIdentity {
nodes, err := uiq.All(ctx)
if err != nil {
panic(err)
}
return nodes
}
// IDs executes the query and returns a list of UserIdentity IDs.
func (uiq *UserIdentityQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error) {
if uiq.ctx.Unique == nil && uiq.path != nil {
uiq.Unique(true)
}
ctx = setContextOp(ctx, uiq.ctx, "IDs")
if err = uiq.Select(useridentity.FieldID).Scan(ctx, &ids); err != nil {
return nil, err
}
return ids, nil
}
// IDsX is like IDs, but panics if an error occurs.
func (uiq *UserIdentityQuery) IDsX(ctx context.Context) []uuid.UUID {
ids, err := uiq.IDs(ctx)
if err != nil {
panic(err)
}
return ids
}
// Count returns the count of the given query.
func (uiq *UserIdentityQuery) Count(ctx context.Context) (int, error) {
ctx = setContextOp(ctx, uiq.ctx, "Count")
if err := uiq.prepareQuery(ctx); err != nil {
return 0, err
}
return withInterceptors[int](ctx, uiq, querierCount[*UserIdentityQuery](), uiq.inters)
}
// CountX is like Count, but panics if an error occurs.
func (uiq *UserIdentityQuery) CountX(ctx context.Context) int {
count, err := uiq.Count(ctx)
if err != nil {
panic(err)
}
return count
}
// Exist returns true if the query has elements in the graph.
func (uiq *UserIdentityQuery) Exist(ctx context.Context) (bool, error) {
ctx = setContextOp(ctx, uiq.ctx, "Exist")
switch _, err := uiq.FirstID(ctx); {
case IsNotFound(err):
return false, nil
case err != nil:
return false, fmt.Errorf("ent: check existence: %w", err)
default:
return true, nil
}
}
// ExistX is like Exist, but panics if an error occurs.
func (uiq *UserIdentityQuery) ExistX(ctx context.Context) bool {
exist, err := uiq.Exist(ctx)
if err != nil {
panic(err)
}
return exist
}
// Clone returns a duplicate of the UserIdentityQuery builder, including all associated steps. It can be
// used to prepare common query builders and use them differently after the clone is made.
func (uiq *UserIdentityQuery) Clone() *UserIdentityQuery {
if uiq == nil {
return nil
}
return &UserIdentityQuery{
config: uiq.config,
ctx: uiq.ctx.Clone(),
order: append([]useridentity.OrderOption{}, uiq.order...),
inters: append([]Interceptor{}, uiq.inters...),
predicates: append([]predicate.UserIdentity{}, uiq.predicates...),
withUser: uiq.withUser.Clone(),
// clone intermediate query.
sql: uiq.sql.Clone(),
path: uiq.path,
}
}
// WithUser tells the query-builder to eager-load the nodes that are connected to
// the "user" edge. The optional arguments are used to configure the query builder of the edge.
func (uiq *UserIdentityQuery) WithUser(opts ...func(*UserQuery)) *UserIdentityQuery {
query := (&UserClient{config: uiq.config}).Query()
for _, opt := range opts {
opt(query)
}
uiq.withUser = query
return uiq
}
// GroupBy is used to group vertices by one or more fields/columns.
// It is often used with aggregate functions, like: count, max, mean, min, sum.
//
// Example:
//
// var v []struct {
// CreatedAt time.Time `json:"created_at,omitempty"`
// Count int `json:"count,omitempty"`
// }
//
// client.UserIdentity.Query().
// GroupBy(useridentity.FieldCreatedAt).
// Aggregate(ent.Count()).
// Scan(ctx, &v)
func (uiq *UserIdentityQuery) GroupBy(field string, fields ...string) *UserIdentityGroupBy {
uiq.ctx.Fields = append([]string{field}, fields...)
grbuild := &UserIdentityGroupBy{build: uiq}
grbuild.flds = &uiq.ctx.Fields
grbuild.label = useridentity.Label
grbuild.scan = grbuild.Scan
return grbuild
}
// Select allows the selection one or more fields/columns for the given query,
// instead of selecting all fields in the entity.
//
// Example:
//
// var v []struct {
// CreatedAt time.Time `json:"created_at,omitempty"`
// }
//
// client.UserIdentity.Query().
// Select(useridentity.FieldCreatedAt).
// Scan(ctx, &v)
func (uiq *UserIdentityQuery) Select(fields ...string) *UserIdentitySelect {
uiq.ctx.Fields = append(uiq.ctx.Fields, fields...)
sbuild := &UserIdentitySelect{UserIdentityQuery: uiq}
sbuild.label = useridentity.Label
sbuild.flds, sbuild.scan = &uiq.ctx.Fields, sbuild.Scan
return sbuild
}
// Aggregate returns a UserIdentitySelect configured with the given aggregations.
func (uiq *UserIdentityQuery) Aggregate(fns ...AggregateFunc) *UserIdentitySelect {
return uiq.Select().Aggregate(fns...)
}
func (uiq *UserIdentityQuery) prepareQuery(ctx context.Context) error {
for _, inter := range uiq.inters {
if inter == nil {
return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
}
if trv, ok := inter.(Traverser); ok {
if err := trv.Traverse(ctx, uiq); err != nil {
return err
}
}
}
for _, f := range uiq.ctx.Fields {
if !useridentity.ValidColumn(f) {
return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
}
}
if uiq.path != nil {
prev, err := uiq.path(ctx)
if err != nil {
return err
}
uiq.sql = prev
}
return nil
}
func (uiq *UserIdentityQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*UserIdentity, error) {
var (
nodes = []*UserIdentity{}
withFKs = uiq.withFKs
_spec = uiq.querySpec()
loadedTypes = [1]bool{
uiq.withUser != nil,
}
)
if uiq.withUser != nil {
withFKs = true
}
if withFKs {
_spec.Node.Columns = append(_spec.Node.Columns, useridentity.ForeignKeys...)
}
_spec.ScanValues = func(columns []string) ([]any, error) {
return (*UserIdentity).scanValues(nil, columns)
}
_spec.Assign = func(columns []string, values []any) error {
node := &UserIdentity{config: uiq.config}
nodes = append(nodes, node)
node.Edges.loadedTypes = loadedTypes
return node.assignValues(columns, values)
}
for i := range hooks {
hooks[i](ctx, _spec)
}
if err := sqlgraph.QueryNodes(ctx, uiq.driver, _spec); err != nil {
return nil, err
}
if len(nodes) == 0 {
return nodes, nil
}
if query := uiq.withUser; query != nil {
if err := uiq.loadUser(ctx, query, nodes, nil,
func(n *UserIdentity, e *User) { n.Edges.User = e }); err != nil {
return nil, err
}
}
return nodes, nil
}
func (uiq *UserIdentityQuery) loadUser(ctx context.Context, query *UserQuery, nodes []*UserIdentity, init func(*UserIdentity), assign func(*UserIdentity, *User)) error {
ids := make([]uuid.UUID, 0, len(nodes))
nodeids := make(map[uuid.UUID][]*UserIdentity)
for i := range nodes {
if nodes[i].user_id == nil {
continue
}
fk := *nodes[i].user_id
if _, ok := nodeids[fk]; !ok {
ids = append(ids, fk)
}
nodeids[fk] = append(nodeids[fk], nodes[i])
}
if len(ids) == 0 {
return nil
}
query.Where(user.IDIn(ids...))
neighbors, err := query.All(ctx)
if err != nil {
return err
}
for _, n := range neighbors {
nodes, ok := nodeids[n.ID]
if !ok {
return fmt.Errorf(`unexpected foreign-key "user_id" returned %v`, n.ID)
}
for i := range nodes {
assign(nodes[i], n)
}
}
return nil
}
func (uiq *UserIdentityQuery) sqlCount(ctx context.Context) (int, error) {
_spec := uiq.querySpec()
_spec.Node.Columns = uiq.ctx.Fields
if len(uiq.ctx.Fields) > 0 {
_spec.Unique = uiq.ctx.Unique != nil && *uiq.ctx.Unique
}
return sqlgraph.CountNodes(ctx, uiq.driver, _spec)
}
func (uiq *UserIdentityQuery) querySpec() *sqlgraph.QuerySpec {
_spec := sqlgraph.NewQuerySpec(useridentity.Table, useridentity.Columns, sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID))
_spec.From = uiq.sql
if unique := uiq.ctx.Unique; unique != nil {
_spec.Unique = *unique
} else if uiq.path != nil {
_spec.Unique = true
}
if fields := uiq.ctx.Fields; len(fields) > 0 {
_spec.Node.Columns = make([]string, 0, len(fields))
_spec.Node.Columns = append(_spec.Node.Columns, useridentity.FieldID)
for i := range fields {
if fields[i] != useridentity.FieldID {
_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
}
}
}
if ps := uiq.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if limit := uiq.ctx.Limit; limit != nil {
_spec.Limit = *limit
}
if offset := uiq.ctx.Offset; offset != nil {
_spec.Offset = *offset
}
if ps := uiq.order; len(ps) > 0 {
_spec.Order = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
return _spec
}
func (uiq *UserIdentityQuery) sqlQuery(ctx context.Context) *sql.Selector {
builder := sql.Dialect(uiq.driver.Dialect())
t1 := builder.Table(useridentity.Table)
columns := uiq.ctx.Fields
if len(columns) == 0 {
columns = useridentity.Columns
}
selector := builder.Select(t1.Columns(columns...)...).From(t1)
if uiq.sql != nil {
selector = uiq.sql
selector.Select(selector.Columns(columns...)...)
}
if uiq.ctx.Unique != nil && *uiq.ctx.Unique {
selector.Distinct()
}
for _, p := range uiq.predicates {
p(selector)
}
for _, p := range uiq.order {
p(selector)
}
if offset := uiq.ctx.Offset; offset != nil {
// limit is mandatory for offset clause. We start
// with default value, and override it below if needed.
selector.Offset(*offset).Limit(math.MaxInt32)
}
if limit := uiq.ctx.Limit; limit != nil {
selector.Limit(*limit)
}
return selector
}
// UserIdentityGroupBy is the group-by builder for UserIdentity entities.
type UserIdentityGroupBy struct {
selector
build *UserIdentityQuery
}
// Aggregate adds the given aggregation functions to the group-by query.
func (uigb *UserIdentityGroupBy) Aggregate(fns ...AggregateFunc) *UserIdentityGroupBy {
uigb.fns = append(uigb.fns, fns...)
return uigb
}
// Scan applies the selector query and scans the result into the given value.
func (uigb *UserIdentityGroupBy) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, uigb.build.ctx, "GroupBy")
if err := uigb.build.prepareQuery(ctx); err != nil {
return err
}
return scanWithInterceptors[*UserIdentityQuery, *UserIdentityGroupBy](ctx, uigb.build, uigb, uigb.build.inters, v)
}
func (uigb *UserIdentityGroupBy) sqlScan(ctx context.Context, root *UserIdentityQuery, v any) error {
selector := root.sqlQuery(ctx).Select()
aggregation := make([]string, 0, len(uigb.fns))
for _, fn := range uigb.fns {
aggregation = append(aggregation, fn(selector))
}
if len(selector.SelectedColumns()) == 0 {
columns := make([]string, 0, len(*uigb.flds)+len(uigb.fns))
for _, f := range *uigb.flds {
columns = append(columns, selector.C(f))
}
columns = append(columns, aggregation...)
selector.Select(columns...)
}
selector.GroupBy(selector.Columns(*uigb.flds...)...)
if err := selector.Err(); err != nil {
return err
}
rows := &sql.Rows{}
query, args := selector.Query()
if err := uigb.build.driver.Query(ctx, query, args, rows); err != nil {
return err
}
defer rows.Close()
return sql.ScanSlice(rows, v)
}
// UserIdentitySelect is the builder for selecting fields of UserIdentity entities.
type UserIdentitySelect struct {
*UserIdentityQuery
selector
}
// Aggregate adds the given aggregation functions to the selector query.
func (uis *UserIdentitySelect) Aggregate(fns ...AggregateFunc) *UserIdentitySelect {
uis.fns = append(uis.fns, fns...)
return uis
}
// Scan applies the selector query and scans the result into the given value.
func (uis *UserIdentitySelect) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, uis.ctx, "Select")
if err := uis.prepareQuery(ctx); err != nil {
return err
}
return scanWithInterceptors[*UserIdentityQuery, *UserIdentitySelect](ctx, uis.UserIdentityQuery, uis, uis.inters, v)
}
func (uis *UserIdentitySelect) sqlScan(ctx context.Context, root *UserIdentityQuery, v any) error {
selector := root.sqlQuery(ctx)
aggregation := make([]string, 0, len(uis.fns))
for _, fn := range uis.fns {
aggregation = append(aggregation, fn(selector))
}
switch n := len(*uis.selector.flds); {
case n == 0 && len(aggregation) > 0:
selector.Select(aggregation...)
case n != 0 && len(aggregation) > 0:
selector.AppendSelect(aggregation...)
}
rows := &sql.Rows{}
query, args := selector.Query()
if err := uis.driver.Query(ctx, query, args, rows); err != nil {
return err
}
defer rows.Close()
return sql.ScanSlice(rows, v)
}

View File

@@ -1,452 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/holos-run/holos/internal/ent/predicate"
"github.com/holos-run/holos/internal/ent/useridentity"
)
// UserIdentityUpdate is the builder for updating UserIdentity entities.
type UserIdentityUpdate struct {
config
hooks []Hook
mutation *UserIdentityMutation
}
// Where appends a list predicates to the UserIdentityUpdate builder.
func (uiu *UserIdentityUpdate) Where(ps ...predicate.UserIdentity) *UserIdentityUpdate {
uiu.mutation.Where(ps...)
return uiu
}
// SetUpdatedAt sets the "updated_at" field.
func (uiu *UserIdentityUpdate) SetUpdatedAt(t time.Time) *UserIdentityUpdate {
uiu.mutation.SetUpdatedAt(t)
return uiu
}
// SetIss sets the "iss" field.
func (uiu *UserIdentityUpdate) SetIss(s string) *UserIdentityUpdate {
uiu.mutation.SetIss(s)
return uiu
}
// SetNillableIss sets the "iss" field if the given value is not nil.
func (uiu *UserIdentityUpdate) SetNillableIss(s *string) *UserIdentityUpdate {
if s != nil {
uiu.SetIss(*s)
}
return uiu
}
// SetSub sets the "sub" field.
func (uiu *UserIdentityUpdate) SetSub(s string) *UserIdentityUpdate {
uiu.mutation.SetSub(s)
return uiu
}
// SetNillableSub sets the "sub" field if the given value is not nil.
func (uiu *UserIdentityUpdate) SetNillableSub(s *string) *UserIdentityUpdate {
if s != nil {
uiu.SetSub(*s)
}
return uiu
}
// SetEmail sets the "email" field.
func (uiu *UserIdentityUpdate) SetEmail(s string) *UserIdentityUpdate {
uiu.mutation.SetEmail(s)
return uiu
}
// SetNillableEmail sets the "email" field if the given value is not nil.
func (uiu *UserIdentityUpdate) SetNillableEmail(s *string) *UserIdentityUpdate {
if s != nil {
uiu.SetEmail(*s)
}
return uiu
}
// SetEmailVerified sets the "email_verified" field.
func (uiu *UserIdentityUpdate) SetEmailVerified(b bool) *UserIdentityUpdate {
uiu.mutation.SetEmailVerified(b)
return uiu
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uiu *UserIdentityUpdate) SetNillableEmailVerified(b *bool) *UserIdentityUpdate {
if b != nil {
uiu.SetEmailVerified(*b)
}
return uiu
}
// SetName sets the "name" field.
func (uiu *UserIdentityUpdate) SetName(s string) *UserIdentityUpdate {
uiu.mutation.SetName(s)
return uiu
}
// SetNillableName sets the "name" field if the given value is not nil.
func (uiu *UserIdentityUpdate) SetNillableName(s *string) *UserIdentityUpdate {
if s != nil {
uiu.SetName(*s)
}
return uiu
}
// ClearName clears the value of the "name" field.
func (uiu *UserIdentityUpdate) ClearName() *UserIdentityUpdate {
uiu.mutation.ClearName()
return uiu
}
// Mutation returns the UserIdentityMutation object of the builder.
func (uiu *UserIdentityUpdate) Mutation() *UserIdentityMutation {
return uiu.mutation
}
// Save executes the query and returns the number of nodes affected by the update operation.
func (uiu *UserIdentityUpdate) Save(ctx context.Context) (int, error) {
uiu.defaults()
return withHooks(ctx, uiu.sqlSave, uiu.mutation, uiu.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (uiu *UserIdentityUpdate) SaveX(ctx context.Context) int {
affected, err := uiu.Save(ctx)
if err != nil {
panic(err)
}
return affected
}
// Exec executes the query.
func (uiu *UserIdentityUpdate) Exec(ctx context.Context) error {
_, err := uiu.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uiu *UserIdentityUpdate) ExecX(ctx context.Context) {
if err := uiu.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (uiu *UserIdentityUpdate) defaults() {
if _, ok := uiu.mutation.UpdatedAt(); !ok {
v := useridentity.UpdateDefaultUpdatedAt()
uiu.mutation.SetUpdatedAt(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (uiu *UserIdentityUpdate) check() error {
if v, ok := uiu.mutation.Iss(); ok {
if err := useridentity.IssValidator(v); err != nil {
return &ValidationError{Name: "iss", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.iss": %w`, err)}
}
}
if v, ok := uiu.mutation.Sub(); ok {
if err := useridentity.SubValidator(v); err != nil {
return &ValidationError{Name: "sub", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.sub": %w`, err)}
}
}
if v, ok := uiu.mutation.Email(); ok {
if err := useridentity.EmailValidator(v); err != nil {
return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.email": %w`, err)}
}
}
if _, ok := uiu.mutation.UserID(); uiu.mutation.UserCleared() && !ok {
return errors.New(`ent: clearing a required unique edge "UserIdentity.user"`)
}
return nil
}
func (uiu *UserIdentityUpdate) sqlSave(ctx context.Context) (n int, err error) {
if err := uiu.check(); err != nil {
return n, err
}
_spec := sqlgraph.NewUpdateSpec(useridentity.Table, useridentity.Columns, sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID))
if ps := uiu.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := uiu.mutation.UpdatedAt(); ok {
_spec.SetField(useridentity.FieldUpdatedAt, field.TypeTime, value)
}
if value, ok := uiu.mutation.Iss(); ok {
_spec.SetField(useridentity.FieldIss, field.TypeString, value)
}
if value, ok := uiu.mutation.Sub(); ok {
_spec.SetField(useridentity.FieldSub, field.TypeString, value)
}
if value, ok := uiu.mutation.Email(); ok {
_spec.SetField(useridentity.FieldEmail, field.TypeString, value)
}
if value, ok := uiu.mutation.EmailVerified(); ok {
_spec.SetField(useridentity.FieldEmailVerified, field.TypeBool, value)
}
if value, ok := uiu.mutation.Name(); ok {
_spec.SetField(useridentity.FieldName, field.TypeString, value)
}
if uiu.mutation.NameCleared() {
_spec.ClearField(useridentity.FieldName, field.TypeString)
}
if n, err = sqlgraph.UpdateNodes(ctx, uiu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{useridentity.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
uiu.mutation.done = true
return n, nil
}
// UserIdentityUpdateOne is the builder for updating a single UserIdentity entity.
type UserIdentityUpdateOne struct {
config
fields []string
hooks []Hook
mutation *UserIdentityMutation
}
// SetUpdatedAt sets the "updated_at" field.
func (uiuo *UserIdentityUpdateOne) SetUpdatedAt(t time.Time) *UserIdentityUpdateOne {
uiuo.mutation.SetUpdatedAt(t)
return uiuo
}
// SetIss sets the "iss" field.
func (uiuo *UserIdentityUpdateOne) SetIss(s string) *UserIdentityUpdateOne {
uiuo.mutation.SetIss(s)
return uiuo
}
// SetNillableIss sets the "iss" field if the given value is not nil.
func (uiuo *UserIdentityUpdateOne) SetNillableIss(s *string) *UserIdentityUpdateOne {
if s != nil {
uiuo.SetIss(*s)
}
return uiuo
}
// SetSub sets the "sub" field.
func (uiuo *UserIdentityUpdateOne) SetSub(s string) *UserIdentityUpdateOne {
uiuo.mutation.SetSub(s)
return uiuo
}
// SetNillableSub sets the "sub" field if the given value is not nil.
func (uiuo *UserIdentityUpdateOne) SetNillableSub(s *string) *UserIdentityUpdateOne {
if s != nil {
uiuo.SetSub(*s)
}
return uiuo
}
// SetEmail sets the "email" field.
func (uiuo *UserIdentityUpdateOne) SetEmail(s string) *UserIdentityUpdateOne {
uiuo.mutation.SetEmail(s)
return uiuo
}
// SetNillableEmail sets the "email" field if the given value is not nil.
func (uiuo *UserIdentityUpdateOne) SetNillableEmail(s *string) *UserIdentityUpdateOne {
if s != nil {
uiuo.SetEmail(*s)
}
return uiuo
}
// SetEmailVerified sets the "email_verified" field.
func (uiuo *UserIdentityUpdateOne) SetEmailVerified(b bool) *UserIdentityUpdateOne {
uiuo.mutation.SetEmailVerified(b)
return uiuo
}
// SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (uiuo *UserIdentityUpdateOne) SetNillableEmailVerified(b *bool) *UserIdentityUpdateOne {
if b != nil {
uiuo.SetEmailVerified(*b)
}
return uiuo
}
// SetName sets the "name" field.
func (uiuo *UserIdentityUpdateOne) SetName(s string) *UserIdentityUpdateOne {
uiuo.mutation.SetName(s)
return uiuo
}
// SetNillableName sets the "name" field if the given value is not nil.
func (uiuo *UserIdentityUpdateOne) SetNillableName(s *string) *UserIdentityUpdateOne {
if s != nil {
uiuo.SetName(*s)
}
return uiuo
}
// ClearName clears the value of the "name" field.
func (uiuo *UserIdentityUpdateOne) ClearName() *UserIdentityUpdateOne {
uiuo.mutation.ClearName()
return uiuo
}
// Mutation returns the UserIdentityMutation object of the builder.
func (uiuo *UserIdentityUpdateOne) Mutation() *UserIdentityMutation {
return uiuo.mutation
}
// Where appends a list predicates to the UserIdentityUpdate builder.
func (uiuo *UserIdentityUpdateOne) Where(ps ...predicate.UserIdentity) *UserIdentityUpdateOne {
uiuo.mutation.Where(ps...)
return uiuo
}
// Select allows selecting one or more fields (columns) of the returned entity.
// The default is selecting all fields defined in the entity schema.
func (uiuo *UserIdentityUpdateOne) Select(field string, fields ...string) *UserIdentityUpdateOne {
uiuo.fields = append([]string{field}, fields...)
return uiuo
}
// Save executes the query and returns the updated UserIdentity entity.
func (uiuo *UserIdentityUpdateOne) Save(ctx context.Context) (*UserIdentity, error) {
uiuo.defaults()
return withHooks(ctx, uiuo.sqlSave, uiuo.mutation, uiuo.hooks)
}
// SaveX is like Save, but panics if an error occurs.
func (uiuo *UserIdentityUpdateOne) SaveX(ctx context.Context) *UserIdentity {
node, err := uiuo.Save(ctx)
if err != nil {
panic(err)
}
return node
}
// Exec executes the query on the entity.
func (uiuo *UserIdentityUpdateOne) Exec(ctx context.Context) error {
_, err := uiuo.Save(ctx)
return err
}
// ExecX is like Exec, but panics if an error occurs.
func (uiuo *UserIdentityUpdateOne) ExecX(ctx context.Context) {
if err := uiuo.Exec(ctx); err != nil {
panic(err)
}
}
// defaults sets the default values of the builder before save.
func (uiuo *UserIdentityUpdateOne) defaults() {
if _, ok := uiuo.mutation.UpdatedAt(); !ok {
v := useridentity.UpdateDefaultUpdatedAt()
uiuo.mutation.SetUpdatedAt(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (uiuo *UserIdentityUpdateOne) check() error {
if v, ok := uiuo.mutation.Iss(); ok {
if err := useridentity.IssValidator(v); err != nil {
return &ValidationError{Name: "iss", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.iss": %w`, err)}
}
}
if v, ok := uiuo.mutation.Sub(); ok {
if err := useridentity.SubValidator(v); err != nil {
return &ValidationError{Name: "sub", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.sub": %w`, err)}
}
}
if v, ok := uiuo.mutation.Email(); ok {
if err := useridentity.EmailValidator(v); err != nil {
return &ValidationError{Name: "email", err: fmt.Errorf(`ent: validator failed for field "UserIdentity.email": %w`, err)}
}
}
if _, ok := uiuo.mutation.UserID(); uiuo.mutation.UserCleared() && !ok {
return errors.New(`ent: clearing a required unique edge "UserIdentity.user"`)
}
return nil
}
func (uiuo *UserIdentityUpdateOne) sqlSave(ctx context.Context) (_node *UserIdentity, err error) {
if err := uiuo.check(); err != nil {
return _node, err
}
_spec := sqlgraph.NewUpdateSpec(useridentity.Table, useridentity.Columns, sqlgraph.NewFieldSpec(useridentity.FieldID, field.TypeUUID))
id, ok := uiuo.mutation.ID()
if !ok {
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "UserIdentity.id" for update`)}
}
_spec.Node.ID.Value = id
if fields := uiuo.fields; len(fields) > 0 {
_spec.Node.Columns = make([]string, 0, len(fields))
_spec.Node.Columns = append(_spec.Node.Columns, useridentity.FieldID)
for _, f := range fields {
if !useridentity.ValidColumn(f) {
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
}
if f != useridentity.FieldID {
_spec.Node.Columns = append(_spec.Node.Columns, f)
}
}
}
if ps := uiuo.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
if value, ok := uiuo.mutation.UpdatedAt(); ok {
_spec.SetField(useridentity.FieldUpdatedAt, field.TypeTime, value)
}
if value, ok := uiuo.mutation.Iss(); ok {
_spec.SetField(useridentity.FieldIss, field.TypeString, value)
}
if value, ok := uiuo.mutation.Sub(); ok {
_spec.SetField(useridentity.FieldSub, field.TypeString, value)
}
if value, ok := uiuo.mutation.Email(); ok {
_spec.SetField(useridentity.FieldEmail, field.TypeString, value)
}
if value, ok := uiuo.mutation.EmailVerified(); ok {
_spec.SetField(useridentity.FieldEmailVerified, field.TypeBool, value)
}
if value, ok := uiuo.mutation.Name(); ok {
_spec.SetField(useridentity.FieldName, field.TypeString, value)
}
if uiuo.mutation.NameCleared() {
_spec.ClearField(useridentity.FieldName, field.TypeString)
}
_node = &UserIdentity{config: uiuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues
if err = sqlgraph.UpdateNode(ctx, uiuo.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{useridentity.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
uiuo.mutation.done = true
return _node, nil
}

View File

@@ -22,6 +22,8 @@ func TestMemoryClientFactory(t *testing.T) {
t.Run("CreateUser", func(t *testing.T) {
uc := client.User.Create().
SetName("Foo").
SetIss("https://login.example.com").
SetSub("1234567890").
SetEmail("foo@example.com")
_, err := uc.Save(context.Background())
assert.NoError(t, err)

View File

@@ -1,259 +0,0 @@
package handler_test
import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"strings"
"testing"
"connectrpc.com/connect"
"connectrpc.com/validate"
"github.com/google/uuid"
"github.com/holos-run/holos/internal/ent"
"github.com/holos-run/holos/internal/server/db"
"github.com/holos-run/holos/internal/server/handler"
"github.com/holos-run/holos/internal/server/middleware/authn"
"github.com/holos-run/holos/internal/server/testutils"
"github.com/holos-run/holos/pkg/holos"
holosSvc "github.com/holos-run/holos/service/gen/holos/v1alpha1"
"github.com/holos-run/holos/service/gen/holos/v1alpha1/holosconnect"
"github.com/stretchr/testify/assert"
)
const (
authHeader = "Authorized-User"
)
func TestHolosService(t *testing.T) {
t.Parallel()
testUserCreateUpdate := func(t *testing.T, client holosconnect.HolosServiceClient) {
t.Run("CreateUser", func(t *testing.T) {
t.Run("registration", func(t *testing.T) {
// The id token claims should be sufficient for user registration. Authenticated
// clients need only pass in the zero value to register themselves.
request, authnIdentity := newAuthenticRequest(&holosSvc.RegisterUserRequest{})
response, err := client.RegisterUser(testutils.LogCtx(t), request)
if err != nil {
t.Errorf("unexpected: %v", err)
} else {
actual := response.Msg.GetUser()
assert.Equal(t, authnIdentity.Name(), actual.GetName(), "name does not match auth claims")
assert.Equal(t, authnIdentity.Email(), actual.GetEmail(), "email does not match auth claims")
}
})
t.Run("name", func(t *testing.T) {
// An authenticated client can set their name.
expected := "Bob"
req, authnIdentity := newAuthenticRequest(&holosSvc.RegisterUserRequest{
Name: &expected,
})
resp, err := client.RegisterUser(testutils.LogCtx(t), req)
if err != nil {
t.Errorf("unexpected: %v", err)
} else {
actual := resp.Msg.GetUser()
assert.Equal(t, expected, actual.GetName(), "name returned does not match request")
assert.Equal(t, authnIdentity.Email(), actual.GetEmail(), "email does not match auth claims")
}
})
t.Run("name_length_limit", func(t *testing.T) {
// Name cannot be longer than 100 characters.
name := strings.Repeat("X", 101)
req, _ := newAuthenticRequest(&holosSvc.RegisterUserRequest{
Name: &name,
})
_, err := client.RegisterUser(testutils.LogCtx(t), req)
if assert.Error(t, err) {
assert.Contains(t, err.Error(), "name: value length must be at most 100 characters")
}
})
})
}
testMatrix := func(t *testing.T, server *httptest.Server) {
run := func(t *testing.T, opts ...connect.ClientOption) {
t.Helper()
client := holosconnect.NewHolosServiceClient(server.Client(), server.URL, opts...)
testUserCreateUpdate(t, client)
}
t.Run("connect", func(t *testing.T) {
t.Run("proto", func(t *testing.T) {
run(t)
})
t.Run("proto_gzip", func(t *testing.T) {
run(t, connect.WithSendGzip())
})
t.Run("json_gzip", func(t *testing.T) {
run(
t,
connect.WithProtoJSON(),
connect.WithSendGzip(),
)
})
})
t.Run("grpc", func(t *testing.T) {
t.Run("proto", func(t *testing.T) {
run(t, connect.WithGRPC())
})
t.Run("proto_gzip", func(t *testing.T) {
run(t, connect.WithGRPC(), connect.WithSendGzip())
})
t.Run("json_gzip", func(t *testing.T) {
run(
t,
connect.WithGRPC(),
connect.WithProtoJSON(),
connect.WithSendGzip(),
)
})
})
t.Run("grpcweb", func(t *testing.T) {
t.Run("proto", func(t *testing.T) {
run(t, connect.WithGRPCWeb())
})
t.Run("proto_gzip", func(t *testing.T) {
run(t, connect.WithGRPCWeb(), connect.WithSendGzip())
})
t.Run("json_gzip", func(t *testing.T) {
run(
t,
connect.WithGRPCWeb(),
connect.WithProtoJSON(),
connect.WithSendGzip(),
)
})
})
}
requestMessageValidator, err := validate.NewInterceptor()
if err != nil {
panic(err)
}
routePath, holosHandler := holosconnect.NewHolosServiceHandler(
// Inject the logger here.
handler.NewHolosHandler(newDatabaseClient(t)),
connect.WithInterceptors(requestMessageValidator),
)
// Add a fake authenticated user to the request context.
mux := http.NewServeMux()
mux.Handle(routePath, http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
holosHandler.ServeHTTP(resp, withAuthContext(t, req))
}))
// Run the test matrix suites
t.Run("http1", func(t *testing.T) {
t.Parallel()
server := httptest.NewServer(mux)
t.Cleanup(server.Close)
testMatrix(t, server)
})
t.Run("http2", func(t *testing.T) {
t.Parallel()
server := httptest.NewUnstartedServer(mux)
server.EnableHTTP2 = true
server.StartTLS()
t.Cleanup(server.Close)
testMatrix(t, server)
})
}
type claims struct {
Issuer string `json:"iss"`
Subject string `json:"sub"`
Email string `json:"email"`
Verified bool `json:"email_verified"`
Name string `json:"name"`
}
// user mocks the authn.Identity stored in the request context by the authn middleware.
type user struct {
claims claims
}
func (u user) Issuer() string {
return u.claims.Issuer
}
func (u user) Subject() string {
return u.claims.Subject
}
func (u user) Name() string {
return u.claims.Name
}
func (u user) Email() string {
return u.claims.Email
}
func (u user) Verified() bool {
return u.claims.Verified
}
// newDatabaseClient returns a new database client for testing.
func newDatabaseClient(t *testing.T) *ent.Client {
cfg := holos.New(holos.Logger(testutils.TestLogger(t)))
// Connect to the database
var dbf db.ClientFactory = db.NewMemoryClientFactory(cfg)
conn, err := dbf.New()
dbClient := conn.Client
if err != nil {
panic(err)
}
// Automatic migration
if err = dbClient.Schema.Create(testutils.LogCtx(t)); err != nil {
panic(err)
}
return dbClient
}
func newUser() user {
sub := uuid.New().String()
usr := user{
claims: claims{
Issuer: "https://example.com",
Subject: sub,
Name: "Alice",
Email: fmt.Sprintf("alice-%s@example.com", sub),
Verified: true,
},
}
return usr
}
// withAuthHeader adds fake authn user info to the request headers to mock
// authorization bearer tokens.
func withAuthHeader[T any](request *connect.Request[T]) user {
usr := newUser()
userJsonBytes, err := json.Marshal(usr.claims)
if err != nil {
panic(err)
}
request.Header().Set(authHeader, string(userJsonBytes))
return usr
}
// newAuthenticRequest returns a request with valid test authorization headers
// for user.
func newAuthenticRequest[T any](message *T) (*connect.Request[T], user) {
request := connect.NewRequest(message)
userIdentity := withAuthHeader(request)
return request, userIdentity
}
// withAuthContext copies fake authn user info from request headers to the
// request context using the same authn.Identity the production authentication
// decorator uses.
func withAuthContext(t *testing.T, request *http.Request) *http.Request {
var usr user
err := json.Unmarshal([]byte(request.Header.Get(authHeader)), &usr.claims)
if assert.NoError(t, err) {
userCtx := authn.NewContext(request.Context(), usr)
return request.WithContext(userCtx)
}
// panic maybe?
return request
}

View File

@@ -6,7 +6,6 @@ import (
"connectrpc.com/connect"
"github.com/holos-run/holos/internal/ent"
"github.com/holos-run/holos/internal/ent/useridentity"
"github.com/holos-run/holos/internal/server/middleware/authn"
"github.com/holos-run/holos/internal/server/middleware/logger"
"github.com/holos-run/holos/pkg/errors"
@@ -14,13 +13,14 @@ import (
)
func createUser(ctx context.Context, client *ent.Client, name string, claims authn.Identity) (*ent.User, error) {
log := logger.FromContext(ctx).With("issue", 127)
log := logger.FromContext(ctx)
// Create the user, error if it already exists
user, err := client.User.
Create().
SetName(name).
SetEmail(claims.Email()).
SetEmailVerified(claims.Verified()).
SetIss(claims.Issuer()).
SetSub(claims.Subject()).
SetName(claims.Name()).
Save(ctx)
if err != nil {
err = connect.NewError(connect.CodeFailedPrecondition, errors.Wrap(err))
@@ -31,32 +31,9 @@ func createUser(ctx context.Context, client *ent.Client, name string, claims aut
log = log.With("user", user)
log.DebugContext(ctx, "created user")
link, err := client.UserIdentity.Create().
SetIss(claims.Issuer()).
SetSub(claims.Subject()).
SetEmail(claims.Email()).
SetEmailVerified(claims.Verified()).
SetName(claims.Name()).
SetUserID(user.ID).
Save(ctx)
if err != nil {
err = connect.NewError(connect.CodeFailedPrecondition, errors.Wrap(err))
log.ErrorContext(ctx, "could not create link", "err", err)
return user, err
}
log = log.With("link", link)
log.DebugContext(ctx, "created link")
return user, nil
}
func updateUser(ctx context.Context, user *ent.User, name *string) (*ent.User, error) {
if name == nil || *name == user.Name {
return user, nil
}
updated, err := user.Update().SetName(*name).Save(ctx)
return updated, errors.Wrap(err)
}
func (h *HolosHandler) RegisterUser(
ctx context.Context,
req *connect.Request[holos.RegisterUserRequest],
@@ -67,39 +44,6 @@ func (h *HolosHandler) RegisterUser(
return nil, connect.NewError(connect.CodePermissionDenied, errors.Wrap(err))
}
// Check if the user exists
entUser, err := h.db.UserIdentity.
Query().
Where(
useridentity.And(
useridentity.Iss(oidc.Issuer()),
useridentity.Sub(oidc.Subject()),
),
).
QueryUser().
Only(ctx)
if err == nil {
log.DebugContext(ctx, "already registered", "status", "exists")
user, err := updateUser(ctx, entUser, req.Msg.Name)
if err != nil {
slog.ErrorContext(ctx, "could not update", "err", err)
return nil, connect.NewError(connect.CodeInternal, err)
}
res := connect.NewResponse(
&holos.RegisterUserResponse{
User: UserToRPC(user),
AlreadyExists: true,
})
return res, nil
}
var notFoundError *ent.NotFoundError
if !errors.As(err, &notFoundError) {
err = connect.NewError(connect.CodeInternal, errors.Wrap(err))
log.ErrorContext(ctx, "could not register", "err", err)
return nil, err
}
log.DebugContext(ctx, "not found needs to be created", "err", err)
var name string
if req.Msg.Name != nil {
name = req.Msg.GetName()

294
internal/token/token.go Normal file
View File

@@ -0,0 +1,294 @@
// Package token obtains, caches, and provides an ID token to authenticate to the holos api server.
package token
import (
"context"
"encoding/json"
"flag"
"fmt"
"log/slog"
"path/filepath"
"strings"
"time"
"github.com/holos-run/holos/pkg/errors"
"github.com/int128/kubelogin/pkg/infrastructure/browser"
"github.com/int128/kubelogin/pkg/infrastructure/clock"
"github.com/int128/kubelogin/pkg/infrastructure/logger"
"github.com/int128/kubelogin/pkg/oidc"
"github.com/int128/kubelogin/pkg/oidc/client"
"github.com/int128/kubelogin/pkg/tlsclientconfig"
"github.com/int128/kubelogin/pkg/tlsclientconfig/loader"
"github.com/int128/kubelogin/pkg/tokencache"
"github.com/int128/kubelogin/pkg/tokencache/repository"
"github.com/int128/kubelogin/pkg/usecases/authentication"
"github.com/int128/kubelogin/pkg/usecases/authentication/authcode"
"github.com/int128/kubelogin/pkg/usecases/authentication/devicecode"
"github.com/int128/kubelogin/pkg/usecases/authentication/ropc"
"github.com/spf13/pflag"
"k8s.io/client-go/util/homedir"
)
var CacheDir = expandHomedir(filepath.Join("~", ".holos", "cache"))
// Token represents an authorization bearer token. Token is useful as an output
// dto of the Tokener service use case.
type Token struct {
// Bearer is the oidc token for the authorization: bearer header
Bearer string
// Expiry is the expiration time of the id token
Expiry time.Time
// Pretty is the JSON encoding of the token claims
Pretty string
// claims represent decoded claims
claims *Claims
}
func (t Token) Claims() *Claims {
if t.claims == nil {
json.Unmarshal([]byte(t.Pretty), &t.claims)
}
return t.claims
}
type Claims struct {
Email string `json:"email"`
Name string `json:"name"`
}
// NewConfig returns a Config with default values.
func NewConfig() Config {
return Config{
Issuer: "https://login.ois.run",
ClientID: "262479925313799528@holos_platform",
Scopes: []string{"openid", "email", "profile", "groups", "offline_access"},
ExtraScopes: []string{"urn:zitadel:iam:org:domain:primary:openinfrastructure.co"},
}
}
type Config struct {
Issuer string
ClientID string
Scopes stringSlice
ExtraScopes stringSlice
ForceRefresh bool
flagSet *flag.FlagSet
}
func (c *Config) FlagSet() *flag.FlagSet {
if c.flagSet != nil {
return c.flagSet
}
flags := flag.NewFlagSet("", flag.ContinueOnError)
flags.StringVar(&c.Issuer, "oidc-issuer", c.Issuer, "oidc token issuer url.")
flags.StringVar(&c.ClientID, "oidc-client-id", c.ClientID, "oidc client id.")
flags.Var(&c.Scopes, "oidc-scopes", "required oidc scopes")
flags.Var(&c.ExtraScopes, "oidc-extra-scopes", "optional oidc scopes")
flags.BoolVar(&c.ForceRefresh, "oidc-force-refresh", c.ForceRefresh, "force refresh")
c.flagSet = flags
return flags
}
// Get returns an oidc token for use as an authorization bearer http header.
func Get(ctx context.Context, log *slog.Logger, cfg Config) (*Token, error) {
var scopes []string
scopes = append(scopes, cfg.Scopes...)
scopes = append(scopes, cfg.ExtraScopes...)
provider := oidc.Provider{
IssuerURL: cfg.Issuer,
ClientID: cfg.ClientID,
UsePKCE: true,
ExtraScopes: scopes,
}
authenticationOptions := authenticationOptions{
GrantType: "auto",
ListenAddress: defaultListenAddress,
AuthenticationTimeoutSec: 180,
RedirectURLHostname: "localhost",
RedirectURLAuthCodeKeyboard: oobRedirectURI,
}
grantOptionSet, err := authenticationOptions.grantOptionSet()
if err != nil {
return nil, errors.Wrap(fmt.Errorf("could not login: %w", err))
}
tlsClientConfig := tlsclientconfig.Config{}
tokenCacheKey := tokencache.Key{
IssuerURL: provider.IssuerURL,
ClientID: provider.ClientID,
ClientSecret: provider.ClientSecret,
ExtraScopes: provider.ExtraScopes,
CACertFilename: strings.Join(tlsClientConfig.CACertFilename, ","),
CACertData: strings.Join(tlsClientConfig.CACertData, ","),
SkipTLSVerify: tlsClientConfig.SkipTLSVerify,
}
if grantOptionSet.ROPCOption != nil {
tokenCacheKey.Username = grantOptionSet.ROPCOption.Username
}
tokenCacheRepository := &repository.Repository{}
cachedTokenSet, err := tokenCacheRepository.FindByKey(CacheDir, tokenCacheKey)
if err != nil {
slog.Debug("could not find a token cache (continuing)", "err", err, "handled", true)
}
// Construct input for the Authentication service use case
authenticationInput := authentication.Input{
Provider: provider,
GrantOptionSet: grantOptionSet,
CachedTokenSet: cachedTokenSet,
TLSClientConfig: tlsClientConfig,
ForceRefresh: cfg.ForceRefresh,
}
var slogger logger.Interface = &holosLogger{log: log}
clock := &clock.Real{}
auth := &authentication.Authentication{
ClientFactory: &client.Factory{
Loader: loader.Loader{},
Clock: clock,
Logger: slogger,
},
Logger: slogger,
Clock: clock,
AuthCodeBrowser: &authcode.Browser{
Browser: &browser.Browser{},
Logger: slogger,
},
}
authenticationOutput, err := auth.Do(ctx, authenticationInput)
if err != nil {
return nil, fmt.Errorf("authentication error: %w", err)
}
idTokenClaims, err := authenticationOutput.TokenSet.DecodeWithoutVerify()
if err != nil {
slog.Debug("could not get token claims", "err", err, "handled", false)
return nil, fmt.Errorf("could not get token claims: %w", err)
}
if authenticationOutput.AlreadyHasValidIDToken {
slog.Debug("existing token valid", "refreshed", 0, "exp", idTokenClaims.Expiry)
} else {
slog.Debug("new token valid", "refreshed", 1, "exp", idTokenClaims.Expiry)
if err := tokenCacheRepository.Save(CacheDir, tokenCacheKey, authenticationOutput.TokenSet); err != nil {
slog.Debug("could not save token cache", "err", err, "handled", 0)
return nil, fmt.Errorf("could not save token cache: %w", err)
}
}
token := &Token{
Bearer: authenticationOutput.TokenSet.IDToken,
Expiry: idTokenClaims.Expiry,
Pretty: idTokenClaims.Pretty,
}
return token, nil
}
var defaultListenAddress = []string{"127.0.0.1:8000", "127.0.0.1:18000"}
var allGrantType = strings.Join([]string{
"auto",
"authcode",
"authcode-keyboard",
"password",
"device-code",
}, "|")
const oobRedirectURI = "urn:ietf:wg:oauth:2.0:oob"
func expandHomedir(s string) string {
if !strings.HasPrefix(s, "~") {
return s
}
return filepath.Join(homedir.HomeDir(), strings.TrimPrefix(s, "~"))
}
type authenticationOptions struct {
GrantType string
ListenAddress []string
AuthenticationTimeoutSec int
SkipOpenBrowser bool
BrowserCommand string
LocalServerCertFile string
LocalServerKeyFile string
OpenURLAfterAuthentication string
RedirectURLHostname string
RedirectURLAuthCodeKeyboard string
AuthRequestExtraParams map[string]string
Username string
Password string
}
func (o *authenticationOptions) grantOptionSet() (s authentication.GrantOptionSet, err error) {
switch {
case o.GrantType == "authcode" || (o.GrantType == "auto" && o.Username == ""):
s.AuthCodeBrowserOption = &authcode.BrowserOption{
BindAddress: o.ListenAddress,
SkipOpenBrowser: o.SkipOpenBrowser,
BrowserCommand: o.BrowserCommand,
AuthenticationTimeout: time.Duration(o.AuthenticationTimeoutSec) * time.Second,
LocalServerCertFile: o.LocalServerCertFile,
LocalServerKeyFile: o.LocalServerKeyFile,
OpenURLAfterAuthentication: o.OpenURLAfterAuthentication,
RedirectURLHostname: o.RedirectURLHostname,
AuthRequestExtraParams: o.AuthRequestExtraParams,
}
case o.GrantType == "authcode-keyboard":
s.AuthCodeKeyboardOption = &authcode.KeyboardOption{
AuthRequestExtraParams: o.AuthRequestExtraParams,
RedirectURL: o.RedirectURLAuthCodeKeyboard,
}
case o.GrantType == "password" || (o.GrantType == "auto" && o.Username != ""):
s.ROPCOption = &ropc.Option{
Username: o.Username,
Password: o.Password,
}
case o.GrantType == "device-code":
s.DeviceCodeOption = &devicecode.Option{
SkipOpenBrowser: o.SkipOpenBrowser,
BrowserCommand: o.BrowserCommand,
}
default:
err = fmt.Errorf("grant-type must be one of (%s)", allGrantType)
}
return
}
// holosLogger implements the int128/kubelogin logger.Interface
type holosLogger struct {
log *slog.Logger
}
func (*holosLogger) AddFlags(f *pflag.FlagSet) {}
func (l *holosLogger) Printf(format string, args ...interface{}) {
l.log.Debug(fmt.Sprintf(format, args...))
}
func (l *holosLogger) Infof(format string, args ...interface{}) {
l.Printf(format, args...)
}
func (l *holosLogger) V(level int) logger.Verbose {
return l
}
func (*holosLogger) IsEnabled(level int) bool {
return true
}
// stringSlice is a comma separated list of string values
type stringSlice []string
func (s *stringSlice) String() string {
return strings.Join((*s)[:], ",")
}
func (s *stringSlice) Set(value string) error {
*s = append(*s, strings.Split(value, ",")...)
return nil
}

View File

@@ -26,5 +26,6 @@ func New(name string) *cobra.Command {
SilenceUsage: true,
SilenceErrors: true,
}
cmd.Flags().SortFlags = false
return cmd
}

47
pkg/cli/login/login.go Normal file
View File

@@ -0,0 +1,47 @@
package login
import (
"context"
"flag"
"fmt"
"log/slog"
"github.com/holos-run/holos/internal/token"
"github.com/holos-run/holos/pkg/cli/command"
"github.com/holos-run/holos/pkg/holos"
"github.com/spf13/cobra"
)
// New returns a new login command.
func New(cfg *holos.Config) *cobra.Command {
cmd := command.New("login")
var printClaims bool
config := token.NewConfig()
cmd.Flags().AddGoFlagSet(config.FlagSet())
fs := &flag.FlagSet{}
fs.BoolVar(&printClaims, "print-claims", false, "print id token claims")
cmd.Flags().AddGoFlagSet(fs)
cmd.RunE = func(c *cobra.Command, args []string) error {
ctx := c.Context()
if ctx == nil {
ctx = context.Background()
}
token, err := token.Get(ctx, cfg.Logger(), config)
if err != nil {
slog.Error("could not get token", "err", err)
return fmt.Errorf("could not get token: %w", err)
}
claims := token.Claims()
slog.Info("logged in as "+claims.Email, "name", claims.Name, "exp", token.Expiry, "email", claims.Email)
if printClaims {
fmt.Fprintln(cmd.OutOrStdout(), token.Pretty)
}
return nil
}
return cmd
}

24
pkg/cli/logout/logout.go Normal file
View File

@@ -0,0 +1,24 @@
package logout
import (
"fmt"
"os"
"github.com/holos-run/holos/internal/token"
"github.com/holos-run/holos/pkg/cli/command"
"github.com/holos-run/holos/pkg/errors"
"github.com/holos-run/holos/pkg/holos"
"github.com/spf13/cobra"
)
func New(cfg *holos.Config) *cobra.Command {
cmd := command.New("logout")
cmd.RunE = func(c *cobra.Command, args []string) error {
if err := os.RemoveAll(token.CacheDir); err != nil {
return errors.Wrap(fmt.Errorf("could not logout: %w", err))
}
cfg.Logger().Info("logged out: removed " + token.CacheDir)
return nil
}
return cmd
}

View File

@@ -11,6 +11,8 @@ import (
"github.com/holos-run/holos/pkg/cli/create"
"github.com/holos-run/holos/pkg/cli/get"
"github.com/holos-run/holos/pkg/cli/kv"
"github.com/holos-run/holos/pkg/cli/login"
"github.com/holos-run/holos/pkg/cli/logout"
"github.com/holos-run/holos/pkg/cli/preflight"
"github.com/holos-run/holos/pkg/cli/render"
"github.com/holos-run/holos/pkg/cli/txtar"
@@ -56,6 +58,8 @@ func New(cfg *holos.Config) *cobra.Command {
rootCmd.AddCommand(get.New(cfg))
rootCmd.AddCommand(create.New(cfg))
rootCmd.AddCommand(preflight.New(cfg))
rootCmd.AddCommand(login.New(cfg))
rootCmd.AddCommand(logout.New(cfg))
// Maybe not needed?
rootCmd.AddCommand(txtar.New(cfg))

View File

@@ -285,7 +285,6 @@ type ServerConfig struct {
listenAndServe bool // --no-serve
listenPort int // --listen-port
metricsPort int // --metrics-port
dbURIFile string // --db-uri-file
databaseURI string
flagSet *flag.FlagSet
}
@@ -328,9 +327,9 @@ func (c *ServerConfig) FlagSet() *flag.FlagSet {
f.StringVar(&c.oidcIssuer, "oidc-issuer", c.oidcIssuer, "oidc issuer url.")
f.Var(&c.oidcAudiences, "oidc-audience", "allowed oidc audiences.")
f.BoolVar(&c.listenAndServe, "serve", true, "listen and serve requests.")
f.StringVar(&c.dbURIFile, "db-uri-file", "", "file path containing the database uri.")
f.IntVar(&c.listenPort, "listen-port", 3000, "service listen port.")
f.IntVar(&c.metricsPort, "metrics-port", 9090, "metrics listen port.")
f.StringVar(&c.databaseURI, "database-url", getenv("DATABASE_URL", c.databaseURI), "database uri (DATABASE_URL)")
c.flagSet = f
return f
}

View File

@@ -1 +1 @@
64
65

View File

@@ -1 +1 @@
2
1

14
tools/tools.go Normal file
View File

@@ -0,0 +1,14 @@
//go:build tools
package tools
// Refer to "How can I track tool dependencies for a module?"
// https://go.dev/wiki/Modules
import (
_ "connectrpc.com/connect/cmd/protoc-gen-connect-go"
_ "github.com/bufbuild/buf/cmd/buf"
_ "github.com/fullstorydev/grpcurl/cmd/grpcurl"
_ "google.golang.org/protobuf/cmd/protoc-gen-go"
_ "honnef.co/go/tools/cmd/staticcheck"
)