-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink-info.txt
153 lines (104 loc) · 4.36 KB
/
link-info.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Select region: Frankfurt, Germany (fra)
Development - Single node, 1x shared CPU, 256MB RAM, 1GB disk
(base) bantwal@Hariprasads-MacBook-Air flyapp % fly pg create
Update available 0.0.450 -> 0.0.464.
Run "fly version update" to upgrade.
? Choose an app name (leave blank to generate one): service-controller
automatically selected personal organization: Hari Bantwal
? Select region: Paris, France (cdg)
? Select configuration: Development - Single node, 1x shared CPU, 256MB RAM, 1GB disk
Creating postgres cluster in organization personal
Creating app...
Setting secrets on app service-controller...
Provisioning 1 of 1 machines with image flyio/postgres:14.6@sha256:9cfb3fafcc1b9bc2df7c901d2ae4a81e83ba224bfe79b11e4dc11bb1838db46e
Waiting for machine to start...
Machine 9080291c695358 is created
==> Monitoring health checks
Waiting for 9080291c695358 to become healthy (started, 3/3)
Postgres cluster service-controller created
Username: postgres
Password: atMJwKPAfR9M6yD
Hostname: service-controller.internal
Proxy port: 5432
Postgres port: 5433
Connection string: postgres://postgres:[email protected]:5432
Save your credentials in a secure place -- you won't be able to see them again!
docker run -p 5050:80 -e PGADMIN_DEFAULT_EMAIL=admin -e PGADMIN_DEFAULT_PASSWORD=admin dpage/pgadmin4
https://fly.io/docs/postgres/connecting/connecting-external/
https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html
docker run -p 5050:80 -e [email protected] -e PGADMIN_DEFAULT_PASSWORD=admin dpage/pgadmin4
-- AWS Side
Enable Tags in resource group
https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-tag-policies.html
aws organizations enable-aws-service-access --service-principal tagpolicies.tag.amazonaws.com
https://dev.to/leoloso/executing-multiple-queries-in-a-single-operation-in-graphql-goe#:~:text=When%20doing%20query%20batching%2C%20the,the%20latency%20from%20multiple%20requests.
import (
"context"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/executor"
"github.com/99designs/gqlgen/graphql/handler"
"github.com/99designs/gqlgen/graphql/playground"
"github.com/99designs/gqlgen/graphql/resolver"
"github.com/99designs/gqlgen/graphql/schema"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/validator"
)
type ExportDirective struct{}
func (d *ExportDirective) Name() string {
return "export"
}
func (d *ExportDirective) Resolve(ctx context.Context, field *schema.Field, args map[string]interface{}, next graphql.Resolver) (interface{}, error) {
// Call the next resolver in the chain
value, err := next(ctx)
if err != nil {
return nil, err
}
// Export the result to the context under the specified name
exportName := field.Directives.ForName("export").Arguments[0].Value.Raw
graphql.AddResultContext(ctx, exportName, value)
// Return the original value
return value, nil
}
func main() {
// Define your GraphQL schema using gqlgen
type Query struct {
User UserResolver
Posts PostsResolver
}
type UserResolver struct{}
func (r *UserResolver) User(ctx context.Context, id int) (*User, error) {
// Implement resolver for User query
}
type PostsResolver struct{}
func (r *PostsResolver) Posts(ctx context.Context, searchfor string) ([]*Post, error) {
// Implement resolver for Posts query
}
// Define the export directive and add it to your schema
cfg := schema.Config{
Query: Query{},
Directives: schema.DirectiveRoot{
Export: &ExportDirective{},
},
}
schema := schema.New(cfg)
// Create a GraphQL handler using gqlgen
srv := handler.NewDefaultServer(schema)
srv.SetQueryResolver(&resolver.DirectiveBased{Resolvers: Query{}})
// Serve the GraphQL API using gqlgen
http.Handle("/", playground.Handler("GraphQL playground", "/query"))
http.Handle("/query", srv)
http.ListenAndServe(":8080", nil)
}
query cloudEstate {
cloudEstateByUUID(uuid: "ce95105a-9e7c-4e78-8082-d503f95c4b4f") {
name @export(as: "_name")
}
}
docker run -e AWS_ACCESS_KEY_ID=<access_key> -e AWS_SECRET_ACCESS_KEY=<secret_key> my-image
import "os"
func main() {
accessKey := os.Getenv("AWS_ACCESS_KEY_ID")
secretKey := os.Getenv("AWS_SECRET_ACCESS_KEY")
// Use the access key and secret key to access AWS services
// ...
}