Skip to content

Commit 9088b32

Browse files
committed
feat: bump coda version
1 parent 02865a3 commit 9088b32

File tree

3 files changed

+67
-194
lines changed

3 files changed

+67
-194
lines changed

go.mod

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.3
44

55
require (
66
github.com/spf13/cobra v1.9.1
7-
github.com/yosev/coda v0.0.3
7+
github.com/yosev/coda v0.1.0
88
)
99

1010
require (
@@ -26,10 +26,15 @@ require (
2626
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
2727
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
2828
github.com/aws/smithy-go v1.22.2 // indirect
29+
github.com/containrrr/shoutrrr v0.8.0 // indirect
2930
github.com/dlclark/regexp2 v1.10.0 // indirect
31+
github.com/fatih/color v1.17.0 // indirect
32+
github.com/go-resty/resty/v2 v2.16.5 // indirect
3033
github.com/google/uuid v1.6.0 // indirect
3134
github.com/iancoleman/strcase v0.3.0 // indirect
3235
github.com/inconshreveable/mousetrap v1.1.0 // indirect
36+
github.com/mattn/go-colorable v0.1.13 // indirect
37+
github.com/mattn/go-isatty v0.0.20 // indirect
3338
github.com/pkoukk/tiktoken-go v0.1.6 // indirect
3439
github.com/spf13/pflag v1.0.6 // indirect
3540
github.com/tidwall/gjson v1.18.0 // indirect
@@ -39,6 +44,8 @@ require (
3944
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
4045
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
4146
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
47+
golang.org/x/net v0.33.0 // indirect
48+
golang.org/x/sys v0.31.0 // indirect
4249
sigs.k8s.io/yaml v1.4.0 // indirect
4350
)
4451

go.sum

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,50 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 h1:1XuUZ8mYJw9B6lzAkXhqHlJd/Xv
3434
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19/go.mod h1:cQnB8CUnxbMU82JvlqjKR2HBOm3fe9pWorWBza6MBJ4=
3535
github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
3636
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
37+
github.com/containrrr/shoutrrr v0.8.0 h1:mfG2ATzIS7NR2Ec6XL+xyoHzN97H8WPjir8aYzJUSec=
38+
github.com/containrrr/shoutrrr v0.8.0/go.mod h1:ioyQAyu1LJY6sILuNyKaQaw+9Ttik5QePU8atnAdO2o=
3739
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
3840
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3941
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4042
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4143
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
4244
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
45+
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
46+
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
47+
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
48+
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
49+
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
50+
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
51+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
52+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
53+
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
54+
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
4355
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
4456
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4557
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
58+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
59+
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
4660
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
4761
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
4862
github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI=
4963
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
5064
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
5165
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
66+
github.com/jarcoal/httpmock v1.3.0 h1:2RJ8GP0IIaWwcC9Fp2BmVi8Kog3v2Hn7VXM3fTd+nuc=
67+
github.com/jarcoal/httpmock v1.3.0/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
5268
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
5369
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
5470
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
5571
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
72+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
73+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
74+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
75+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
76+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
77+
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
78+
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
79+
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
80+
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
5681
github.com/pkoukk/tiktoken-go v0.1.6 h1:JF0TlJzhTbrI30wCvFuiw6FzP2+/bR+FIxUdgEAcUsw=
5782
github.com/pkoukk/tiktoken-go v0.1.6/go.mod h1:9NiV+i9mJKGj1rYOT+njbv+ZwA/zJxYdewGl6qVatpg=
5883
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -83,8 +108,22 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
83108
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
84109
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
85110
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
86-
github.com/yosev/coda v0.0.3 h1:A0ceEm7koYajb/negy4l1I4w2cQ7umigEerWR4P4RSM=
87-
github.com/yosev/coda v0.0.3/go.mod h1:6DJBYds2kK8iwyzv+oSN3HAPE8RTtY2C4hXZKUyauH4=
111+
github.com/yosev/coda v0.1.0 h1:/oCt9wB68z2gOBR6t2MaHGBnX+g672zXnwOVSIBne6c=
112+
github.com/yosev/coda v0.1.0/go.mod h1:s+d1ZkhrfPApqzwfhqGwcyIvqUI9Z1JTcDU4Bad31c8=
113+
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
114+
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
115+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
116+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
117+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
118+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
119+
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
120+
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
121+
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
122+
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
123+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
124+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
125+
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
126+
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
88127
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
89128
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
90129
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

test.coda.json

Lines changed: 18 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -2,211 +2,38 @@
22
"coda": {
33
"stats": true
44
},
5-
"store": {
6-
"username": "John Doe The Greatest",
7-
"url": "https://api.ipify.org?format=json",
8-
"file": {
9-
"source": "./test.coda.json"
10-
},
11-
"preferences": {
12-
"notifications": true
13-
}
5+
"secrets": {
6+
"url": "https://api.ipify.org?format=json"
147
},
15-
"operations": [
16-
{
8+
"operations": {
9+
"uptime": {
10+
"entrypoint": true,
1711
"action": "os.exec",
1812
"params": {
1913
"command": "/usr/bin/uptime",
2014
"arguments": []
2115
},
16+
"onSuccess": "http.ip",
17+
"async": false,
2218
"store": "exec"
2319
},
24-
{
20+
21+
"http.ip": {
2522
"action": "http.request",
2623
"params": {
27-
"url": "${store.url}",
28-
"headers": {
29-
"X-User-Agent": "coda",
30-
"Content-Type": "application/json"
31-
},
32-
"body": 3,
24+
"url": "${secrets.url}",
3325
"method": "GET"
3426
},
35-
"onFail": [
36-
{
37-
"action": "http.request",
38-
"params": {
39-
"url": "${store.url}",
40-
"headers": {
41-
"X-User-Agent": "coda",
42-
"Content-Type": "application/json"
43-
},
44-
"method": "GET"
45-
},
46-
"store": "apiResponse"
47-
}
48-
],
49-
"store": "apiResponse"
50-
},
51-
{
52-
"action": "string.kebap",
53-
"params": {
54-
"value": "${store.username}"
55-
},
56-
"store": "username"
57-
},
58-
{
59-
"action": "string.upper",
60-
"params": {
61-
"value": "${store.username}"
62-
},
63-
"store": "username"
64-
},
65-
{
66-
"action": "file.size",
67-
"params": {
68-
"source": "${store.file.source}"
69-
},
70-
"store": "filesize"
71-
},
72-
{
73-
"action": "file.modified",
74-
"params": {
75-
"source": "${store.file.source}"
76-
},
77-
"store": "modtime"
78-
},
79-
{
80-
"action": "file.copy",
81-
"params": {
82-
"source": "${store.file.source}",
83-
"destination": "${store.file.source}.copy"
84-
},
85-
"store": "destination"
86-
},
87-
{
88-
"action": "time.sleep",
89-
"params": {
90-
"value": 10
91-
}
92-
},
93-
{
94-
"action": "file.move",
95-
"params": {
96-
"source": "${store.file.source}.copy",
97-
"destination": "${store.file.source}.copy.again"
98-
},
99-
"store": "destination"
100-
},
101-
{
102-
"action": "time.sleep",
103-
"params": {
104-
"value": 10
105-
}
106-
},
107-
{
108-
"action": "file.read",
109-
"params": {
110-
"source": "${store.file.source}.copy.again"
111-
},
112-
"store": "fileContent"
113-
},
114-
{
115-
"action": "file.delete",
116-
"params": {
117-
"source": "${store.file.source}.copy.again"
118-
}
119-
},
120-
{
121-
"action": "file.delete",
122-
"params": {
123-
"source": "${store.file.source}.write"
124-
}
125-
},
126-
{
127-
"action": "time.datetime",
128-
"params": {
129-
"value": "2006-01-02 15:04:05"
130-
},
131-
"store": "dt"
132-
},
133-
{
134-
"action": "time.timestamp.micro",
135-
"store": "ts"
136-
},
137-
{
138-
"action": "hash.sha512",
139-
"params": {
140-
"value": "${store.ts | string}"
141-
},
142-
"store": "tsHashed"
143-
},
144-
{
145-
"action": "hash.base64.encode",
146-
"params": {
147-
"value": "${store.tsHashed}"
148-
},
149-
"store": "tsHashed"
150-
},
151-
{
152-
"action": "os.env.get",
153-
"params": {
154-
"value": "ZSH"
155-
},
156-
"store": "env"
157-
},
158-
{
159-
"action": "string.split",
160-
"params": {
161-
"value": "${store.env}",
162-
"delimiter": "/"
163-
},
164-
"store": "envSplitted"
165-
},
166-
{
167-
"action": "string.join",
168-
"params": {
169-
"value": "${store.envSplitted}",
170-
"delimiter": "/"
171-
},
172-
"store": "envJoined"
173-
},
174-
{
175-
"action": "os.name",
176-
"store": "os"
27+
"onSuccess": "store",
28+
"store": "http"
17729
},
178-
{
179-
"action": "string.reverse",
30+
31+
"store": {
32+
"action": "string",
18033
"params": {
181-
"value": "${store.os}"
34+
"value": "${store.http.body.ip | sha512}"
18235
},
183-
"store": "osReversed"
184-
},
185-
{
186-
"action": "os.arch",
187-
"store": "arch"
188-
},
189-
{
190-
"action": "math.divide",
191-
"params": {
192-
"value": 100,
193-
"amount": 2
194-
},
195-
"store": "amount"
196-
},
197-
{
198-
"action": "math.modulo",
199-
"params": {
200-
"value": 100,
201-
"amount": 32.123
202-
},
203-
"store": "amount"
204-
},
205-
{
206-
"action": "io.stderr",
207-
"params": {
208-
"value": "uptime: ${store.exec.stdout}\nip: ${store.apiResponse.body.ip | split:. | join::}\nfileContentMd5: ${store.fileContent | sha512 | sha256 | sha1 | md5}\nusername: ${store.username}\nnotifications: ${store.preferences.notifications}\nfilesize: ${store.filesize}b\nmodtime: ${store.modtime}\ndatetime: ${store.dt}\ntimestamp: ${store.ts}\nhashedTimestamp: ${store.tsHashed}\nenv: ${store.env}\nenvSplitted: ${store.envSplitted}\nenvJoined: ${store.envSplitted | join:/}\nos: ${store.os}\nosReversed: ${store.osReversed}\narch: ${store.arch | lower | upper}\nmath: ${store.amount}"
209-
}
36+
"store": "http"
21037
}
211-
]
38+
}
21239
}

0 commit comments

Comments
 (0)