273 Commits
v0.8.0 ... main

Author SHA1 Message Date
m3o-actions
6b4b4c9980 Commit from m3o/m3o action 2022-03-09 23:21:04 +00:00
m3o-actions
9ae25e0fec Commit from m3o/m3o action 2022-03-09 21:27:07 +00:00
m3o-actions
0882443a5e Commit from m3o/m3o action 2022-03-09 20:20:24 +00:00
m3o-actions
6910f3d25a Commit from m3o/m3o action 2022-03-09 20:18:31 +00:00
m3o-actions
c4eb97765e Commit from m3o/m3o action 2022-03-09 20:15:45 +00:00
m3o-actions
2eb4296382 Commit from m3o/m3o action 2022-03-09 17:11:54 +00:00
m3o-actions
418f914253 Commit from m3o/m3o action 2022-03-09 17:02:01 +00:00
m3o-actions
2fb26f6b55 Commit from m3o/m3o action 2022-03-09 17:00:50 +00:00
m3o-actions
8750a8c59f Commit from m3o/m3o action 2022-03-09 16:31:09 +00:00
m3o-actions
9cbd5c1988 Commit from m3o/m3o action 2022-03-09 11:54:00 +00:00
m3o-actions
465010411d Commit from m3o/m3o action 2022-03-09 11:51:42 +00:00
m3o-actions
885aa8766c Commit from m3o/m3o action 2022-03-09 11:48:10 +00:00
m3o-actions
c0072c24d5 Commit from m3o/m3o action 2022-03-09 11:37:37 +00:00
m3o-actions
041b4ef27d Commit from m3o/m3o action 2022-03-09 08:54:14 +00:00
m3o-actions
eeced0f4bc Commit from m3o/m3o action 2022-03-09 07:43:59 +00:00
m3o-actions
1373d7afea Commit from m3o/m3o action 2022-03-09 07:41:47 +00:00
m3o-actions
aab69f0713 Commit from m3o/m3o action 2022-03-07 20:20:04 +00:00
m3o-actions
6464c39046 Commit from m3o/m3o action 2022-03-07 20:08:46 +00:00
m3o-actions
7ddabee6b5 Commit from m3o/m3o action 2022-03-07 18:09:28 +00:00
m3o-actions
099b92a9b5 Commit from m3o/m3o action 2022-03-07 14:45:54 +00:00
Asim Aslam
a14a8d234a Merge pull request #8 from cyb3rko/cyb3rko-discord-banner
Add Discord banner to README
2022-03-07 12:31:51 +00:00
Niko Diamadis
c84610cd53 Update README with Discord banner 2022-03-07 13:02:11 +01:00
m3o-actions
827b29d2b7 Commit from m3o/m3o action 2022-03-06 12:51:00 +00:00
m3o-actions
5a56ef54e7 Commit from m3o/m3o action 2022-03-03 17:15:58 +00:00
m3o-actions
94e2f8a5a6 Commit from m3o/m3o action 2022-03-03 15:46:41 +00:00
m3o-actions
544f3d2941 Commit from m3o/m3o action 2022-03-03 14:24:45 +00:00
m3o-actions
e8facfabd7 Commit from m3o/m3o action 2022-03-03 14:19:31 +00:00
m3o-actions
dadeda6bb0 Commit from m3o/m3o action 2022-03-03 14:14:33 +00:00
m3o-actions
2b02492525 Commit from m3o/m3o action 2022-03-03 11:49:03 +00:00
m3o-actions
781a433a84 Commit from m3o/m3o action 2022-03-03 10:21:42 +00:00
m3o-actions
a2efcefd8b Commit from m3o/m3o action 2022-03-02 17:15:22 +00:00
m3o-actions
bb0db592be Commit from m3o/m3o action 2022-03-02 17:02:33 +00:00
m3o-actions
beca62373a Commit from m3o/m3o action 2022-03-02 16:46:27 +00:00
m3o-actions
95340f33e9 Commit from m3o/m3o action 2022-03-02 10:44:07 +00:00
m3o-actions
ddef868d22 Commit from m3o/m3o action 2022-03-02 10:19:39 +00:00
m3o-actions
fd8353bc9c Commit from m3o/m3o action 2022-03-02 10:16:25 +00:00
m3o-actions
e56aeee2a7 Commit from m3o/m3o action 2022-03-01 20:39:54 +00:00
m3o-actions
40bb9bcdb3 Commit from m3o/m3o action 2022-03-01 17:11:35 +00:00
m3o-actions
21b9ece648 Commit from m3o/m3o action 2022-03-01 17:03:04 +00:00
m3o-actions
fa7dfe82c6 Commit from m3o/m3o action 2022-03-01 16:46:43 +00:00
m3o-actions
ca3f935e80 Commit from m3o/m3o action 2022-03-01 16:40:47 +00:00
m3o-actions
a2fd26ec51 Commit from m3o/m3o action 2022-03-01 16:32:46 +00:00
m3o-actions
29df5f68d5 Commit from m3o/m3o action 2022-03-01 16:30:35 +00:00
m3o-actions
cd0a0f4059 Commit from m3o/m3o action 2022-03-01 16:24:48 +00:00
m3o-actions
5b5d0b3e59 Commit from m3o/m3o action 2022-03-01 16:21:04 +00:00
m3o-actions
9bd086fd57 Commit from m3o/m3o action 2022-03-01 16:15:13 +00:00
m3o-actions
3225621041 Commit from m3o/m3o action 2022-03-01 16:15:04 +00:00
m3o-actions
489d94445a Commit from m3o/m3o action 2022-03-01 15:57:50 +00:00
m3o-actions
8cc6efd763 Commit from m3o/m3o action 2022-03-01 15:50:46 +00:00
m3o-actions
2485a8b887 Commit from m3o/m3o action 2022-03-01 15:48:51 +00:00
m3o-actions
818f632239 Commit from m3o/m3o action 2022-03-01 09:29:28 +00:00
m3o-actions
e20ce9d6e9 Commit from m3o/m3o action 2022-03-01 09:29:07 +00:00
m3o-actions
0fed9fb4ae Commit from m3o/m3o action 2022-03-01 09:15:35 +00:00
m3o-actions
e259f67996 Commit from m3o/m3o action 2022-02-28 17:55:46 +00:00
m3o-actions
41f154c15d Commit from m3o/m3o action 2022-02-28 17:51:44 +00:00
m3o-actions
f4364042f0 Commit from m3o/m3o action 2022-02-28 17:06:58 +00:00
m3o-actions
becd2f34a6 Commit from m3o/m3o action 2022-02-28 16:17:11 +00:00
m3o-actions
68f3df1004 Commit from m3o/m3o action 2022-02-27 22:41:12 +00:00
m3o-actions
af1231f0c9 Commit from m3o/m3o action 2022-02-27 22:39:27 +00:00
m3o-actions
3dc5ec3324 Commit from m3o/m3o action 2022-02-27 22:09:25 +00:00
m3o-actions
06173570da Commit from m3o/m3o action 2022-02-27 21:57:31 +00:00
m3o-actions
d045a9a5e4 Commit from m3o/m3o action 2022-02-27 21:47:26 +00:00
m3o-actions
fec8cd6c49 Commit from m3o/m3o action 2022-02-25 15:21:54 +00:00
m3o-actions
d935baa7b6 Commit from m3o/m3o action 2022-02-25 13:12:07 +00:00
m3o-actions
b6293c699c Commit from m3o/m3o action 2022-02-25 13:04:30 +00:00
m3o-actions
bcf8833d06 Commit from m3o/m3o action 2022-02-25 12:46:02 +00:00
m3o-actions
341d0e9563 Commit from m3o/m3o action 2022-02-25 12:38:16 +00:00
m3o-actions
8287cc7f53 Commit from m3o/m3o action 2022-02-25 12:26:43 +00:00
m3o-actions
bc29f092b5 Commit from m3o/m3o action 2022-02-25 12:05:16 +00:00
m3o-actions
38aea3724a Commit from m3o/m3o action 2022-02-24 22:04:39 +00:00
m3o-actions
ed46965680 Commit from m3o/m3o action 2022-02-24 18:24:35 +00:00
m3o-actions
c80c59c3cb Commit from m3o/m3o action 2022-02-24 18:23:52 +00:00
m3o-actions
a5c68cd8ab Commit from m3o/m3o action 2022-02-24 16:11:57 +00:00
Asim Aslam
f478825008 delete example 2022-02-24 16:05:10 +00:00
m3o-actions
dc93f7878d Commit from m3o/m3o action 2022-02-24 14:34:03 +00:00
m3o-actions
850f0f9a73 Commit from m3o/m3o action 2022-02-24 12:41:15 +00:00
m3o-actions
805c982135 Commit from m3o/m3o action 2022-02-24 12:15:02 +00:00
m3o-actions
f22a101838 Commit from m3o/m3o action 2022-02-24 12:01:52 +00:00
m3o-actions
70b02fb947 Commit from m3o/m3o action 2022-02-24 11:54:00 +00:00
m3o-actions
e9ccf5fa0f Commit from m3o/m3o action 2022-02-24 11:35:45 +00:00
m3o-actions
1251b49828 Commit from m3o/m3o action 2022-02-24 11:35:33 +00:00
m3o-actions
664e8e8299 Commit from m3o/m3o action 2022-02-24 09:55:54 +00:00
m3o-actions
610b0caa7a Commit from m3o/m3o action 2022-02-24 08:12:04 +00:00
m3o-actions
27aa74905c Commit from m3o/m3o action 2022-02-23 12:59:33 +00:00
m3o-actions
3a183dd2a5 Commit from m3o/m3o action 2022-02-23 12:57:15 +00:00
m3o-actions
daf8202a94 Commit from m3o/m3o action 2022-02-23 12:10:16 +00:00
m3o-actions
e3abb63e40 Commit from m3o/m3o action 2022-02-23 11:56:38 +00:00
m3o-actions
8cfcd5d7d2 Commit from m3o/m3o action 2022-02-22 21:20:08 +00:00
m3o-actions
ba33a517e5 Commit from m3o/m3o action 2022-02-22 21:16:43 +00:00
m3o-actions
3380a01ec6 Commit from m3o/m3o action 2022-02-22 18:23:53 +00:00
m3o-actions
b386520a82 Commit from m3o/m3o action 2022-02-22 15:56:13 +00:00
m3o-actions
41076ed778 Commit from m3o/m3o action 2022-02-22 15:53:41 +00:00
m3o-actions
c7e37bf0f9 Commit from m3o/m3o action 2022-02-22 15:45:18 +00:00
m3o-actions
1e217f2fe6 Commit from m3o/m3o action 2022-02-22 15:42:40 +00:00
m3o-actions
0094140173 Commit from m3o/m3o action 2022-02-22 15:26:29 +00:00
m3o-actions
3dace0f97c Commit from m3o/m3o action 2022-02-22 15:25:43 +00:00
m3o-actions
9328c78184 Commit from m3o/m3o action 2022-02-22 15:25:24 +00:00
m3o-actions
8607d1e6ec Commit from m3o/m3o action 2022-02-22 15:21:30 +00:00
m3o-actions
5a0bb20888 Commit from m3o/m3o action 2022-02-22 09:38:52 +00:00
m3o-actions
716229e84c Commit from m3o/m3o action 2022-02-22 09:17:28 +00:00
m3o-actions
9f21dbac27 Commit from m3o/m3o action 2022-02-22 08:39:05 +00:00
m3o-actions
bf055df06e Commit from m3o/m3o action 2022-02-22 08:32:13 +00:00
m3o-actions
4f9eefd72c Commit from m3o/m3o action 2022-02-22 08:29:01 +00:00
m3o-actions
ad465bab1b Commit from m3o/m3o action 2022-02-21 17:00:20 +00:00
m3o-actions
bf71e8910b Commit from m3o/m3o action 2022-02-21 16:54:05 +00:00
m3o-actions
7d6c343c0c Commit from m3o/m3o action 2022-02-21 16:47:59 +00:00
m3o-actions
006377ced4 Commit from m3o/m3o action 2022-02-21 16:38:00 +00:00
m3o-actions
c18890d567 Commit from m3o/m3o action 2022-02-21 16:23:55 +00:00
m3o-actions
d9ba4f1e81 Commit from m3o/m3o action 2022-02-21 14:55:05 +00:00
m3o-actions
e2c7c21f71 Commit from m3o/m3o action 2022-02-21 14:54:04 +00:00
m3o-actions
39bb32658f Commit from m3o/m3o action 2022-02-21 14:16:06 +00:00
m3o-actions
d9aa0c235b Commit from m3o/m3o action 2022-02-21 14:09:50 +00:00
m3o-actions
93129f6883 Commit from m3o/m3o action 2022-02-21 13:40:57 +00:00
m3o-actions
d976129e73 Commit from m3o/m3o action 2022-02-21 13:32:02 +00:00
m3o-actions
86d710f81e Commit from m3o/m3o action 2022-02-21 13:22:08 +00:00
Asim Aslam
0638da0d21 remove example 2022-02-21 13:17:00 +00:00
m3o-actions
d1352d714d Commit from m3o/m3o action 2022-02-21 13:05:38 +00:00
m3o-actions
9ba50816ab Commit from m3o/m3o action 2022-02-21 12:55:08 +00:00
m3o-actions
1d31086bec Commit from m3o/m3o action 2022-02-21 12:52:58 +00:00
m3o-actions
10d0a9e182 Commit from m3o/m3o action 2022-02-21 12:50:53 +00:00
m3o-actions
e23aea2415 Commit from m3o/m3o action 2022-02-21 12:48:23 +00:00
m3o-actions
fafe078c68 Commit from m3o/m3o action 2022-02-21 12:45:08 +00:00
m3o-actions
bab69e3059 Commit from m3o/m3o action 2022-02-21 12:43:11 +00:00
m3o-actions
aa05f2f678 Commit from m3o/m3o action 2022-02-21 12:35:39 +00:00
m3o-actions
453403a198 Commit from m3o/m3o action 2022-02-21 12:32:45 +00:00
m3o-actions
b580e5270e Commit from m3o/m3o action 2022-02-21 12:27:30 +00:00
m3o-actions
92317e7690 Commit from m3o/m3o action 2022-02-21 12:15:24 +00:00
m3o-actions
c737c0dd9f Commit from m3o/m3o action 2022-02-21 12:11:52 +00:00
m3o-actions
cf4338a959 Commit from m3o/m3o action 2022-02-21 12:04:55 +00:00
m3o-actions
6c61a79774 Commit from m3o/m3o action 2022-02-21 11:44:41 +00:00
m3o-actions
f78928459e Commit from m3o/m3o action 2022-02-21 10:04:04 +00:00
m3o-actions
d96ccfd958 Commit from m3o/m3o action 2022-02-21 09:55:56 +00:00
m3o-actions
46da6257d7 Commit from m3o/m3o action 2022-02-20 22:12:44 +00:00
m3o-actions
e59891fea8 Commit from m3o/m3o action 2022-02-20 22:01:00 +00:00
m3o-actions
0d60904f8a Commit from m3o/m3o action 2022-02-20 21:54:04 +00:00
m3o-actions
a6dc177797 Commit from m3o/m3o action 2022-02-20 21:44:00 +00:00
m3o-actions
29cb72c55b Commit from m3o/m3o action 2022-02-20 18:24:22 +00:00
m3o-actions
48aaa5dbad Commit from m3o/m3o action 2022-02-20 14:19:28 +00:00
m3o-actions
83d47cea87 Commit from m3o/m3o action 2022-02-20 14:08:38 +00:00
m3o-actions
ffe132871c Commit from m3o/m3o action 2022-02-20 12:41:40 +00:00
m3o-actions
facb2a9289 Commit from m3o/m3o action 2022-02-20 12:36:15 +00:00
m3o-actions
2f40c45092 Commit from m3o/m3o action 2022-02-20 12:07:07 +00:00
m3o-actions
c41627014b Commit from m3o/m3o action 2022-02-20 12:02:04 +00:00
m3o-actions
c5749cbf5c Commit from m3o/m3o action 2022-02-20 08:59:06 +00:00
m3o-actions
b5baad9981 Commit from m3o/m3o action 2022-02-20 08:17:35 +00:00
m3o-actions
ac2e4538f1 Commit from m3o/m3o action 2022-02-19 22:30:12 +00:00
m3o-actions
f951b8d2ac Commit from m3o/m3o action 2022-02-19 22:29:45 +00:00
m3o-actions
ead8d22c5f Commit from m3o/m3o action 2022-02-19 22:29:38 +00:00
m3o-actions
a94dc8b071 Commit from m3o/m3o action 2022-02-19 22:29:29 +00:00
m3o-actions
a3e13de758 Commit from m3o/m3o action 2022-02-19 22:28:41 +00:00
m3o-actions
ff159f4ded Commit from m3o/m3o action 2022-02-19 22:11:00 +00:00
m3o-actions
7a9449f921 Commit from m3o/m3o action 2022-02-19 22:07:44 +00:00
m3o-actions
a52e5923dd Commit from m3o/m3o action 2022-02-19 22:03:43 +00:00
m3o-actions
c768003af0 Commit from m3o/m3o action 2022-02-19 21:47:16 +00:00
m3o-actions
5f2ae98a47 Commit from m3o/m3o action 2022-02-19 21:27:57 +00:00
m3o-actions
2bf4cdd6b0 Commit from m3o/m3o action 2022-02-19 21:21:23 +00:00
m3o-actions
f1290e2b67 Commit from m3o/m3o action 2022-02-19 20:47:51 +00:00
m3o-actions
3c113f0f22 Commit from m3o/m3o action 2022-02-19 20:46:21 +00:00
m3o-actions
bdbbff7f50 Commit from m3o/m3o action 2022-02-19 20:35:54 +00:00
m3o-actions
ddbd0b480e Commit from m3o/m3o action 2022-02-19 20:17:40 +00:00
m3o-actions
aaedcafdaa Commit from m3o/m3o action 2022-02-19 18:53:53 +00:00
m3o-actions
90cf4567c8 Commit from m3o/m3o action 2022-02-19 18:03:41 +00:00
m3o-actions
7a39dbb5ad Commit from m3o/m3o action 2022-02-19 18:01:25 +00:00
Asim Aslam
95f8372cb9 remove emoji send 2022-02-19 17:57:11 +00:00
m3o-actions
21d9e25274 Commit from m3o/m3o action 2022-02-19 17:50:34 +00:00
m3o-actions
47b379f500 Commit from m3o/m3o action 2022-02-19 17:46:54 +00:00
m3o-actions
87d036f80d Commit from m3o/m3o action 2022-02-19 17:46:18 +00:00
m3o-actions
5c139aa49a Commit from m3o/m3o action 2022-02-19 17:44:20 +00:00
m3o-actions
8f09a3e936 Commit from m3o/m3o action 2022-02-19 17:44:00 +00:00
m3o-actions
a54d8235d8 Commit from m3o/m3o action 2022-02-19 17:40:18 +00:00
m3o-actions
322e1ef7ad Commit from m3o/m3o action 2022-02-19 16:07:12 +00:00
m3o-actions
e56ddcffa5 Commit from m3o/m3o action 2022-02-19 16:02:48 +00:00
m3o-actions
219931dd30 Commit from m3o/m3o action 2022-02-19 15:46:10 +00:00
m3o-actions
7857517aa3 Commit from m3o/m3o action 2022-02-19 15:37:47 +00:00
m3o-actions
6b7892d67e Commit from m3o/m3o action 2022-02-19 15:32:30 +00:00
m3o-actions
60c598762d Commit from m3o/m3o action 2022-02-19 15:22:20 +00:00
m3o-actions
291fa0ace8 Commit from m3o/m3o action 2022-02-19 15:17:40 +00:00
m3o-actions
2b269fddc4 Commit from m3o/m3o action 2022-02-19 15:16:00 +00:00
m3o-actions
56f9de1f9b Commit from m3o/m3o action 2022-02-19 14:44:24 +00:00
m3o-actions
ebb5f1bad0 Commit from m3o/m3o action 2022-02-19 14:24:50 +00:00
m3o-actions
ce7c51dbe7 Commit from m3o/m3o action 2022-02-19 12:58:52 +00:00
m3o-actions
1794a54039 Commit from m3o/m3o action 2022-02-19 12:43:14 +00:00
m3o-actions
fc050b8ee8 Commit from m3o/m3o action 2022-02-19 12:35:27 +00:00
m3o-actions
e10b8ec3ae Commit from m3o/m3o action 2022-02-19 12:33:39 +00:00
m3o-actions
f52d0c2326 Commit from m3o/m3o action 2022-02-19 12:33:12 +00:00
m3o-actions
632f0d29cb Commit from m3o/m3o action 2022-02-19 12:31:56 +00:00
m3o-actions
d7c3704cdc Commit from m3o/m3o action 2022-02-19 12:15:06 +00:00
m3o-actions
5072f84abf Commit from m3o/m3o action 2022-02-19 11:44:19 +00:00
m3o-actions
dfe8bc8923 Commit from m3o/m3o action 2022-02-19 11:37:31 +00:00
m3o-actions
de9c4adf65 Commit from m3o/m3o action 2022-02-19 09:47:32 +00:00
m3o-actions
18e89c6aaa Commit from m3o/m3o action 2022-02-19 09:33:56 +00:00
m3o-actions
f710c9998f Commit from m3o/m3o action 2022-02-19 09:32:43 +00:00
m3o-actions
c0d318a6c8 Commit from m3o/m3o action 2022-02-19 09:27:07 +00:00
m3o-actions
b04245c5dd Commit from m3o/m3o action 2022-02-19 09:24:38 +00:00
m3o-actions
24a3fbeaad Commit from m3o/m3o action 2022-02-19 09:22:50 +00:00
m3o-actions
270f241c30 Commit from m3o/m3o action 2022-02-19 09:19:02 +00:00
m3o-actions
9218ed3365 Commit from m3o/m3o action 2022-02-18 20:39:45 +00:00
m3o-actions
241a2e8253 Commit from m3o/m3o action 2022-02-18 20:32:01 +00:00
m3o-actions
004c90663d Commit from m3o/m3o action 2022-02-18 19:55:07 +00:00
m3o-actions
398ddc83fb Commit from m3o/m3o action 2022-02-18 19:50:16 +00:00
m3o-actions
c56699c7ac Commit from m3o/m3o action 2022-02-18 17:45:29 +00:00
m3o-actions
5a83458f0b Commit from m3o/m3o action 2022-02-18 16:21:44 +00:00
m3o-actions
a2e3e070ae Commit from m3o/m3o action 2022-02-18 16:15:22 +00:00
m3o-actions
0394044281 Commit from m3o/m3o action 2022-02-18 16:14:52 +00:00
m3o-actions
815ed6c85c Commit from m3o/m3o action 2022-02-18 16:08:57 +00:00
m3o-actions
e5df1d2d4e Commit from m3o/m3o action 2022-02-18 16:06:14 +00:00
m3o-actions
c61e197ab3 Commit from m3o/m3o action 2022-02-18 13:52:52 +00:00
m3o-actions
326a38028d Commit from m3o/m3o action 2022-02-18 13:31:31 +00:00
m3o-actions
59d85ff128 Commit from m3o/m3o action 2022-02-18 13:27:32 +00:00
m3o-actions
1b52ade3cd Commit from m3o/m3o action 2022-02-18 13:26:54 +00:00
m3o-actions
7b49673d15 Commit from m3o/m3o action 2022-02-18 13:03:17 +00:00
m3o-actions
e2cce06b00 Commit from m3o/m3o action 2022-02-18 12:19:53 +00:00
m3o-actions
f109440524 Commit from m3o/m3o action 2022-02-18 12:19:41 +00:00
m3o-actions
f4c1fb6719 Commit from m3o/m3o action 2022-02-18 12:18:49 +00:00
m3o-actions
c64f6e2af6 Commit from m3o/m3o action 2022-02-18 12:16:48 +00:00
m3o-actions
634291e93c Commit from m3o/m3o action 2022-02-18 12:14:14 +00:00
m3o-actions
e2cf2d8234 Commit from m3o/m3o action 2022-02-18 12:12:27 +00:00
m3o-actions
8ac14a5d53 Commit from m3o/m3o action 2022-02-18 12:11:38 +00:00
m3o-actions
8a905ac605 Commit from m3o/m3o action 2022-02-18 12:08:56 +00:00
m3o-actions
c6be7b79d4 Commit from m3o/m3o action 2022-02-18 12:08:20 +00:00
m3o-actions
994cc15926 Commit from m3o/m3o action 2022-02-18 11:55:00 +00:00
m3o-actions
fbcf589c8c Commit from m3o/m3o action 2022-02-18 11:53:25 +00:00
m3o-actions
d4311d3010 Commit from m3o/m3o action 2022-02-18 11:51:51 +00:00
m3o-actions
c45c463e7c Commit from m3o/m3o action 2022-02-18 11:49:40 +00:00
m3o-actions
9fd476dee8 Commit from m3o/m3o action 2022-02-18 11:48:14 +00:00
m3o-actions
3a883ccd4d Commit from m3o/m3o action 2022-02-18 11:40:50 +00:00
m3o-actions
3501f9aedd Commit from m3o/m3o action 2022-02-18 11:31:56 +00:00
m3o-actions
a6ee280b89 Commit from m3o/m3o action 2022-02-18 11:24:50 +00:00
m3o-actions
6c126097a5 Commit from m3o/m3o action 2022-02-18 11:22:56 +00:00
m3o-actions
b5b06f2c54 Commit from m3o/m3o action 2022-02-18 11:22:43 +00:00
m3o-actions
8e06d54c66 Commit from m3o/m3o action 2022-02-18 11:21:41 +00:00
m3o-actions
8a2aa76f81 Commit from m3o/m3o action 2022-02-18 11:20:34 +00:00
m3o-actions
8072676eeb Commit from m3o/m3o action 2022-02-18 11:19:41 +00:00
m3o-actions
18283f6252 Commit from m3o/m3o action 2022-02-18 11:18:21 +00:00
m3o-actions
a30af6f8a8 Commit from m3o/m3o action 2022-02-18 11:17:26 +00:00
m3o-actions
773ca17ff5 Commit from m3o/m3o action 2022-02-18 11:16:18 +00:00
m3o-actions
018ae85f91 Commit from m3o/m3o action 2022-02-18 11:13:00 +00:00
m3o-actions
29b773ac62 Commit from m3o/m3o action 2022-02-17 22:09:04 +00:00
m3o-actions
97ec346c6b Commit from m3o/m3o action 2022-02-17 21:48:58 +00:00
m3o-actions
f8fea92773 Commit from m3o/m3o action 2022-02-17 16:45:54 +00:00
m3o-actions
1fd3edc2c1 Commit from m3o/m3o action 2022-02-17 13:36:26 +00:00
m3o-actions
24b136c46a Commit from m3o/m3o action 2022-02-17 13:28:24 +00:00
m3o-actions
f4da5a864d Commit from m3o/m3o action 2022-02-17 13:27:44 +00:00
m3o-actions
e49c2fc4f5 Commit from m3o/m3o action 2022-02-17 13:25:57 +00:00
m3o-actions
923f60501a Commit from m3o/m3o action 2022-02-17 13:24:06 +00:00
m3o-actions
f6eaea5d63 Commit from m3o/m3o action 2022-02-17 13:22:34 +00:00
m3o-actions
560a7f1a88 Commit from m3o/m3o action 2022-02-17 13:22:07 +00:00
m3o-actions
43b17fede3 Commit from m3o/m3o action 2022-02-17 11:53:44 +00:00
m3o-actions
f838c439a7 Commit from m3o/m3o action 2022-02-16 21:45:47 +00:00
m3o-actions
5f6e71b7d0 Commit from m3o/m3o action 2022-02-16 17:51:13 +00:00
m3o-actions
c8dfc8df56 Commit from m3o/m3o action 2022-02-16 17:49:43 +00:00
m3o-actions
83ac51fe95 Commit from m3o/m3o action 2022-02-16 17:49:23 +00:00
m3o-actions
504423439f Commit from m3o/m3o action 2022-02-16 17:45:13 +00:00
m3o-actions
cf0a9af833 Commit from m3o/m3o action 2022-02-16 17:43:49 +00:00
m3o-actions
7551ba0bd0 Commit from m3o/m3o action 2022-02-16 17:43:19 +00:00
m3o-actions
393a340600 Commit from m3o/m3o action 2022-02-16 17:42:40 +00:00
m3o-actions
6d66ae3935 Commit from m3o/m3o action 2022-02-16 17:40:18 +00:00
m3o-actions
1a0a40d7e1 Commit from m3o/m3o action 2022-02-16 17:39:42 +00:00
m3o-actions
8ba35534a1 Commit from m3o/m3o action 2022-02-16 17:38:59 +00:00
m3o-actions
7576f985d7 Commit from m3o/m3o action 2022-02-16 17:38:07 +00:00
m3o-actions
8252311ba8 Commit from m3o/m3o action 2022-02-16 17:37:21 +00:00
m3o-actions
1876958097 Commit from m3o/m3o action 2022-02-16 17:32:41 +00:00
m3o-actions
47273aa12e Commit from m3o/m3o action 2022-02-16 17:31:52 +00:00
m3o-actions
27de67618d Commit from m3o/m3o action 2022-02-16 17:31:36 +00:00
m3o-actions
8202aef808 Commit from m3o/m3o action 2022-02-16 17:31:27 +00:00
m3o-actions
5df737c1b8 Commit from m3o/m3o action 2022-02-16 17:28:29 +00:00
m3o-actions
4caeae2aa1 Commit from m3o/m3o action 2022-02-16 15:51:55 +00:00
m3o-actions
75c795781b Commit from m3o/m3o action 2022-02-16 15:25:25 +00:00
m3o-actions
ca7a123aa7 Commit from m3o/m3o action 2022-02-16 15:03:44 +00:00
m3o-actions
598164c362 Commit from m3o/m3o action 2022-02-16 11:27:38 +00:00
m3o-actions
4d7767e86a Commit from m3o/m3o action 2022-02-16 10:05:41 +00:00
m3o-actions
4cf3519856 Commit from m3o/m3o action 2022-02-16 09:26:30 +00:00
m3o-actions
8e78e3040b Commit from m3o/m3o action 2022-02-16 08:50:58 +00:00
104 changed files with 4043 additions and 1595 deletions

View File

@@ -1,3 +1,11 @@
<p align="center">
<a href="https://discord.gg/TBR9bRjd6Z">
<img src="https://discordapp.com/api/guilds/861917584437805127/widget.png?style=banner2" alt="Discord Banner"/>
</a>
</p>
---
# M3O Go Client [![godoc](https://godoc.org/github.com/m3o/m3o-go?status.svg)](https://godoc.org/github.com/m3o/m3o-go) [![Go Report Card](https://goreportcard.com/badge/github.com/m3o/m3o-go)](https://goreportcard.com/report/github.com/m3o/m3o-go) [![Apache 2.0 License](https://img.shields.io/github/license/m3o/m3o-go)](https://github.com/m3o/m3o-go/blob/master/LICENSE) # M3O Go Client [![godoc](https://godoc.org/github.com/m3o/m3o-go?status.svg)](https://godoc.org/github.com/m3o/m3o-go) [![Go Report Card](https://goreportcard.com/badge/github.com/m3o/m3o-go)](https://goreportcard.com/report/github.com/m3o/m3o-go) [![Apache 2.0 License](https://img.shields.io/github/license/m3o/m3o-go)](https://github.com/m3o/m3o-go/blob/master/LICENSE)
This is the Go client to access APIs on the M3O Platform This is the Go client to access APIs on the M3O Platform

View File

@@ -205,6 +205,8 @@ type StatusResponse struct {
} }
type UpdateRequest struct { type UpdateRequest struct {
// Additional env vars to update
EnvVars map[string]string `json:"env_vars"`
// name of the app // name of the app
Name string `json:"name"` Name string `json:"name"`
} }

View File

@@ -20,7 +20,7 @@ type AvatarService struct {
client *client.Client client *client.Client
} }
// // Generate an unique avatar
func (t *AvatarService) Generate(request *GenerateRequest) (*GenerateResponse, error) { func (t *AvatarService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{} rsp := &GenerateResponse{}
@@ -29,22 +29,21 @@ func (t *AvatarService) Generate(request *GenerateRequest) (*GenerateResponse, e
} }
type GenerateRequest struct { type GenerateRequest struct {
// encode format of avatar image, `png` or `jpeg`, default is `jpeg` // encode format of avatar image: `png` or `jpeg`; default is `jpeg`
Format string `json:"format"` Format string `json:"format"`
// avatar's gender, `male` or `female`, default is `male` // avatar's gender: `male` or `female`; default is `male`
Gender string `json:"gender"` Gender string `json:"gender"`
// if upload to m3o CDN, default is `false` // set to true to upload to the M3O CDN and receive the url
// if update = true, then it'll return the CDN url
Upload bool `json:"upload"` Upload bool `json:"upload"`
// avatar's username, unique username will generates the unique avatar; // avatar's username, unique username will generate the unique avatar;
// if username == "", will generate a random avatar in every request // if empty, every request generates a random avatar;
// if upload == true, username will be used as CDN filename rather than a random uuid string // if upload == true, username will be the CDN filename rather than a random uuid string
Username string `json:"username"` Username string `json:"username"`
} }
type GenerateResponse struct { type GenerateResponse struct {
// base64encode string of the avatar image // base64 encoded string of the avatar image
Base64 string `json:"base64"` Base64 string `json:"base64"`
// Micro's CDN url of the avatar image // M3O's CDN url of the avatar image
Url string `json:"url"` Url string `json:"url"`
} }

256
chat/chat.go Executable file
View File

@@ -0,0 +1,256 @@
package chat
import (
"go.m3o.com/client"
)
type Chat interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
History(*HistoryRequest) (*HistoryResponse, error)
Invite(*InviteRequest) (*InviteResponse, error)
Join(*JoinRequest) (*JoinResponseStream, error)
Kick(*KickRequest) (*KickResponse, error)
Leave(*LeaveRequest) (*LeaveResponse, error)
List(*ListRequest) (*ListResponse, error)
Send(*SendRequest) (*SendResponse, error)
}
func NewChatService(token string) *ChatService {
return &ChatService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type ChatService struct {
client *client.Client
}
// Create a new chat room
func (t *ChatService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{}
return rsp, t.client.Call("chat", "Create", request, rsp)
}
// Delete a chat room
func (t *ChatService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("chat", "Delete", request, rsp)
}
// List the messages in a chat
func (t *ChatService) History(request *HistoryRequest) (*HistoryResponse, error) {
rsp := &HistoryResponse{}
return rsp, t.client.Call("chat", "History", request, rsp)
}
// Invite a user to a chat room
func (t *ChatService) Invite(request *InviteRequest) (*InviteResponse, error) {
rsp := &InviteResponse{}
return rsp, t.client.Call("chat", "Invite", request, rsp)
}
// Join a chat room
func (t *ChatService) Join(request *JoinRequest) (*JoinResponseStream, error) {
stream, err := t.client.Stream("chat", "Join", request)
if err != nil {
return nil, err
}
return &JoinResponseStream{
stream: stream,
}, nil
}
type JoinResponseStream struct {
stream *client.Stream
}
func (t *JoinResponseStream) Recv() (*JoinResponse, error) {
var rsp JoinResponse
if err := t.stream.Recv(&rsp); err != nil {
return nil, err
}
return &rsp, nil
}
// Kick a user from a chat room
func (t *ChatService) Kick(request *KickRequest) (*KickResponse, error) {
rsp := &KickResponse{}
return rsp, t.client.Call("chat", "Kick", request, rsp)
}
// Leave a chat room
func (t *ChatService) Leave(request *LeaveRequest) (*LeaveResponse, error) {
rsp := &LeaveResponse{}
return rsp, t.client.Call("chat", "Leave", request, rsp)
}
// List available chats
func (t *ChatService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("chat", "List", request, rsp)
}
// Connect to a chat to receive a stream of messages
// Send a message to a chat
func (t *ChatService) Send(request *SendRequest) (*SendResponse, error) {
rsp := &SendResponse{}
return rsp, t.client.Call("chat", "Send", request, rsp)
}
type CreateRequest struct {
// chat description
Description string `json:"description"`
// name of the room
Name string `json:"name"`
// whether its a private room
Private bool `json:"private"`
// optional list of user ids
UserIds string `json:"user_ids"`
}
type CreateResponse struct {
// the unique chat room
Room *Room `json:"room"`
}
type DeleteRequest struct {
// the chat room id to delete
RoomId string `json:"room_id"`
}
type DeleteResponse struct {
Room *Room `json:"room"`
}
type HistoryRequest struct {
// the chat room id to get
RoomId string `json:"room_id"`
}
type HistoryResponse struct {
// messages in the chat room
Messages []Message `json:"messages"`
}
type InviteRequest struct {
// the room id
RoomId string `json:"room_id"`
// the user id
UserId string `json:"user_id"`
}
type InviteResponse struct {
Room *Room `json:"room"`
}
type JoinRequest struct {
// chat room to join
RoomId string `json:"room_id"`
// user id joining
UserId string `json:"user_id"`
}
type JoinResponse struct {
Message *Message `json:"message"`
}
type KickRequest struct {
// the chat room id
RoomId string `json:"room_id"`
// the user id
UserId string `json:"user_id"`
}
type KickResponse struct {
Room *Room `json:"room"`
}
type LeaveRequest struct {
// the chat room id
RoomId string `json:"room_id"`
// the user id
UserId string `json:"user_id"`
}
type LeaveResponse struct {
Room *Room `json:"room"`
}
type ListRequest struct {
// optional user id to filter by
UserId string `json:"user_id"`
}
type ListResponse struct {
Rooms []Room `json:"rooms"`
}
type Message struct {
// a client side id, should be validated by the server to make the request retry safe
Client string `json:"client"`
// id of the message, allocated by the server
Id string `json:"id"`
// id of the chat the message is being sent to / from
RoomId string `json:"room_id"`
// time the message was sent in RFC3339 format
SentAt string `json:"sent_at"`
// subject of the message
Subject string `json:"subject"`
// text of the message
Text string `json:"text"`
// id of the user who sent the message
UserId string `json:"user_id"`
}
type Room struct {
// time of creation
CreatedAt string `json:"created_at"`
// description of the that
Description string `json:"description"`
// unique room id
Id string `json:"id"`
// name of the chat
Name string `json:"name"`
// whether its a private room
Private bool `json:"private"`
// list of users
UserIds string `json:"user_ids"`
}
type SendRequest struct {
// a client side id, should be validated by the server to make the request retry safe
Client string `json:"client"`
// id of the chat room the message is being sent to / from
RoomId string `json:"room_id"`
// subject of the message
Subject string `json:"subject"`
// text of the message
Text string `json:"text"`
// id of the user who sent the message
UserId string `json:"user_id"`
}
type SendResponse struct {
// the message which was created
Message *Message `json:"message"`
}

162
comments/comments.go Executable file
View File

@@ -0,0 +1,162 @@
package comments
import (
"go.m3o.com/client"
)
type Comments interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Events(*EventsRequest) (*EventsResponseStream, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewCommentsService(token string) *CommentsService {
return &CommentsService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type CommentsService struct {
client *client.Client
}
// Create a new comment
func (t *CommentsService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{}
return rsp, t.client.Call("comments", "Create", request, rsp)
}
// Delete a comment
func (t *CommentsService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("comments", "Delete", request, rsp)
}
// Subscribe to comments events
func (t *CommentsService) Events(request *EventsRequest) (*EventsResponseStream, error) {
stream, err := t.client.Stream("comments", "Events", request)
if err != nil {
return nil, err
}
return &EventsResponseStream{
stream: stream,
}, nil
}
type EventsResponseStream struct {
stream *client.Stream
}
func (t *EventsResponseStream) Recv() (*EventsResponse, error) {
var rsp EventsResponse
if err := t.stream.Recv(&rsp); err != nil {
return nil, err
}
return &rsp, nil
}
// List all the comments
func (t *CommentsService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("comments", "List", request, rsp)
}
// Read a comment
func (t *CommentsService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("comments", "Read", request, rsp)
}
// Update a comment
func (t *CommentsService) Update(request *UpdateRequest) (*UpdateResponse, error) {
rsp := &UpdateResponse{}
return rsp, t.client.Call("comments", "Update", request, rsp)
}
type Comment struct {
// time at which the comment was created
Created string `json:"created"`
// unique id for the comment, generated if not specified
Id string `json:"id"`
// subject of the comment
Subject string `json:"subject"`
// text of the comment
Text string `json:"text"`
// time at which the comment was updated
Updated string `json:"updated"`
}
type CreateRequest struct {
// comment subject
Subject string `json:"subject"`
// comment items
Text string `json:"text"`
}
type CreateResponse struct {
// The created comment
Comment *Comment `json:"comment"`
}
type DeleteRequest struct {
// specify the id of the comment
Id string `json:"id"`
}
type DeleteResponse struct {
Comment *Comment `json:"comment"`
}
type EventsRequest struct {
// optionally specify a comment id
Id string `json:"id"`
}
type EventsResponse struct {
// the comment which the operation occured on
Comment *Comment `json:"comment"`
// the event which occured; create, delete, update
Event string `json:"event"`
}
type ListRequest struct {
}
type ListResponse struct {
// the comment of comments
Comments []Comment `json:"comments"`
}
type ReadRequest struct {
// the comment id
Id string `json:"id"`
}
type ReadResponse struct {
// The comment
Comment *Comment `json:"comment"`
}
type UpdateRequest struct {
Comment *Comment `json:"comment"`
}
type UpdateResponse struct {
Comment *Comment `json:"comment"`
}

View File

@@ -24,7 +24,7 @@ type ContactService struct {
client *client.Client client *client.Client
} }
// // Create a contact
func (t *ContactService) Create(request *CreateRequest) (*CreateResponse, error) { func (t *ContactService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{} rsp := &CreateResponse{}
@@ -32,7 +32,7 @@ func (t *ContactService) Create(request *CreateRequest) (*CreateResponse, error)
} }
// // Delete a contact
func (t *ContactService) Delete(request *DeleteRequest) (*DeleteResponse, error) { func (t *ContactService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{} rsp := &DeleteResponse{}
@@ -40,7 +40,7 @@ func (t *ContactService) Delete(request *DeleteRequest) (*DeleteResponse, error)
} }
// // List contacts
func (t *ContactService) List(request *ListRequest) (*ListResponse, error) { func (t *ContactService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{} rsp := &ListResponse{}
@@ -48,7 +48,7 @@ func (t *ContactService) List(request *ListRequest) (*ListResponse, error) {
} }
// // Read contact details
func (t *ContactService) Read(request *ReadRequest) (*ReadResponse, error) { func (t *ContactService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{} rsp := &ReadResponse{}
@@ -56,7 +56,7 @@ func (t *ContactService) Read(request *ReadRequest) (*ReadResponse, error) {
} }
// // Update a contact
func (t *ContactService) Update(request *UpdateRequest) (*UpdateResponse, error) { func (t *ContactService) Update(request *UpdateRequest) (*UpdateResponse, error) {
rsp := &UpdateResponse{} rsp := &UpdateResponse{}

View File

@@ -9,6 +9,7 @@ type Crypto interface {
News(*NewsRequest) (*NewsResponse, error) News(*NewsRequest) (*NewsResponse, error)
Price(*PriceRequest) (*PriceResponse, error) Price(*PriceRequest) (*PriceResponse, error)
Quote(*QuoteRequest) (*QuoteResponse, error) Quote(*QuoteRequest) (*QuoteResponse, error)
Symbols(*SymbolsRequest) (*SymbolsResponse, error)
} }
func NewCryptoService(token string) *CryptoService { func NewCryptoService(token string) *CryptoService {
@@ -55,6 +56,14 @@ func (t *CryptoService) Quote(request *QuoteRequest) (*QuoteResponse, error) {
} }
// Returns the full list of supported symbols
func (t *CryptoService) Symbols(request *SymbolsRequest) (*SymbolsResponse, error) {
rsp := &SymbolsResponse{}
return rsp, t.client.Call("crypto", "Symbols", request, rsp)
}
type Article struct { type Article struct {
// the date published // the date published
Date string `json:"date"` Date string `json:"date"`
@@ -133,3 +142,15 @@ type QuoteResponse struct {
// the UTC timestamp of the quote // the UTC timestamp of the quote
Timestamp string `json:"timestamp"` Timestamp string `json:"timestamp"`
} }
type Symbol struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
}
type SymbolsRequest struct {
}
type SymbolsResponse struct {
Symbols []Symbol `json:"symbols"`
}

View File

@@ -8,7 +8,6 @@ type Emoji interface {
Find(*FindRequest) (*FindResponse, error) Find(*FindRequest) (*FindResponse, error)
Flag(*FlagRequest) (*FlagResponse, error) Flag(*FlagRequest) (*FlagResponse, error)
Print(*PrintRequest) (*PrintResponse, error) Print(*PrintRequest) (*PrintResponse, error)
Send(*SendRequest) (*SendResponse, error)
} }
func NewEmojiService(token string) *EmojiService { func NewEmojiService(token string) *EmojiService {
@@ -48,14 +47,6 @@ func (t *EmojiService) Print(request *PrintRequest) (*PrintResponse, error) {
} }
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
func (t *EmojiService) Send(request *SendRequest) (*SendResponse, error) {
rsp := &SendResponse{}
return rsp, t.client.Call("emoji", "Send", request, rsp)
}
type FindRequest struct { type FindRequest struct {
// the alias code e.g :beer: // the alias code e.g :beer:
Alias string `json:"alias"` Alias string `json:"alias"`
@@ -85,17 +76,3 @@ type PrintResponse struct {
// text with rendered emojis // text with rendered emojis
Text string `json:"text"` Text string `json:"text"`
} }
type SendRequest struct {
// the name of the sender from e.g Alice
From string `json:"from"`
// message to send including emoji aliases
Message string `json:"message"`
// phone number to send to (including international dialing code)
To string `json:"to"`
}
type SendResponse struct {
// whether or not it succeeded
Success bool `json:"success"`
}

View File

@@ -4,6 +4,118 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/app/api](https
Endpoints: Endpoints:
## Resolve
Resolve an app by id to its raw backend endpoint
[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Resolve an app by id to its raw backend endpoint
func ResolveAppById() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Resolve(&app.ResolveRequest{
Id: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Update
Update the app. The latest source code will be downloaded, built and deployed.
[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Update the app. The latest source code will be downloaded, built and deployed.
func UpdateAnApp() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Update(&app.UpdateRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Delete
Delete an app
[https://m3o.com/app/api#Delete](https://m3o.com/app/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Delete an app
func DeleteAnApp() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Delete(&app.DeleteRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Reserve
Reserve apps beyond the free quota. Call Run after.
[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Reserve apps beyond the free quota. Call Run after.
func ReserveAppName() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Reserve(&app.ReserveRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## List ## List
List all the apps List all the apps
@@ -118,115 +230,3 @@ func GetTheStatusOfAnApp() {
} }
``` ```
## Resolve
Resolve an app by id to its raw backend endpoint
[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Resolve an app by id to its raw backend endpoint
func ResolveAppById() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Resolve(&app.ResolveRequest{
Id: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Update
Update the app. The latest source code will be downloaded, built and deployed.
[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Update the app. The latest source code will be downloaded, built and deployed.
func UpdateAnApp() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Update(&app.UpdateRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Delete
Delete an app
[https://m3o.com/app/api#Delete](https://m3o.com/app/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Delete an app
func DeleteAnApp() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Delete(&app.DeleteRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Reserve
Reserve apps beyond the free quota. Call Run after.
[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/app"
)
// Reserve apps beyond the free quota. Call Run after.
func ReserveAppName() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Reserve(&app.ReserveRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```

View File

@@ -6,7 +6,7 @@ Endpoints:
## Generate ## Generate
Generate an unique avatar
[https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate) [https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate)
@@ -21,7 +21,7 @@ import(
"go.m3o.com/avatar" "go.m3o.com/avatar"
) )
// // Generate an unique avatar
func GenerateAvatarAndReturnBase64stringOfTheAvatar() { func GenerateAvatarAndReturnBase64stringOfTheAvatar() {
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN")) avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
rsp, err := avatarService.Generate(&avatar.GenerateRequest{ rsp, err := avatarService.Generate(&avatar.GenerateRequest{
@@ -37,7 +37,7 @@ Username: "",
``` ```
## Generate ## Generate
Generate an unique avatar
[https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate) [https://m3o.com/avatar/api#Generate](https://m3o.com/avatar/api#Generate)
@@ -52,7 +52,7 @@ import(
"go.m3o.com/avatar" "go.m3o.com/avatar"
) )
// // Generate an unique avatar
func GenerateAnAvatarAndUploadTheAvatarToMicrosCdn() { func GenerateAnAvatarAndUploadTheAvatarToMicrosCdn() {
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN")) avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
rsp, err := avatarService.Generate(&avatar.GenerateRequest{ rsp, err := avatarService.Generate(&avatar.GenerateRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/avatar" "go.m3o.com/avatar"
) )
// // Generate an unique avatar
func main() { func main() {
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN")) avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
rsp, err := avatarService.Generate(&avatar.GenerateRequest{ rsp, err := avatarService.Generate(&avatar.GenerateRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/avatar" "go.m3o.com/avatar"
) )
// // Generate an unique avatar
func main() { func main() {
avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN")) avatarService := avatar.NewAvatarService(os.Getenv("M3O_API_TOKEN"))
rsp, err := avatarService.Generate(&avatar.GenerateRequest{ rsp, err := avatarService.Generate(&avatar.GenerateRequest{

View File

@@ -4,35 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/cache/api](htt
Endpoints: Endpoints:
## Increment
Increment a value (if it's a number). If key not found it is equivalent to set.
[https://m3o.com/cache/api#Increment](https://m3o.com/cache/api#Increment)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Increment a value (if it's a number). If key not found it is equivalent to set.
func IncrementAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Increment(&cache.IncrementRequest{
Key: "counter",
Value: 2,
})
fmt.Println(rsp, err)
}
```
## Decrement ## Decrement
Decrement a value (if it's a number). If key not found it is equivalent to set. Decrement a value (if it's a number). If key not found it is equivalent to set.
@@ -174,3 +145,32 @@ func DeleteAvalue() {
} }
``` ```
## Increment
Increment a value (if it's a number). If key not found it is equivalent to set.
[https://m3o.com/cache/api#Increment](https://m3o.com/cache/api#Increment)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Increment a value (if it's a number). If key not found it is equivalent to set.
func IncrementAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Increment(&cache.IncrementRequest{
Key: "counter",
Value: 2,
})
fmt.Println(rsp, err)
}
```

269
examples/chat/README.md Executable file
View File

@@ -0,0 +1,269 @@
# Chat
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/chat/api](https://m3o.com/chat/api).
Endpoints:
## Create
Create a new chat room
[https://m3o.com/chat/api#Create](https://m3o.com/chat/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Create a new chat room
func CreateAnewChat() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Create(&chat.CreateRequest{
Description: "The general chat room",
Name: "general",
})
fmt.Println(rsp, err)
}
```
## Invite
Invite a user to a chat room
[https://m3o.com/chat/api#Invite](https://m3o.com/chat/api#Invite)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Invite a user to a chat room
func InviteAuser() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Invite(&chat.InviteRequest{
})
fmt.Println(rsp, err)
}
```
## Send
Connect to a chat to receive a stream of messages
Send a message to a chat
[https://m3o.com/chat/api#Send](https://m3o.com/chat/api#Send)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Connect to a chat to receive a stream of messages
// Send a message to a chat
func SendAmessage() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Send(&chat.SendRequest{
Client: "web",
Subject: "Random",
Text: "Hey whats up?",
})
fmt.Println(rsp, err)
}
```
## History
List the messages in a chat
[https://m3o.com/chat/api#History](https://m3o.com/chat/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// List the messages in a chat
func GetChatHistory() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.History(&chat.HistoryRequest{
})
fmt.Println(rsp, err)
}
```
## Join
Join a chat room
[https://m3o.com/chat/api#Join](https://m3o.com/chat/api#Join)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Join a chat room
func JoinAroom() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
stream, err := chatService.Join(&chat.JoinRequest{
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}
```
## Kick
Kick a user from a chat room
[https://m3o.com/chat/api#Kick](https://m3o.com/chat/api#Kick)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Kick a user from a chat room
func KickAuserFromAroom() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Kick(&chat.KickRequest{
})
fmt.Println(rsp, err)
}
```
## Leave
Leave a chat room
[https://m3o.com/chat/api#Leave](https://m3o.com/chat/api#Leave)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Leave a chat room
func LeaveAroom() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Leave(&chat.LeaveRequest{
})
fmt.Println(rsp, err)
}
```
## List
List available chats
[https://m3o.com/chat/api#List](https://m3o.com/chat/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// List available chats
func ListChatRooms() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.List(&chat.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a chat room
[https://m3o.com/chat/api#Delete](https://m3o.com/chat/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/chat"
)
// Delete a chat room
func DeleteAchat() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Delete(&chat.DeleteRequest{
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Create a new chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Create(&chat.CreateRequest{
Description: "The general chat room",
Name: "general",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Delete a chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Delete(&chat.DeleteRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// List the messages in a chat
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.History(&chat.HistoryRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Invite a user to a chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Invite(&chat.InviteRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,28 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Join a chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
stream, err := chatService.Join(&chat.JoinRequest{})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Kick a user from a chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Kick(&chat.KickRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Leave a chat room
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Leave(&chat.LeaveRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// List available chats
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.List(&chat.ListRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,20 @@
package main
import (
"fmt"
"os"
"go.m3o.com/chat"
)
// Connect to a chat to receive a stream of messages
// Send a message to a chat
func main() {
chatService := chat.NewChatService(os.Getenv("M3O_API_TOKEN"))
rsp, err := chatService.Send(&chat.SendRequest{
Client: "web",
Subject: "Random",
Text: "Hey whats up?",
})
fmt.Println(rsp, err)
}

190
examples/comments/README.md Executable file
View File

@@ -0,0 +1,190 @@
# Comments
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/comments/api](https://m3o.com/comments/api).
Endpoints:
## Create
Create a new comment
[https://m3o.com/comments/api#Create](https://m3o.com/comments/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// Create a new comment
func CreateAcomment() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Create(&comments.CreateRequest{
Text: "This is my comment",
})
fmt.Println(rsp, err)
}
```
## Read
Read a comment
[https://m3o.com/comments/api#Read](https://m3o.com/comments/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// Read a comment
func ReadAcomment() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Read(&comments.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## List
List all the comments
[https://m3o.com/comments/api#List](https://m3o.com/comments/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// List all the comments
func ListAllComments() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.List(&comments.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Update
Update a comment
[https://m3o.com/comments/api#Update](https://m3o.com/comments/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// Update a comment
func UpdateAcomment() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Update(&comments.UpdateRequest{
Comment: &comments.Comment{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
Subject: "Update Comment",
Text: "Updated comment text",
},
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a comment
[https://m3o.com/comments/api#Delete](https://m3o.com/comments/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// Delete a comment
func DeleteAcomment() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Delete(&comments.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## Events
Subscribe to comments events
[https://m3o.com/comments/api#Events](https://m3o.com/comments/api#Events)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/comments"
)
// Subscribe to comments events
func SubscribeToEvents() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
stream, err := commentsService.Events(&comments.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Create a new comment
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Create(&comments.CreateRequest{
Text: "This is my comment",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Delete a comment
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Delete(&comments.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,30 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Subscribe to comments events
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
stream, err := commentsService.Events(&comments.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// List all the comments
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.List(&comments.ListRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Read a comment
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Read(&comments.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Update a comment
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := commentsService.Update(&comments.UpdateRequest{
Comment: &comments.Comment{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
Subject: "Update Comment",
Text: "Updated comment text",
},
})
fmt.Println(rsp, err)
}

View File

@@ -6,7 +6,7 @@ Endpoints:
## Delete ## Delete
Delete a contact
[https://m3o.com/contact/api#Delete](https://m3o.com/contact/api#Delete) [https://m3o.com/contact/api#Delete](https://m3o.com/contact/api#Delete)
@@ -21,7 +21,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Delete a contact
func DeleteAcontact() { func DeleteAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Delete(&contact.DeleteRequest{ rsp, err := contactService.Delete(&contact.DeleteRequest{
@@ -34,7 +34,7 @@ func DeleteAcontact() {
``` ```
## List ## List
List contacts
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List) [https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
@@ -49,7 +49,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // List contacts
func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() { func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{ rsp, err := contactService.List(&contact.ListRequest{
@@ -61,7 +61,7 @@ func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
``` ```
## List ## List
List contacts
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List) [https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
@@ -76,7 +76,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // List contacts
func ListContactsWithSpecificOffsetAndLimit() { func ListContactsWithSpecificOffsetAndLimit() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{ rsp, err := contactService.List(&contact.ListRequest{
@@ -90,7 +90,7 @@ Offset: 1,
``` ```
## Create ## Create
Create a contact
[https://m3o.com/contact/api#Create](https://m3o.com/contact/api#Create) [https://m3o.com/contact/api#Create](https://m3o.com/contact/api#Create)
@@ -105,7 +105,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Create a contact
func CreateAcontact() { func CreateAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Create(&contact.CreateRequest{ rsp, err := contactService.Create(&contact.CreateRequest{
@@ -140,7 +140,7 @@ contact.Phone{
``` ```
## Update ## Update
Update a contact
[https://m3o.com/contact/api#Update](https://m3o.com/contact/api#Update) [https://m3o.com/contact/api#Update](https://m3o.com/contact/api#Update)
@@ -155,7 +155,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Update a contact
func UpdateAcontact() { func UpdateAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Update(&contact.UpdateRequest{ rsp, err := contactService.Update(&contact.UpdateRequest{
@@ -191,7 +191,7 @@ contact.Phone{
``` ```
## Read ## Read
Read contact details
[https://m3o.com/contact/api#Read](https://m3o.com/contact/api#Read) [https://m3o.com/contact/api#Read](https://m3o.com/contact/api#Read)
@@ -206,7 +206,7 @@ import(
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Read contact details
func GetAcontact() { func GetAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Read(&contact.ReadRequest{ rsp, err := contactService.Read(&contact.ReadRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Create a contact
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Create(&contact.CreateRequest{ rsp, err := contactService.Create(&contact.CreateRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Delete a contact
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Delete(&contact.DeleteRequest{ rsp, err := contactService.Delete(&contact.DeleteRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // List contacts
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{}) rsp, err := contactService.List(&contact.ListRequest{})

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // List contacts
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{ rsp, err := contactService.List(&contact.ListRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Read contact details
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Read(&contact.ReadRequest{ rsp, err := contactService.Read(&contact.ReadRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact" "go.m3o.com/contact"
) )
// // Update a contact
func main() { func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN")) contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Update(&contact.UpdateRequest{ rsp, err := contactService.Update(&contact.UpdateRequest{

View File

@@ -4,62 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/crypto/api](ht
Endpoints: Endpoints:
## Quote
Get the last quote for a given crypto ticker
[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Get the last quote for a given crypto ticker
func GetAcryptocurrencyQuote() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Quote(&crypto.QuoteRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## History
Returns the history for the previous close
[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the history for the previous close
func GetPreviousClose() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.History(&crypto.HistoryRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## News ## News
Get news related to a currency Get news related to a currency
@@ -116,3 +60,86 @@ func GetCryptocurrencyPrice() {
} }
``` ```
## Quote
Get the last quote for a given crypto ticker
[https://m3o.com/crypto/api#Quote](https://m3o.com/crypto/api#Quote)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Get the last quote for a given crypto ticker
func GetAcryptocurrencyQuote() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Quote(&crypto.QuoteRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## History
Returns the history for the previous close
[https://m3o.com/crypto/api#History](https://m3o.com/crypto/api#History)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the history for the previous close
func GetPreviousClose() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.History(&crypto.HistoryRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}
```
## Symbols
Returns the full list of supported symbols
[https://m3o.com/crypto/api#Symbols](https://m3o.com/crypto/api#Symbols)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the full list of supported symbols
func GetListOfAllSupportedSymbols() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Symbols(&crypto.SymbolsRequest{
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/crypto"
)
// Returns the full list of supported symbols
func main() {
cryptoService := crypto.NewCryptoService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cryptoService.Symbols(&crypto.SymbolsRequest{})
fmt.Println(rsp, err)
}

View File

@@ -4,12 +4,12 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/db/api](https:
Endpoints: Endpoints:
## RenameTable ## Create
Rename a table Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
[https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable) [https://m3o.com/db/api#Create](https://m3o.com/db/api#Create)
```go ```go
package example package example
@@ -21,12 +21,49 @@ import(
"go.m3o.com/db" "go.m3o.com/db"
) )
// Rename a table // Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
func RenameTable() { func CreateArecord() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.RenameTable(&db.RenameTableRequest{ rsp, err := dbService.Create(&db.CreateRequest{
From: "examples2", Record: map[string]interface{}{
To: "examples3", "isActive": true,
"id": "1",
"name": "Jane",
"age": 42,
},
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Update
Update a record in the database. Include an "id" in the record to update.
[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Update a record in the database. Include an "id" in the record to update.
func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"id": "1",
"age": 43,
},
Table: "example",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
@@ -62,12 +99,12 @@ Table: "example",
} }
``` ```
## ListTables ## Count
List tables in the DB Count records in a table
[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables) [https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
```go ```go
package example package example
@@ -79,11 +116,12 @@ import(
"go.m3o.com/db" "go.m3o.com/db"
) )
// List tables in the DB // Count records in a table
func ListTables() { func CountEntriesInAtable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{ rsp, err := dbService.Count(&db.CountRequest{
Table: "example",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
@@ -174,12 +212,12 @@ func DropTable() {
} }
``` ```
## Count ## ListTables
Count records in a table List tables in the DB
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count) [https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables)
```go ```go
package example package example
@@ -191,23 +229,22 @@ import(
"go.m3o.com/db" "go.m3o.com/db"
) )
// Count records in a table // List tables in the DB
func CountEntriesInAtable() { func ListTables() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Count(&db.CountRequest{ rsp, err := dbService.ListTables(&db.ListTablesRequest{
Table: "example",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
} }
``` ```
## Create ## RenameTable
Create a record in the database. Optionally include an "id" field otherwise it's set automatically. Rename a table
[https://m3o.com/db/api#Create](https://m3o.com/db/api#Create) [https://m3o.com/db/api#RenameTable](https://m3o.com/db/api#RenameTable)
```go ```go
package example package example
@@ -219,49 +256,12 @@ import(
"go.m3o.com/db" "go.m3o.com/db"
) )
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically. // Rename a table
func CreateArecord() { func RenameTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN")) dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{ rsp, err := dbService.RenameTable(&db.RenameTableRequest{
Record: map[string]interface{}{ From: "examples2",
"id": "1", To: "examples3",
"name": "Jane",
"age": 42,
"isActive": true,
},
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Update
Update a record in the database. Include an "id" in the record to update.
[https://m3o.com/db/api#Update](https://m3o.com/db/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Update a record in the database. Include an "id" in the record to update.
func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"id": "1",
"age": 43,
},
Table: "example",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)

View File

@@ -4,6 +4,38 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/email/api](htt
Endpoints: Endpoints:
## Send
Send an email by passing in from, to, subject, and a text or html body
[https://m3o.com/email/api#Send](https://m3o.com/email/api#Send)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/email"
)
// Send an email by passing in from, to, subject, and a text or html body
func SendEmail() {
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emailService.Send(&email.SendRequest{
From: "Awesome Dot Com",
Subject: "Email verification",
TextBody: `Hi there,
Please verify your email by clicking this link: $micro_verification_link`,
})
fmt.Println(rsp, err)
}
```
## Parse ## Parse
Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>" Parse an RFC5322 address e.g "Joe Blogs <joe@example.com>"
@@ -60,35 +92,3 @@ func ValidateEmail() {
} }
``` ```
## Send
Send an email by passing in from, to, subject, and a text or html body
[https://m3o.com/email/api#Send](https://m3o.com/email/api#Send)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/email"
)
// Send an email by passing in from, to, subject, and a text or html body
func SendEmail() {
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emailService.Send(&email.SendRequest{
From: "Awesome Dot Com",
Subject: "Email verification",
TextBody: `Hi there,
Please verify your email by clicking this link: $micro_verification_link`,
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,36 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/emoji/api](htt
Endpoints: Endpoints:
## Send
Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
[https://m3o.com/emoji/api#Send](https://m3o.com/emoji/api#Send)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/emoji"
)
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
func SendAtextContainingAnEmojiToAnyoneViaSms() {
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emojiService.Send(&emoji.SendRequest{
From: "Alice",
Message: "let's grab a :beer:",
To: "+44782669123",
})
fmt.Println(rsp, err)
}
```
## Find ## Find
Find an emoji by its alias e.g :beer: Find an emoji by its alias e.g :beer:

View File

@@ -1,19 +0,0 @@
package example
import (
"fmt"
"os"
"go.m3o.com/emoji"
)
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
func SendAtextContainingAnEmojiToAnyoneViaSms() {
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emojiService.Send(&emoji.SendRequest{
From: "Alice",
Message: "let's grab a :beer:",
To: "+44782669123",
})
fmt.Println(rsp, err)
}

View File

@@ -1,19 +0,0 @@
package main
import (
"fmt"
"os"
"go.m3o.com/emoji"
)
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
func main() {
emojiService := emoji.NewEmojiService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emojiService.Send(&emoji.SendRequest{
From: "Alice",
Message: "let's grab a :beer:",
To: "+44782669123",
})
fmt.Println(rsp, err)
}

View File

@@ -4,61 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/function/api](
Endpoints: Endpoints:
## List
List all the deployed functions
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// List all the deployed functions
func ListFunctions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Reserve
Reserve function names and resources beyond free quota
[https://m3o.com/function/api#Reserve](https://m3o.com/function/api#Reserve)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Reserve function names and resources beyond free quota
func ReserveAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Reserve(&function.ReserveRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```
## Proxy ## Proxy
Return the backend url for proxying Return the backend url for proxying
@@ -119,37 +64,6 @@ Subfolder: "examples/go-function",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
}
```
## Call
Call a function by name
[https://m3o.com/function/api#Call](https://m3o.com/function/api#Call)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Call a function by name
func CallAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Call(&function.CallRequest{
Name: "helloworld",
Request: map[string]interface{}{
"name": "Alice",
},
})
fmt.Println(rsp, err)
} }
``` ```
## Delete ## Delete
@@ -180,12 +94,12 @@ func DeleteAfunction() {
} }
``` ```
## Describe ## Reserve
Get the info for a deployed function Reserve function names and resources beyond free quota
[https://m3o.com/function/api#Describe](https://m3o.com/function/api#Describe) [https://m3o.com/function/api#Reserve](https://m3o.com/function/api#Reserve)
```go ```go
package example package example
@@ -197,15 +111,42 @@ import(
"go.m3o.com/function" "go.m3o.com/function"
) )
// Get the info for a deployed function // Reserve function names and resources beyond free quota
func DescribeFunctionStatus() { func ReserveAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN")) functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Describe(&function.DescribeRequest{ rsp, err := functionService.Reserve(&function.ReserveRequest{
Name: "helloworld", Name: "helloworld",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
}
```
## Runtimes
Return a list of supported runtimes
[https://m3o.com/function/api#Runtimes](https://m3o.com/function/api#Runtimes)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Return a list of supported runtimes
func ListRuntimes() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Runtimes(&function.RuntimesRequest{
})
fmt.Println(rsp, err)
} }
``` ```
## Regions ## Regions
@@ -263,3 +204,89 @@ func UpdateAfunction() {
} }
``` ```
## Call
Call a function by name
[https://m3o.com/function/api#Call](https://m3o.com/function/api#Call)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Call a function by name
func CallAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Call(&function.CallRequest{
Name: "helloworld",
Request: map[string]interface{}{
"name": "Alice",
},
})
fmt.Println(rsp, err)
}
```
## List
List all the deployed functions
[https://m3o.com/function/api#List](https://m3o.com/function/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// List all the deployed functions
func ListFunctions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.List(&function.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Describe
Get the info for a deployed function
[https://m3o.com/function/api#Describe](https://m3o.com/function/api#Describe)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Get the info for a deployed function
func DescribeFunctionStatus() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Describe(&function.DescribeRequest{
Name: "helloworld",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/function"
)
// Return a list of supported runtimes
func main() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Runtimes(&function.RuntimesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -22,7 +22,7 @@ import(
) )
// Call returns a personalised "Hello $name" response // Call returns a personalised "Hello $name" response
func CallTheHelloworldService() { func CallHelloworld() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
rsp, err := helloworldService.Call(&helloworld.CallRequest{ rsp, err := helloworldService.Call(&helloworld.CallRequest{
Name: "John", Name: "John",
@@ -50,7 +50,7 @@ import(
) )
// Stream returns a stream of "Hello $name" responses // Stream returns a stream of "Hello $name" responses
func StreamsResponsesFromTheServerUsingWebsockets() { func StreamHelloworld() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
stream, err := helloworldService.Stream(&helloworld.StreamRequest{ stream, err := helloworldService.Stream(&helloworld.StreamRequest{

View File

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/helloworld"
)
// Call returns a personalised "Hello $name" response
func main() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
rsp, err := helloworldService.Call(&helloworld.CallRequest{
Name: "John",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,31 @@
package main
import (
"fmt"
"os"
"go.m3o.com/helloworld"
)
// Stream returns a stream of "Hello $name" responses
func main() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
stream, err := helloworldService.Stream(&helloworld.StreamRequest{
Messages: 10,
Name: "John",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}

View File

@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/holidays/api](
Endpoints: Endpoints:
## Countries
Get the list of countries that are supported by this API
[https://m3o.com/holidays/api#Countries](https://m3o.com/holidays/api#Countries)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/holidays"
)
// Get the list of countries that are supported by this API
func ListCountries() {
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{
})
fmt.Println(rsp, err)
}
```
## List ## List
List the holiday dates for a given country and year List the holiday dates for a given country and year
@@ -59,3 +32,30 @@ func GetHolidays() {
} }
``` ```
## Countries
Get the list of countries that are supported by this API
[https://m3o.com/holidays/api#Countries](https://m3o.com/holidays/api#Countries)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/holidays"
)
// Get the list of countries that are supported by this API
func ListCountries() {
holidaysService := holidays.NewHolidaysService(os.Getenv("M3O_API_TOKEN"))
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{
})
fmt.Println(rsp, err)
}
```

187
examples/lists/README.md Executable file
View File

@@ -0,0 +1,187 @@
# Lists
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/lists/api](https://m3o.com/lists/api).
Endpoints:
## Create
Create a new list
[https://m3o.com/lists/api#Create](https://m3o.com/lists/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// Create a new list
func CreateAlist() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Create(&lists.CreateRequest{
})
fmt.Println(rsp, err)
}
```
## Read
Read a list
[https://m3o.com/lists/api#Read](https://m3o.com/lists/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// Read a list
func ReadAlist() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Read(&lists.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## List
List all the lists
[https://m3o.com/lists/api#List](https://m3o.com/lists/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// List all the lists
func ListAllLists() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.List(&lists.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Update
Update a list
[https://m3o.com/lists/api#Update](https://m3o.com/lists/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// Update a list
func UpdateAlist() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Update(&lists.UpdateRequest{
List: &lists.List{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
},
})
fmt.Println(rsp, err)
}
```
## Delete
Delete a list
[https://m3o.com/lists/api#Delete](https://m3o.com/lists/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// Delete a list
func DeleteAlist() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Delete(&lists.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## Events
Subscribe to lists events
[https://m3o.com/lists/api#Events](https://m3o.com/lists/api#Events)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/lists"
)
// Subscribe to lists events
func SubscribeToEvents() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
stream, err := listsService.Events(&lists.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}
```

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// Create a new list
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Create(&lists.CreateRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// Delete a list
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Delete(&lists.DeleteRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,30 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// Subscribe to lists events
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
stream, err := listsService.Events(&lists.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// List all the lists
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.List(&lists.ListRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// Read a list
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Read(&lists.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,19 @@
package main
import (
"fmt"
"os"
"go.m3o.com/lists"
)
// Update a list
func main() {
listsService := lists.NewListsService(os.Getenv("M3O_API_TOKEN"))
rsp, err := listsService.Update(&lists.UpdateRequest{
List: &lists.List{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
},
})
fmt.Println(rsp, err)
}

View File

@@ -4,42 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/location/api](
Endpoints: Endpoints:
## Save
Save an entity's current position
[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/location"
)
// Save an entity's current position
func SaveAnEntity() {
locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN"))
rsp, err := locationService.Save(&location.SaveRequest{
Entity: &location.Entity{
Id: "1",
Location: &location.Point{
Latitude: 51.511061,
Longitude: -0.120022,
Timestamp: 1622802761,
},
Type: "bike",
},
})
fmt.Println(rsp, err)
}
```
## Read ## Read
Read an entity by its ID Read an entity by its ID
@@ -102,3 +66,39 @@ Type: "bike",
} }
``` ```
## Save
Save an entity's current position
[https://m3o.com/location/api#Save](https://m3o.com/location/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/location"
)
// Save an entity's current position
func SaveAnEntity() {
locationService := location.NewLocationService(os.Getenv("M3O_API_TOKEN"))
rsp, err := locationService.Save(&location.SaveRequest{
Entity: &location.Entity{
Id: "1",
Location: &location.Point{
Latitude: 51.511061,
Longitude: -0.120022,
Timestamp: 1622802761,
},
Type: "bike",
},
})
fmt.Println(rsp, err)
}
```

61
examples/meme/README.md Executable file
View File

@@ -0,0 +1,61 @@
# Meme
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/meme/api](https://m3o.com/meme/api).
Endpoints:
## Templates
List the available templates
[https://m3o.com/meme/api#Templates](https://m3o.com/meme/api#Templates)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/meme"
)
// List the available templates
func MemeTemplates() {
memeService := meme.NewMemeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memeService.Templates(&meme.TemplatesRequest{
})
fmt.Println(rsp, err)
}
```
## Generate
[https://m3o.com/meme/api#Generate](https://m3o.com/meme/api#Generate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/meme"
)
//
func GenerateAmeme() {
memeService := meme.NewMemeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memeService.Generate(&meme.GenerateRequest{
Id: "444501",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/meme"
)
//
func main() {
memeService := meme.NewMemeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memeService.Generate(&meme.GenerateRequest{
Id: "444501",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/meme"
)
// List the available templates
func main() {
memeService := meme.NewMemeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memeService.Templates(&meme.TemplatesRequest{})
fmt.Println(rsp, err)
}

61
examples/memegen/README.md Executable file
View File

@@ -0,0 +1,61 @@
# Memegen
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/memegen/api](https://m3o.com/memegen/api).
Endpoints:
## Templates
List the available templates
[https://m3o.com/memegen/api#Templates](https://m3o.com/memegen/api#Templates)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/memegen"
)
// List the available templates
func MemeTemplates() {
memegenService := memegen.NewMemegenService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memegenService.Templates(&memegen.TemplatesRequest{
})
fmt.Println(rsp, err)
}
```
## Generate
Generate a meme using a template
[https://m3o.com/memegen/api#Generate](https://m3o.com/memegen/api#Generate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/memegen"
)
// Generate a meme using a template
func GenerateAmeme() {
memegenService := memegen.NewMemegenService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memegenService.Generate(&memegen.GenerateRequest{
Id: "444501",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/memegen"
)
// Generate a meme using a template
func main() {
memegenService := memegen.NewMemegenService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memegenService.Generate(&memegen.GenerateRequest{
Id: "444501",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/memegen"
)
// List the available templates
func main() {
memegenService := memegen.NewMemegenService(os.Getenv("M3O_API_TOKEN"))
rsp, err := memegenService.Templates(&memegen.TemplatesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -12,9 +12,9 @@ func main() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN")) mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{ rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{ Message: map[string]interface{}{
"user": "john",
"id": "1", "id": "1",
"type": "signup", "type": "signup",
"user": "john",
}, },
Topic: "events", Topic: "events",
}) })

View File

@@ -4,6 +4,61 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/nft/api](https
Endpoints: Endpoints:
## Asset
Get a single asset by the contract
[https://m3o.com/nft/api#Asset](https://m3o.com/nft/api#Asset)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/nft"
)
// Get a single asset by the contract
func GetAsingleAsset() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Asset(&nft.AssetRequest{
})
fmt.Println(rsp, err)
}
```
## Collection
Get a collection by its slug
[https://m3o.com/nft/api#Collection](https://m3o.com/nft/api#Collection)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/nft"
)
// Get a collection by its slug
func GetAsingleCollection() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Collection(&nft.CollectionRequest{
Slug: "doodles-official",
})
fmt.Println(rsp, err)
}
```
## Assets ## Assets
Return a list of assets Return a list of assets

View File

@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
"go.m3o.com/nft"
)
// Get a single asset by the contract
func main() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Asset(&nft.AssetRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/nft"
)
// Get a collection by its slug
func main() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Collection(&nft.CollectionRequest{
Slug: "doodles-official",
})
fmt.Println(rsp, err)
}

View File

@@ -4,90 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/notes/api](htt
Endpoints: Endpoints:
## Create
Create a new note
[https://m3o.com/notes/api#Create](https://m3o.com/notes/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Create a new note
func CreateAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Create(&notes.CreateRequest{
Text: "This is my note",
Title: "New Note",
})
fmt.Println(rsp, err)
}
```
## Read
Read a note
[https://m3o.com/notes/api#Read](https://m3o.com/notes/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Read a note
func ReadAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Read(&notes.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## List
List all the notes
[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// List all the notes
func ListAllNotes() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.List(&notes.ListRequest{
})
fmt.Println(rsp, err)
}
```
## Update ## Update
Update a note Update a note
@@ -189,3 +105,87 @@ func SubscribeToEvents() {
} }
} }
``` ```
## Create
Create a new note
[https://m3o.com/notes/api#Create](https://m3o.com/notes/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Create a new note
func CreateAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Create(&notes.CreateRequest{
Text: "This is my note",
Title: "New Note",
})
fmt.Println(rsp, err)
}
```
## Read
Read a note
[https://m3o.com/notes/api#Read](https://m3o.com/notes/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// Read a note
func ReadAnote() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.Read(&notes.ReadRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
fmt.Println(rsp, err)
}
```
## List
List all the notes
[https://m3o.com/notes/api#List](https://m3o.com/notes/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/notes"
)
// List all the notes
func ListAllNotes() {
notesService := notes.NewNotesService(os.Getenv("M3O_API_TOKEN"))
rsp, err := notesService.List(&notes.ListRequest{
})
fmt.Println(rsp, err)
}
```

66
examples/password/README.md Executable file
View File

@@ -0,0 +1,66 @@
# Password
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/password/api](https://m3o.com/password/api).
Endpoints:
## Generate
Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
[https://m3o.com/password/api#Generate](https://m3o.com/password/api#Generate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func GeneratePassword() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
})
fmt.Println(rsp, err)
}
```
## Generate
Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
[https://m3o.com/password/api#Generate](https://m3o.com/password/api#Generate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func GeneratePasswordWithoutSpecialCharacters() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
Lowercase: true,
Numbers: true,
Special: false,
Uppercase: true,
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func main() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,21 @@
package main
import (
"fmt"
"os"
"go.m3o.com/password"
)
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func main() {
passwordService := password.NewPasswordService(os.Getenv("M3O_API_TOKEN"))
rsp, err := passwordService.Generate(&password.GenerateRequest{
Length: 16,
Lowercase: true,
Numbers: true,
Special: false,
Uppercase: true,
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/ping/api](http
Endpoints: Endpoints:
## Ip
Ping an IP address
[https://m3o.com/ping/api#Ip](https://m3o.com/ping/api#Ip)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping an IP address
func PingAnIp() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Ip(&ping.IpRequest{
Address: "google.com",
})
fmt.Println(rsp, err)
}
```
## Tcp ## Tcp
Ping a TCP port is open Ping a TCP port is open
@@ -60,31 +88,3 @@ func CheckAurl() {
} }
``` ```
## Ip
Ping an IP address
[https://m3o.com/ping/api#Ip](https://m3o.com/ping/api#Ip)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping an IP address
func PingAnIp() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Ip(&ping.IpRequest{
Address: "google.com",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/quran/api](htt
Endpoints: Endpoints:
## Chapters
List the Chapters (surahs) of the Quran
[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/quran"
)
// List the Chapters (surahs) of the Quran
func ListChapters() {
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
rsp, err := quranService.Chapters(&quran.ChaptersRequest{
Language: "en",
})
fmt.Println(rsp, err)
}
```
## Summary ## Summary
Get a summary for a given chapter (surah) Get a summary for a given chapter (surah)
@@ -120,3 +92,31 @@ func SearchTheQuran() {
} }
``` ```
## Chapters
List the Chapters (surahs) of the Quran
[https://m3o.com/quran/api#Chapters](https://m3o.com/quran/api#Chapters)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/quran"
)
// List the Chapters (surahs) of the Quran
func ListChapters() {
quranService := quran.NewQuranService(os.Getenv("M3O_API_TOKEN"))
rsp, err := quranService.Chapters(&quran.ChaptersRequest{
Language: "en",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/rss/api](https
Endpoints: Endpoints:
## Remove
Remove an RSS feed by name
[https://m3o.com/rss/api#Remove](https://m3o.com/rss/api#Remove)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/rss"
)
// Remove an RSS feed by name
func RemoveAfeed() {
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
rsp, err := rssService.Remove(&rss.RemoveRequest{
Name: "bbc",
})
fmt.Println(rsp, err)
}
```
## Add ## Add
Add a new RSS feed with a name, url, and category Add a new RSS feed with a name, url, and category
@@ -89,31 +117,3 @@ func ListRssFeeds() {
} }
``` ```
## Remove
Remove an RSS feed by name
[https://m3o.com/rss/api#Remove](https://m3o.com/rss/api#Remove)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/rss"
)
// Remove an RSS feed by name
func RemoveAfeed() {
rssService := rss.NewRssService(os.Getenv("M3O_API_TOKEN"))
rsp, err := rssService.Remove(&rss.RemoveRequest{
Name: "bbc",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,9 +4,129 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/search/api](ht
Endpoints: Endpoints:
## Index
Index a record i.e. insert a document to search for.
[https://m3o.com/search/api#Index](https://m3o.com/search/api#Index)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Index a record i.e. insert a document to search for.
func IndexArecord() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Index(&search.IndexRequest{
Data: map[string]interface{}{
"starsign": "Leo",
"name": "John Doe",
"age": 37,
},
Index: "customers",
})
fmt.Println(rsp, err)
}
```
## Search
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for records in a given in index
func SearchForArecord() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John'",
})
fmt.Println(rsp, err)
}
```
## Search
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for records in a given in index
func SearchOnMultipleFieldsand() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John' AND starsign == 'Leo'",
})
fmt.Println(rsp, err)
}
```
## Search
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for records in a given in index
func SearchOnMultipleFieldsor() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John' OR name == 'Jane'",
})
fmt.Println(rsp, err)
}
```
## Delete ## Delete
Delete a document given its ID Delete a record given its ID
[https://m3o.com/search/api#Delete](https://m3o.com/search/api#Delete) [https://m3o.com/search/api#Delete](https://m3o.com/search/api#Delete)
@@ -21,8 +141,8 @@ import(
"go.m3o.com/search" "go.m3o.com/search"
) )
// Delete a document given its ID // Delete a record given its ID
func DeleteAdocument() { func DeleteArecord() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN")) searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Delete(&search.DeleteRequest{ rsp, err := searchService.Delete(&search.DeleteRequest{
Id: "1234", Id: "1234",
@@ -89,126 +209,3 @@ func DeleteAnIndex() {
} }
``` ```
## Index
Index a document i.e. insert a document to search for.
[https://m3o.com/search/api#Index](https://m3o.com/search/api#Index)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Index a document i.e. insert a document to search for.
func IndexAdocument() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Index(&search.IndexRequest{
Document: &search.Document{
Contents: map[string]interface{}{
"name": "John Doe",
"age": 37,
"starsign": "Leo",
},
Id: "1234",
},
Index: "customers",
})
fmt.Println(rsp, err)
}
```
## Search
Search for documents in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for documents in a given in index
func SearchForAdocument() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John'",
})
fmt.Println(rsp, err)
}
```
## Search
Search for documents in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for documents in a given in index
func SearchOnMultipleFieldsand() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John' AND starsign == 'Leo'",
})
fmt.Println(rsp, err)
}
```
## Search
Search for documents in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/search"
)
// Search for documents in a given in index
func SearchOnMultipleFieldsor() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John' OR name == 'Jane'",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"go.m3o.com/search"
)
// Delete a record given its ID
func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Delete(&search.DeleteRequest{
Id: "1234",
Index: "customers",
})
fmt.Println(rsp, err)
}

View File

@@ -7,17 +7,14 @@ import (
"go.m3o.com/search" "go.m3o.com/search"
) )
// Index a document i.e. insert a document to search for. // Index a record i.e. insert a document to search for.
func main() { func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN")) searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Index(&search.IndexRequest{ rsp, err := searchService.Index(&search.IndexRequest{
Document: &search.Document{ Data: map[string]interface{}{
Contents: map[string]interface{}{ "starsign": "Leo",
"age": 37, "name": "John Doe",
"starsign": "Leo", "age": 37,
"name": "John Doe",
},
Id: "1234",
}, },
Index: "customers", Index: "customers",
}) })

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"go.m3o.com/search"
)
// Search for records in a given in index
func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
Index: "customers",
Query: "name == 'John'",
})
fmt.Println(rsp, err)
}

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/search" "go.m3o.com/search"
) )
// Search for documents in a given in index // Search for records in a given in index
func main() { func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN")) searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{ rsp, err := searchService.Search(&search.SearchRequest{

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/search" "go.m3o.com/search"
) )
// Search for documents in a given in index // Search for records in a given in index
func main() { func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN")) searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{ rsp, err := searchService.Search(&search.SearchRequest{

View File

@@ -4,120 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/space/api](htt
Endpoints: Endpoints:
## Update
Update an object. If an object with this name does not exist, creates a new one.
[https://m3o.com/space/api#Update](https://m3o.com/space/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Update an object. If an object with this name does not exist, creates a new one.
func UpdateAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Update(&space.UpdateRequest{
Name: "images/file.jpg",
Object: "<file bytes>",
Visibility: "public",
})
fmt.Println(rsp, err)
}
```
## Delete
Delete an object from space
[https://m3o.com/space/api#Delete](https://m3o.com/space/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Delete an object from space
func DeleteAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Delete(&space.DeleteRequest{
Name: "images/file.jpg",
})
fmt.Println(rsp, err)
}
```
## List
List the objects in space
[https://m3o.com/space/api#List](https://m3o.com/space/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// List the objects in space
func ListObjectsWithPrefix() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.List(&space.ListRequest{
Prefix: "images/",
})
fmt.Println(rsp, err)
}
```
## Head
Retrieve meta information about an object
[https://m3o.com/space/api#Head](https://m3o.com/space/api#Head)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Retrieve meta information about an object
func HeadAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Head(&space.HeadRequest{
Name: "images/file.jpg",
})
fmt.Println(rsp, err)
}
```
## Read ## Read
Read an object in space Read an object in space
@@ -232,3 +118,117 @@ Visibility: "public",
} }
``` ```
## Update
Update an object. If an object with this name does not exist, creates a new one.
[https://m3o.com/space/api#Update](https://m3o.com/space/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Update an object. If an object with this name does not exist, creates a new one.
func UpdateAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Update(&space.UpdateRequest{
Name: "images/file.jpg",
Object: "<file bytes>",
Visibility: "public",
})
fmt.Println(rsp, err)
}
```
## Delete
Delete an object from space
[https://m3o.com/space/api#Delete](https://m3o.com/space/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Delete an object from space
func DeleteAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Delete(&space.DeleteRequest{
Name: "images/file.jpg",
})
fmt.Println(rsp, err)
}
```
## List
List the objects in space
[https://m3o.com/space/api#List](https://m3o.com/space/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// List the objects in space
func ListObjectsWithPrefix() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.List(&space.ListRequest{
Prefix: "images/",
})
fmt.Println(rsp, err)
}
```
## Head
Retrieve meta information about an object
[https://m3o.com/space/api#Head](https://m3o.com/space/api#Head)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/space"
)
// Retrieve meta information about an object
func HeadAnObject() {
spaceService := space.NewSpaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := spaceService.Head(&space.HeadRequest{
Name: "images/file.jpg",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,35 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/sunnah/api](ht
Endpoints: Endpoints:
## Chapters
Get all the chapters of a given book within a collection.
[https://m3o.com/sunnah/api#Chapters](https://m3o.com/sunnah/api#Chapters)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/sunnah"
)
// Get all the chapters of a given book within a collection.
func ListTheChaptersInAbook() {
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
rsp, err := sunnahService.Chapters(&sunnah.ChaptersRequest{
Book: 1,
Collection: "bukhari",
})
fmt.Println(rsp, err)
}
```
## Hadiths ## Hadiths
Hadiths returns a list of hadiths and their corresponding text for a Hadiths returns a list of hadiths and their corresponding text for a
@@ -123,3 +94,32 @@ func GetTheBooksWithinAcollection() {
} }
``` ```
## Chapters
Get all the chapters of a given book within a collection.
[https://m3o.com/sunnah/api#Chapters](https://m3o.com/sunnah/api#Chapters)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/sunnah"
)
// Get all the chapters of a given book within a collection.
func ListTheChaptersInAbook() {
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
rsp, err := sunnahService.Chapters(&sunnah.ChaptersRequest{
Book: 1,
Collection: "bukhari",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,6 +4,326 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/user/api](http
Endpoints: Endpoints:
## VerifyToken
Check whether the token attached to MagicLink is valid or not.
Ideally, you need to call this endpoint from your http request
handler that handles the endpoint which is specified in the
SendMagicLink request.
[https://m3o.com/user/api#VerifyToken](https://m3o.com/user/api#VerifyToken)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Check whether the token attached to MagicLink is valid or not.
// Ideally, you need to call this endpoint from your http request
// handler that handles the endpoint which is specified in the
// SendMagicLink request.
func VerifyAtoken() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.VerifyToken(&user.VerifyTokenRequest{
Token: "EdsUiidouJJJLldjlloofUiorkojflsWWdld",
})
fmt.Println(rsp, err)
}
```
## SendVerificationEmail
Send a verification email to a user.
Email "from" will be 'noreply@email.m3ocontent.com'.
The verification link will be injected in the email
as a template variable, $micro_verification_link e.g
'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
The variable will be replaced with a url similar to:
'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
[https://m3o.com/user/api#SendVerificationEmail](https://m3o.com/user/api#SendVerificationEmail)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Send a verification email to a user.
// Email "from" will be 'noreply@email.m3ocontent.com'.
// The verification link will be injected in the email
// as a template variable, $micro_verification_link e.g
// 'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with a url similar to:
// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
func SendVerificationEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendVerificationEmail(&user.SendVerificationEmailRequest{
Email: "joe@example.com",
FailureRedirectUrl: "https://m3o.com/verification-failed",
FromName: "Awesome Dot Com",
RedirectUrl: "https://m3o.com",
Subject: "Email verification",
TextContent: `Hi there,
Please verify your email by clicking this link: $micro_verification_link`,
})
fmt.Println(rsp, err)
}
```
## VerifyEmail
Verify the email address of an account from a token sent in an email to the user.
[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Verify the email address of an account from a token sent in an email to the user.
func VerifyEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
Token: "012345",
})
fmt.Println(rsp, err)
}
```
## List
List all users. Returns a paged list of results
[https://m3o.com/user/api#List](https://m3o.com/user/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// List all users. Returns a paged list of results
func ListAllUsers() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.List(&user.ListRequest{
Limit: 100,
Offset: 0,
})
fmt.Println(rsp, err)
}
```
## SendPasswordResetEmail
Send an email with a verification code to reset password.
Call "ResetPassword" endpoint once user provides the code.
[https://m3o.com/user/api#SendPasswordResetEmail](https://m3o.com/user/api#SendPasswordResetEmail)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Send an email with a verification code to reset password.
// Call "ResetPassword" endpoint once user provides the code.
func SendPasswordResetEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendPasswordResetEmail(&user.SendPasswordResetEmailRequest{
Email: "joe@example.com",
FromName: "Awesome Dot Com",
Subject: "Password reset",
TextContent: `Hi there,
click here to reset your password: myapp.com/reset/code?=$code`,
})
fmt.Println(rsp, err)
}
```
## Login
Login using username or email. The response will return a new session for successful login,
401 in the case of login failure and 500 for any other error
[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Login using username or email. The response will return a new session for successful login,
// 401 in the case of login failure and 500 for any other error
func LogAuserIn() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Login(&user.LoginRequest{
Email: "joe@example.com",
Password: "Password1",
})
fmt.Println(rsp, err)
}
```
## Logout
Logout a user account
[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Logout a user account
func LogAuserOut() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Logout(&user.LogoutRequest{
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}
```
## ReadSession
Read a session by the session id. In the event it has expired or is not found and error is returned.
[https://m3o.com/user/api#ReadSession](https://m3o.com/user/api#ReadSession)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Read a session by the session id. In the event it has expired or is not found and error is returned.
func ReadAsessionByTheSessionId() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ReadSession(&user.ReadSessionRequest{
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}
```
## Update
Update the account username or email
[https://m3o.com/user/api#Update](https://m3o.com/user/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Update the account username or email
func UpdateAnAccount() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Update(&user.UpdateRequest{
Email: "joe+2@example.com",
Id: "user-1",
Username: "joe",
})
fmt.Println(rsp, err)
}
```
## ResetPassword
Reset password with the code sent by the "SendPasswordResetEmail" endpoint.
[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Reset password with the code sent by the "SendPasswordResetEmail" endpoint.
func ResetPassword() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
Code: "012345",
ConfirmPassword: "NewPassword1",
Email: "joe@example.com",
NewPassword: "NewPassword1",
})
fmt.Println(rsp, err)
}
```
## Delete ## Delete
Delete an account by id Delete an account by id
@@ -67,18 +387,12 @@ Click here to access your account $micro_verification_link`,
} }
``` ```
## SendVerificationEmail ## Create
Send a verification email to a user. Create a new user account. The email address and username for the account must be unique.
Email "from" will be 'noreply@email.m3ocontent.com'.
The verification link will be injected in the email
as a template variable, $micro_verification_link e.g
'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
The variable will be replaced with a url similar to:
'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
[https://m3o.com/user/api#SendVerificationEmail](https://m3o.com/user/api#SendVerificationEmail) [https://m3o.com/user/api#Create](https://m3o.com/user/api#Create)
```go ```go
package example package example
@@ -90,24 +404,45 @@ import(
"go.m3o.com/user" "go.m3o.com/user"
) )
// Send a verification email to a user. // Create a new user account. The email address and username for the account must be unique.
// Email "from" will be 'noreply@email.m3ocontent.com'. func CreateAnAccount() {
// The verification link will be injected in the email
// as a template variable, $micro_verification_link e.g
// 'Welcome to M3O! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with a url similar to:
// 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'
func SendVerificationEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendVerificationEmail(&user.SendVerificationEmailRequest{ rsp, err := userService.Create(&user.CreateRequest{
Email: "joe@example.com", Email: "joe@example.com",
FailureRedirectUrl: "https://m3o.com/verification-failed", Id: "user-1",
FromName: "Awesome Dot Com", Password: "Password1",
RedirectUrl: "https://m3o.com", Username: "joe",
Subject: "Email verification",
TextContent: `Hi there,
Please verify your email by clicking this link: $micro_verification_link`, })
fmt.Println(rsp, err)
}
```
## UpdatePassword
Update the account password
[https://m3o.com/user/api#UpdatePassword](https://m3o.com/user/api#UpdatePassword)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Update the account password
func UpdateTheAccountPassword() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.UpdatePassword(&user.UpdatePasswordRequest{
ConfirmPassword: "Password2",
NewPassword: "Password2",
OldPassword: "Password1",
UserId: "user-1",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
@@ -198,337 +533,3 @@ func ReadAccountByEmail() {
} }
``` ```
## UpdatePassword
Update the account password
[https://m3o.com/user/api#UpdatePassword](https://m3o.com/user/api#UpdatePassword)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Update the account password
func UpdateTheAccountPassword() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.UpdatePassword(&user.UpdatePasswordRequest{
ConfirmPassword: "Password2",
NewPassword: "Password2",
OldPassword: "Password1",
UserId: "user-1",
})
fmt.Println(rsp, err)
}
```
## SendPasswordResetEmail
Send an email with a verification code to reset password.
Call "ResetPassword" endpoint once user provides the code.
[https://m3o.com/user/api#SendPasswordResetEmail](https://m3o.com/user/api#SendPasswordResetEmail)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Send an email with a verification code to reset password.
// Call "ResetPassword" endpoint once user provides the code.
func SendPasswordResetEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendPasswordResetEmail(&user.SendPasswordResetEmailRequest{
Email: "joe@example.com",
FromName: "Awesome Dot Com",
Subject: "Password reset",
TextContent: `Hi there,
click here to reset your password: myapp.com/reset/code?=$code`,
})
fmt.Println(rsp, err)
}
```
## VerifyEmail
Verify the email address of an account from a token sent in an email to the user.
[https://m3o.com/user/api#VerifyEmail](https://m3o.com/user/api#VerifyEmail)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Verify the email address of an account from a token sent in an email to the user.
func VerifyEmail() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
Token: "012345",
})
fmt.Println(rsp, err)
}
```
## ReadSession
Read a session by the session id. In the event it has expired or is not found and error is returned.
[https://m3o.com/user/api#ReadSession](https://m3o.com/user/api#ReadSession)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Read a session by the session id. In the event it has expired or is not found and error is returned.
func ReadAsessionByTheSessionId() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ReadSession(&user.ReadSessionRequest{
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}
```
## List
List all users. Returns a paged list of results
[https://m3o.com/user/api#List](https://m3o.com/user/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// List all users. Returns a paged list of results
func ListAllUsers() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.List(&user.ListRequest{
Limit: 100,
Offset: 0,
})
fmt.Println(rsp, err)
}
```
## VerifyToken
Check whether the token attached to MagicLink is valid or not.
Ideally, you need to call this endpoint from your http request
handler that handles the endpoint which is specified in the
SendMagicLink request.
[https://m3o.com/user/api#VerifyToken](https://m3o.com/user/api#VerifyToken)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Check whether the token attached to MagicLink is valid or not.
// Ideally, you need to call this endpoint from your http request
// handler that handles the endpoint which is specified in the
// SendMagicLink request.
func VerifyAtoken() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.VerifyToken(&user.VerifyTokenRequest{
Token: "EdsUiidouJJJLldjlloofUiorkojflsWWdld",
})
fmt.Println(rsp, err)
}
```
## Create
Create a new user account. The email address and username for the account must be unique.
[https://m3o.com/user/api#Create](https://m3o.com/user/api#Create)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Create a new user account. The email address and username for the account must be unique.
func CreateAnAccount() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Create(&user.CreateRequest{
Email: "joe@example.com",
Id: "user-1",
Password: "Password1",
Username: "joe",
})
fmt.Println(rsp, err)
}
```
## ResetPassword
Reset password with the code sent by the "SendPasswordResetEmail" endoint.
[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Reset password with the code sent by the "SendPasswordResetEmail" endoint.
func ResetPassword() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
Code: "012345",
ConfirmPassword: "NewPassword1",
Email: "joe@example.com",
NewPassword: "NewPassword1",
})
fmt.Println(rsp, err)
}
```
## Login
Login using username or email. The response will return a new session for successful login,
401 in the case of login failure and 500 for any other error
[https://m3o.com/user/api#Login](https://m3o.com/user/api#Login)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Login using username or email. The response will return a new session for successful login,
// 401 in the case of login failure and 500 for any other error
func LogAuserIn() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Login(&user.LoginRequest{
Email: "joe@example.com",
Password: "Password1",
})
fmt.Println(rsp, err)
}
```
## Logout
Logout a user account
[https://m3o.com/user/api#Logout](https://m3o.com/user/api#Logout)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Logout a user account
func LogAuserOut() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Logout(&user.LogoutRequest{
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
})
fmt.Println(rsp, err)
}
```
## Update
Update the account username or email
[https://m3o.com/user/api#Update](https://m3o.com/user/api#Update)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Update the account username or email
func UpdateAnAccount() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Update(&user.UpdateRequest{
Email: "joe+2@example.com",
Id: "user-1",
})
fmt.Println(rsp, err)
}
```

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/user" "go.m3o.com/user"
) )
// Reset password with the code sent by the "SendPasswordResetEmail" endoint. // Reset password with the code sent by the "SendPasswordResetEmail" endpoint.
func main() { func main() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{ rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{

View File

@@ -11,8 +11,9 @@ import (
func main() { func main() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN")) userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.Update(&user.UpdateRequest{ rsp, err := userService.Update(&user.UpdateRequest{
Email: "joe+2@example.com", Email: "joe+2@example.com",
Id: "user-1", Id: "user-1",
Username: "joe",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
} }

View File

@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/youtube/api](h
Endpoints: Endpoints:
## Search
Search for videos on YouTube
[https://m3o.com/youtube/api#Search](https://m3o.com/youtube/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/youtube"
)
// Search for videos on YouTube
func SearchForVideos() {
youtubeService := youtube.NewYoutubeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := youtubeService.Search(&youtube.SearchRequest{
Query: "donuts",
})
fmt.Println(rsp, err)
}
```
## Embed ## Embed
Embed a YouTube video Embed a YouTube video
@@ -60,3 +32,31 @@ func EmbedAyoutubeVideo() {
} }
``` ```
## Search
Search for videos on YouTube
[https://m3o.com/youtube/api#Search](https://m3o.com/youtube/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/youtube"
)
// Search for videos on YouTube
func SearchForVideos() {
youtubeService := youtube.NewYoutubeService(os.Getenv("M3O_API_TOKEN"))
rsp, err := youtubeService.Search(&youtube.SearchRequest{
Query: "donuts",
})
fmt.Println(rsp, err)
}
```

View File

@@ -13,6 +13,7 @@ type Function interface {
Proxy(*ProxyRequest) (*ProxyResponse, error) Proxy(*ProxyRequest) (*ProxyResponse, error)
Regions(*RegionsRequest) (*RegionsResponse, error) Regions(*RegionsRequest) (*RegionsResponse, error)
Reserve(*ReserveRequest) (*ReserveResponse, error) Reserve(*ReserveRequest) (*ReserveResponse, error)
Runtimes(*RuntimesRequest) (*RuntimesResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error) Update(*UpdateRequest) (*UpdateResponse, error)
} }
@@ -92,6 +93,14 @@ func (t *FunctionService) Reserve(request *ReserveRequest) (*ReserveResponse, er
} }
// Return a list of supported runtimes
func (t *FunctionService) Runtimes(request *RuntimesRequest) (*RuntimesResponse, error) {
rsp := &RuntimesResponse{}
return rsp, t.client.Call("function", "Runtimes", request, rsp)
}
// Update a function. Downloads the source, builds and redeploys // Update a function. Downloads the source, builds and redeploys
func (t *FunctionService) Update(request *UpdateRequest) (*UpdateResponse, error) { func (t *FunctionService) Update(request *UpdateRequest) (*UpdateResponse, error) {
@@ -132,13 +141,15 @@ type DeployRequest struct {
Name string `json:"name"` Name string `json:"name"`
// region to deploy in. defaults to europe-west1 // region to deploy in. defaults to europe-west1
Region string `json:"region"` Region string `json:"region"`
// github url to repo // github url for a repo
Repo string `json:"repo"` Repo string `json:"repo"`
// runtime/lanaguage of the function e.g php74, // runtime/lanaguage of the function e.g php74,
// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16, // nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16,
// dotnet3, java11, ruby26, ruby27, go111, go113, go116, // dotnet3, java11, ruby26, ruby27, go111, go113, go116,
// python37, python38, python39 // python37, python38, python39
Runtime string `json:"runtime"` Runtime string `json:"runtime"`
// inline source code
Source string `json:"source"`
// optional subfolder path // optional subfolder path
Subfolder string `json:"subfolder"` Subfolder string `json:"subfolder"`
} }
@@ -180,6 +191,8 @@ type Func struct {
// dotnet3, java11, ruby26, ruby27, go111, go113, go116, // dotnet3, java11, ruby26, ruby27, go111, go113, go116,
// python37, python38, python39 // python37, python38, python39
Runtime string `json:"runtime"` Runtime string `json:"runtime"`
// the source code
Source string `json:"source"`
// eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc // eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc
Status string `json:"status"` Status string `json:"status"`
// subfolder path to entrypoint // subfolder path to entrypoint
@@ -238,9 +251,18 @@ type ReserveResponse struct {
Reservation *Reservation `json:"reservation"` Reservation *Reservation `json:"reservation"`
} }
type RuntimesRequest struct {
}
type RuntimesResponse struct {
Runtimes []string `json:"runtimes"`
}
type UpdateRequest struct { type UpdateRequest struct {
// function name // function name
Name string `json:"name"` Name string `json:"name"`
// inline source code
Source string `json:"source"`
} }
type UpdateResponse struct { type UpdateResponse struct {

162
lists/lists.go Executable file
View File

@@ -0,0 +1,162 @@
package lists
import (
"go.m3o.com/client"
)
type Lists interface {
Create(*CreateRequest) (*CreateResponse, error)
Delete(*DeleteRequest) (*DeleteResponse, error)
Events(*EventsRequest) (*EventsResponseStream, error)
List(*ListRequest) (*ListResponse, error)
Read(*ReadRequest) (*ReadResponse, error)
Update(*UpdateRequest) (*UpdateResponse, error)
}
func NewListsService(token string) *ListsService {
return &ListsService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type ListsService struct {
client *client.Client
}
// Create a new list
func (t *ListsService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{}
return rsp, t.client.Call("lists", "Create", request, rsp)
}
// Delete a list
func (t *ListsService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("lists", "Delete", request, rsp)
}
// Subscribe to lists events
func (t *ListsService) Events(request *EventsRequest) (*EventsResponseStream, error) {
stream, err := t.client.Stream("lists", "Events", request)
if err != nil {
return nil, err
}
return &EventsResponseStream{
stream: stream,
}, nil
}
type EventsResponseStream struct {
stream *client.Stream
}
func (t *EventsResponseStream) Recv() (*EventsResponse, error) {
var rsp EventsResponse
if err := t.stream.Recv(&rsp); err != nil {
return nil, err
}
return &rsp, nil
}
// List all the lists
func (t *ListsService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("lists", "List", request, rsp)
}
// Read a list
func (t *ListsService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("lists", "Read", request, rsp)
}
// Update a list
func (t *ListsService) Update(request *UpdateRequest) (*UpdateResponse, error) {
rsp := &UpdateResponse{}
return rsp, t.client.Call("lists", "Update", request, rsp)
}
type CreateRequest struct {
// list items
Items []string `json:"items"`
// list name
Name string `json:"name"`
}
type CreateResponse struct {
// The created list
List *List `json:"list"`
}
type DeleteRequest struct {
// specify the id of the list
Id string `json:"id"`
}
type DeleteResponse struct {
List *List `json:"list"`
}
type EventsRequest struct {
// optionally specify a list id
Id string `json:"id"`
}
type EventsResponse struct {
// the event which occured; create, delete, update
Event string `json:"event"`
// the list which the operation occured on
List *List `json:"list"`
}
type List struct {
// time at which the list was created
Created string `json:"created"`
// unique id for the list, generated if not specified
Id string `json:"id"`
// items within the list
Items []string `json:"items"`
// name of the list
Name string `json:"name"`
// time at which the list was updated
Updated string `json:"updated"`
}
type ListRequest struct {
}
type ListResponse struct {
// the list of lists
Lists []List `json:"lists"`
}
type ReadRequest struct {
// the list id
Id string `json:"id"`
}
type ReadResponse struct {
// The list
List *List `json:"list"`
}
type UpdateRequest struct {
List *List `json:"list"`
}
type UpdateResponse struct {
List *List `json:"list"`
}

251
m3o.go
View File

@@ -7,6 +7,8 @@ import (
"go.m3o.com/avatar" "go.m3o.com/avatar"
"go.m3o.com/cache" "go.m3o.com/cache"
"go.m3o.com/carbon" "go.m3o.com/carbon"
"go.m3o.com/chat"
"go.m3o.com/comments"
"go.m3o.com/contact" "go.m3o.com/contact"
"go.m3o.com/crypto" "go.m3o.com/crypto"
"go.m3o.com/currency" "go.m3o.com/currency"
@@ -27,7 +29,9 @@ import (
"go.m3o.com/image" "go.m3o.com/image"
"go.m3o.com/ip" "go.m3o.com/ip"
"go.m3o.com/joke" "go.m3o.com/joke"
"go.m3o.com/lists"
"go.m3o.com/location" "go.m3o.com/location"
"go.m3o.com/memegen"
"go.m3o.com/minecraft" "go.m3o.com/minecraft"
"go.m3o.com/movie" "go.m3o.com/movie"
"go.m3o.com/mq" "go.m3o.com/mq"
@@ -35,6 +39,7 @@ import (
"go.m3o.com/nft" "go.m3o.com/nft"
"go.m3o.com/notes" "go.m3o.com/notes"
"go.m3o.com/otp" "go.m3o.com/otp"
"go.m3o.com/password"
"go.m3o.com/ping" "go.m3o.com/ping"
"go.m3o.com/place" "go.m3o.com/place"
"go.m3o.com/postcode" "go.m3o.com/postcode"
@@ -66,128 +71,138 @@ func NewClient(token string) *Client {
return &Client{ return &Client{
token: token, token: token,
AddressService: address.NewAddressService(token), Address: address.NewAddressService(token),
AnswerService: answer.NewAnswerService(token), Answer: answer.NewAnswerService(token),
AppService: app.NewAppService(token), App: app.NewAppService(token),
AvatarService: avatar.NewAvatarService(token), Avatar: avatar.NewAvatarService(token),
CacheService: cache.NewCacheService(token), Cache: cache.NewCacheService(token),
CarbonService: carbon.NewCarbonService(token), Carbon: carbon.NewCarbonService(token),
ContactService: contact.NewContactService(token), Chat: chat.NewChatService(token),
CryptoService: crypto.NewCryptoService(token), Comments: comments.NewCommentsService(token),
CurrencyService: currency.NewCurrencyService(token), Contact: contact.NewContactService(token),
DbService: db.NewDbService(token), Crypto: crypto.NewCryptoService(token),
EmailService: email.NewEmailService(token), Currency: currency.NewCurrencyService(token),
EmojiService: emoji.NewEmojiService(token), Db: db.NewDbService(token),
EvchargersService: evchargers.NewEvchargersService(token), Email: email.NewEmailService(token),
EventService: event.NewEventService(token), Emoji: emoji.NewEmojiService(token),
FileService: file.NewFileService(token), Evchargers: evchargers.NewEvchargersService(token),
ForexService: forex.NewForexService(token), Event: event.NewEventService(token),
FunctionService: function.NewFunctionService(token), File: file.NewFileService(token),
GeocodingService: geocoding.NewGeocodingService(token), Forex: forex.NewForexService(token),
GifsService: gifs.NewGifsService(token), Function: function.NewFunctionService(token),
GoogleService: google.NewGoogleService(token), Geocoding: geocoding.NewGeocodingService(token),
HelloworldService: helloworld.NewHelloworldService(token), Gifs: gifs.NewGifsService(token),
HolidaysService: holidays.NewHolidaysService(token), Google: google.NewGoogleService(token),
IdService: id.NewIdService(token), Helloworld: helloworld.NewHelloworldService(token),
ImageService: image.NewImageService(token), Holidays: holidays.NewHolidaysService(token),
IpService: ip.NewIpService(token), Id: id.NewIdService(token),
JokeService: joke.NewJokeService(token), Image: image.NewImageService(token),
LocationService: location.NewLocationService(token), Ip: ip.NewIpService(token),
MinecraftService: minecraft.NewMinecraftService(token), Joke: joke.NewJokeService(token),
MovieService: movie.NewMovieService(token), Lists: lists.NewListsService(token),
MqService: mq.NewMqService(token), Location: location.NewLocationService(token),
NewsService: news.NewNewsService(token), Memegen: memegen.NewMemegenService(token),
NftService: nft.NewNftService(token), Minecraft: minecraft.NewMinecraftService(token),
NotesService: notes.NewNotesService(token), Movie: movie.NewMovieService(token),
OtpService: otp.NewOtpService(token), Mq: mq.NewMqService(token),
PingService: ping.NewPingService(token), News: news.NewNewsService(token),
PlaceService: place.NewPlaceService(token), Nft: nft.NewNftService(token),
PostcodeService: postcode.NewPostcodeService(token), Notes: notes.NewNotesService(token),
PrayerService: prayer.NewPrayerService(token), Otp: otp.NewOtpService(token),
QrService: qr.NewQrService(token), Password: password.NewPasswordService(token),
QuranService: quran.NewQuranService(token), Ping: ping.NewPingService(token),
RoutingService: routing.NewRoutingService(token), Place: place.NewPlaceService(token),
RssService: rss.NewRssService(token), Postcode: postcode.NewPostcodeService(token),
SearchService: search.NewSearchService(token), Prayer: prayer.NewPrayerService(token),
SentimentService: sentiment.NewSentimentService(token), Qr: qr.NewQrService(token),
SmsService: sms.NewSmsService(token), Quran: quran.NewQuranService(token),
SpaceService: space.NewSpaceService(token), Routing: routing.NewRoutingService(token),
SpamService: spam.NewSpamService(token), Rss: rss.NewRssService(token),
StockService: stock.NewStockService(token), Search: search.NewSearchService(token),
StreamService: stream.NewStreamService(token), Sentiment: sentiment.NewSentimentService(token),
SunnahService: sunnah.NewSunnahService(token), Sms: sms.NewSmsService(token),
ThumbnailService: thumbnail.NewThumbnailService(token), Space: space.NewSpaceService(token),
TimeService: time.NewTimeService(token), Spam: spam.NewSpamService(token),
TranslateService: translate.NewTranslateService(token), Stock: stock.NewStockService(token),
TwitterService: twitter.NewTwitterService(token), Stream: stream.NewStreamService(token),
UrlService: url.NewUrlService(token), Sunnah: sunnah.NewSunnahService(token),
UserService: user.NewUserService(token), Thumbnail: thumbnail.NewThumbnailService(token),
VehicleService: vehicle.NewVehicleService(token), Time: time.NewTimeService(token),
WeatherService: weather.NewWeatherService(token), Translate: translate.NewTranslateService(token),
YoutubeService: youtube.NewYoutubeService(token), Twitter: twitter.NewTwitterService(token),
Url: url.NewUrlService(token),
User: user.NewUserService(token),
Vehicle: vehicle.NewVehicleService(token),
Weather: weather.NewWeatherService(token),
Youtube: youtube.NewYoutubeService(token),
} }
} }
type Client struct { type Client struct {
token string token string
AddressService *address.AddressService Address address.Address
AnswerService *answer.AnswerService Answer answer.Answer
AppService *app.AppService App app.App
AvatarService *avatar.AvatarService Avatar avatar.Avatar
CacheService *cache.CacheService Cache cache.Cache
CarbonService *carbon.CarbonService Carbon carbon.Carbon
ContactService *contact.ContactService Chat chat.Chat
CryptoService *crypto.CryptoService Comments comments.Comments
CurrencyService *currency.CurrencyService Contact contact.Contact
DbService *db.DbService Crypto crypto.Crypto
EmailService *email.EmailService Currency currency.Currency
EmojiService *emoji.EmojiService Db db.Db
EvchargersService *evchargers.EvchargersService Email email.Email
EventService *event.EventService Emoji emoji.Emoji
FileService *file.FileService Evchargers evchargers.Evchargers
ForexService *forex.ForexService Event event.Event
FunctionService *function.FunctionService File file.File
GeocodingService *geocoding.GeocodingService Forex forex.Forex
GifsService *gifs.GifsService Function function.Function
GoogleService *google.GoogleService Geocoding geocoding.Geocoding
HelloworldService *helloworld.HelloworldService Gifs gifs.Gifs
HolidaysService *holidays.HolidaysService Google google.Google
IdService *id.IdService Helloworld helloworld.Helloworld
ImageService *image.ImageService Holidays holidays.Holidays
IpService *ip.IpService Id id.Id
JokeService *joke.JokeService Image image.Image
LocationService *location.LocationService Ip ip.Ip
MinecraftService *minecraft.MinecraftService Joke joke.Joke
MovieService *movie.MovieService Lists lists.Lists
MqService *mq.MqService Location location.Location
NewsService *news.NewsService Memegen memegen.Memegen
NftService *nft.NftService Minecraft minecraft.Minecraft
NotesService *notes.NotesService Movie movie.Movie
OtpService *otp.OtpService Mq mq.Mq
PingService *ping.PingService News news.News
PlaceService *place.PlaceService Nft nft.Nft
PostcodeService *postcode.PostcodeService Notes notes.Notes
PrayerService *prayer.PrayerService Otp otp.Otp
QrService *qr.QrService Password password.Password
QuranService *quran.QuranService Ping ping.Ping
RoutingService *routing.RoutingService Place place.Place
RssService *rss.RssService Postcode postcode.Postcode
SearchService *search.SearchService Prayer prayer.Prayer
SentimentService *sentiment.SentimentService Qr qr.Qr
SmsService *sms.SmsService Quran quran.Quran
SpaceService *space.SpaceService Routing routing.Routing
SpamService *spam.SpamService Rss rss.Rss
StockService *stock.StockService Search search.Search
StreamService *stream.StreamService Sentiment sentiment.Sentiment
SunnahService *sunnah.SunnahService Sms sms.Sms
ThumbnailService *thumbnail.ThumbnailService Space space.Space
TimeService *time.TimeService Spam spam.Spam
TranslateService *translate.TranslateService Stock stock.Stock
TwitterService *twitter.TwitterService Stream stream.Stream
UrlService *url.UrlService Sunnah sunnah.Sunnah
UserService *user.UserService Thumbnail thumbnail.Thumbnail
VehicleService *vehicle.VehicleService Time time.Time
WeatherService *weather.WeatherService Translate translate.Translate
YoutubeService *youtube.YoutubeService Twitter twitter.Twitter
Url url.Url
User user.User
Vehicle vehicle.Vehicle
Weather weather.Weather
Youtube youtube.Youtube
} }

95
meme/meme.go Executable file
View File

@@ -0,0 +1,95 @@
package meme
import (
"go.m3o.com/client"
)
type Meme interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
Templates(*TemplatesRequest) (*TemplatesResponse, error)
}
func NewMemeService(token string) *MemeService {
return &MemeService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type MemeService struct {
client *client.Client
}
//
func (t *MemeService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
return rsp, t.client.Call("meme", "Generate", request, rsp)
}
// List the available templates
func (t *MemeService) Templates(request *TemplatesRequest) (*TemplatesResponse, error) {
rsp := &TemplatesResponse{}
return rsp, t.client.Call("meme", "Templates", request, rsp)
}
type Box struct {
// colour hex code
Color string `json:"color"`
// height in pixels
Height int32 `json:"height"`
// outline color hex code
Outline string `json:"outline"`
// text to display
Text string `json:"text"`
// width in pixels
Width int32 `json:"width"`
// x axis position
X int32 `json:"x"`
// y axis position
Y int32 `json:"y"`
}
type GenerateRequest struct {
// bottom text
BottomText string `json:"bottom_text"`
// font: arial or impact
Font string `json:"font"`
// the template id to use
Id string `json:"id"`
// font size; defaults to 50px
MaxFontSize string `json:"max_font_size"`
// top text
TopText string `json:"top_text"`
}
type GenerateResponse struct {
// url of the meme
Url string `json:"url"`
}
type Template struct {
// number of boxes used
BoxCount int32 `json:"box_count"`
// height in pixels
Height int32 `json:"height"`
// id of the meme
Id string `json:"id"`
// name of the meme
Name string `json:"name"`
// url of the meme
Url string `json:"url"`
// width in pixels
Width int32 `json:"width"`
}
type TemplatesRequest struct {
}
type TemplatesResponse struct {
Templates []Template `json:"templates"`
}

95
memegen/memegen.go Executable file
View File

@@ -0,0 +1,95 @@
package memegen
import (
"go.m3o.com/client"
)
type Memegen interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
Templates(*TemplatesRequest) (*TemplatesResponse, error)
}
func NewMemegenService(token string) *MemegenService {
return &MemegenService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type MemegenService struct {
client *client.Client
}
// Generate a meme using a template
func (t *MemegenService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
return rsp, t.client.Call("memegen", "Generate", request, rsp)
}
// List the available templates
func (t *MemegenService) Templates(request *TemplatesRequest) (*TemplatesResponse, error) {
rsp := &TemplatesResponse{}
return rsp, t.client.Call("memegen", "Templates", request, rsp)
}
type Box struct {
// colour hex code
Color string `json:"color"`
// height in pixels
Height int32 `json:"height"`
// outline color hex code
Outline string `json:"outline"`
// text to display
Text string `json:"text"`
// width in pixels
Width int32 `json:"width"`
// x axis position
X int32 `json:"x"`
// y axis position
Y int32 `json:"y"`
}
type GenerateRequest struct {
// bottom text
BottomText string `json:"bottom_text"`
// font: arial or impact
Font string `json:"font"`
// the template id to use
Id string `json:"id"`
// font size; defaults to 50px
MaxFontSize string `json:"max_font_size"`
// top text
TopText string `json:"top_text"`
}
type GenerateResponse struct {
// url of the memegen
Url string `json:"url"`
}
type Template struct {
// number of boxes used
BoxCount int32 `json:"box_count"`
// height in pixels
Height int32 `json:"height"`
// id of the memegen
Id string `json:"id"`
// name of the memegen
Name string `json:"name"`
// url of the memegen
Url string `json:"url"`
// width in pixels
Width int32 `json:"width"`
}
type TemplatesRequest struct {
}
type TemplatesResponse struct {
Templates []Template `json:"templates"`
}

View File

@@ -5,7 +5,9 @@ import (
) )
type Nft interface { type Nft interface {
Asset(*AssetRequest) (*AssetResponse, error)
Assets(*AssetsRequest) (*AssetsResponse, error) Assets(*AssetsRequest) (*AssetsResponse, error)
Collection(*CollectionRequest) (*CollectionResponse, error)
Collections(*CollectionsRequest) (*CollectionsResponse, error) Collections(*CollectionsRequest) (*CollectionsResponse, error)
Create(*CreateRequest) (*CreateResponse, error) Create(*CreateRequest) (*CreateResponse, error)
} }
@@ -22,6 +24,14 @@ type NftService struct {
client *client.Client client *client.Client
} }
// Get a single asset by the contract
func (t *NftService) Asset(request *AssetRequest) (*AssetResponse, error) {
rsp := &AssetResponse{}
return rsp, t.client.Call("nft", "Asset", request, rsp)
}
// Return a list of assets // Return a list of assets
func (t *NftService) Assets(request *AssetsRequest) (*AssetsResponse, error) { func (t *NftService) Assets(request *AssetsRequest) (*AssetsResponse, error) {
@@ -30,6 +40,14 @@ func (t *NftService) Assets(request *AssetsRequest) (*AssetsResponse, error) {
} }
// Get a collection by its slug
func (t *NftService) Collection(request *CollectionRequest) (*CollectionResponse, error) {
rsp := &CollectionResponse{}
return rsp, t.client.Call("nft", "Collection", request, rsp)
}
// Get a list of collections // Get a list of collections
func (t *NftService) Collections(request *CollectionsRequest) (*CollectionsResponse, error) { func (t *NftService) Collections(request *CollectionsRequest) (*CollectionsResponse, error) {
@@ -75,14 +93,27 @@ type Asset struct {
Sales int32 `json:"sales"` Sales int32 `json:"sales"`
// the token id // the token id
TokenId string `json:"token_id"` TokenId string `json:"token_id"`
// traits associated with the item
Traits []map[string]interface{} `json:"traits"`
}
type AssetRequest struct {
ContractAddress string `json:"contract_address"`
TokenId string `json:"token_id"`
}
type AssetResponse struct {
Asset *Asset `json:"asset"`
} }
type AssetsRequest struct { type AssetsRequest struct {
// limit to members of a collection by slug name (case sensitive) // limit to members of a collection by slug name (case sensitive)
Collection string `json:"collection"` Collection string `json:"collection"`
// A cursor pointing to the page to retrieve
Cursor string `json:"cursor"`
// limit returned assets // limit returned assets
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
// offset for pagination // DEPRECATED offset for pagination, please use cursor instead
Offset int32 `json:"offset"` Offset int32 `json:"offset"`
// order "asc" or "desc" // order "asc" or "desc"
Order string `json:"order"` Order string `json:"order"`
@@ -93,15 +124,51 @@ type AssetsRequest struct {
type AssetsResponse struct { type AssetsResponse struct {
// list of assets // list of assets
Assets []Asset `json:"assets"` Assets []Asset `json:"assets"`
// A cursor to be supplied to retrieve the next page of results
Next string `json:"next"`
// A cursor to be supplied to retrieve the previous page of results
Previous string `json:"previous"`
} }
type Collection struct { type Collection struct {
CreatedAt string `json:"created_at"` // image used in the banner for the collection
Description string `json:"description"` BannerImageUrl string `json:"banner_image_url"`
ImageUrl string `json:"image_url"` // creation time
Name string `json:"name"` CreatedAt string `json:"created_at"`
// description of the collection
Description string `json:"description"`
// approved editors for this collection
Editors []string `json:"editors"`
// external link to the original website for the collection
ExternalLink string `json:"external_link"`
// an image for the collection
ImageUrl string `json:"image_url"`
// name of the collection
Name string `json:"name"`
// the payment tokens accepted for this collection
PaymentTokens *Token `json:"payment_tokens"`
// payout address for the collection's royalties
PayoutAddress string `json:"payout_address"` PayoutAddress string `json:"payout_address"`
Slug string `json:"slug"` // a list of the contracts associated with this collection
PrimaryAssetContracts *Contract `json:"primary_asset_contracts"`
// the collection's approval status on OpenSea
SafelistRequestStatus string `json:"safelist_request_status"`
// the fees that get paid out when a sale is made
SellerFees string `json:"seller_fees"`
// collection slug
Slug string `json:"slug"`
// sales statistics associated with the collection
Stats map[string]interface{} `json:"stats"`
// listing of all the trait types available within this collection
Traits map[string]interface{} `json:"traits"`
}
type CollectionRequest struct {
Slug string `json:"slug"`
}
type CollectionResponse struct {
Collection *Collection `json:"collection"`
} }
type CollectionsRequest struct { type CollectionsRequest struct {

47
password/password.go Executable file
View File

@@ -0,0 +1,47 @@
package password
import (
"go.m3o.com/client"
)
type Password interface {
Generate(*GenerateRequest) (*GenerateResponse, error)
}
func NewPasswordService(token string) *PasswordService {
return &PasswordService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type PasswordService struct {
client *client.Client
}
// Generate a strong random password. Use the switches to control which character types are included, defaults to using all of them
func (t *PasswordService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
return rsp, t.client.Call("password", "Generate", request, rsp)
}
type GenerateRequest struct {
// password length; defaults to 8 chars
Length int32 `json:"length"`
// include lowercase letters
Lowercase bool `json:"lowercase"`
// include numbers
Numbers bool `json:"numbers"`
// include special characters (!@#$%&*)
Special bool `json:"special"`
// include uppercase letters
Uppercase bool `json:"uppercase"`
}
type GenerateResponse struct {
// The generated password
Password string `json:"password"`
}

View File

@@ -40,7 +40,7 @@ func (t *SearchService) DeleteIndex(request *DeleteIndexRequest) (*DeleteIndexRe
} }
// Delete a document given its ID // Delete a record given its ID
func (t *SearchService) Delete(request *DeleteRequest) (*DeleteResponse, error) { func (t *SearchService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{} rsp := &DeleteResponse{}
@@ -48,7 +48,7 @@ func (t *SearchService) Delete(request *DeleteRequest) (*DeleteResponse, error)
} }
// Index a document i.e. insert a document to search for. // Index a record i.e. insert a document to search for.
func (t *SearchService) Index(request *IndexRequest) (*IndexResponse, error) { func (t *SearchService) Index(request *IndexRequest) (*IndexResponse, error) {
rsp := &IndexResponse{} rsp := &IndexResponse{}
@@ -56,7 +56,7 @@ func (t *SearchService) Index(request *IndexRequest) (*IndexResponse, error) {
} }
// Search for documents in a given in index // Search for records in a given in index
func (t *SearchService) Search(request *SearchRequest) (*SearchResponse, error) { func (t *SearchService) Search(request *SearchRequest) (*SearchResponse, error) {
rsp := &SearchResponse{} rsp := &SearchResponse{}
@@ -81,22 +81,15 @@ type DeleteIndexResponse struct {
} }
type DeleteRequest struct { type DeleteRequest struct {
// The ID of the document to delete // The ID of the record to delete
Id string `json:"id"` Id string `json:"id"`
// The index the document belongs to // The index the record belongs to
Index string `json:"index"` Index string `json:"index"`
} }
type DeleteResponse struct { type DeleteResponse struct {
} }
type Document struct {
// The JSON contents of the document
Contents map[string]interface{} `json:"contents"`
// The ID for this document. If blank, one will be generated
Id string `json:"id"`
}
type Field struct { type Field struct {
// The name of the field. Use a `.` separator to define nested fields e.g. foo.bar // The name of the field. Use a `.` separator to define nested fields e.g. foo.bar
Name string `json:"name"` Name string `json:"name"`
@@ -105,24 +98,34 @@ type Field struct {
} }
type IndexRequest struct { type IndexRequest struct {
// The document to index // The data to index
Document *Document `json:"document"` Data map[string]interface{} `json:"data"`
// The index this document belongs to // Optional ID for the record
Id string `json:"id"`
// The index this record belongs to
Index string `json:"index"` Index string `json:"index"`
} }
type IndexResponse struct { type IndexResponse struct {
// the indexed record
Record *Record `json:"record"`
}
type Record struct {
// The JSON contents of the record
Data map[string]interface{} `json:"data"`
// The ID for this record. If blank, one will be generated
Id string `json:"id"` Id string `json:"id"`
} }
type SearchRequest struct { type SearchRequest struct {
// The index the document belongs to // The index the record belongs to
Index string `json:"index"` Index string `json:"index"`
// The query. See docs for query language examples // The query. See docs for query language examples
Query string `json:"query"` Query string `json:"query"`
} }
type SearchResponse struct { type SearchResponse struct {
// The matching documents // The matching records
Documents []Document `json:"documents"` Records []Record `json:"records"`
} }

View File

@@ -162,7 +162,17 @@ type ListResponse struct {
Objects []ListObject `json:"objects"` Objects []ListObject `json:"objects"`
} }
type Object struct { type ReadRequest struct {
// name of the object
Name string `json:"name"`
}
type ReadResponse struct {
// The object itself
Object *SpaceObject `json:"object"`
}
type SpaceObject struct {
// when was this created // when was this created
Created string `json:"created"` Created string `json:"created"`
// the data within the object // the data within the object
@@ -177,16 +187,6 @@ type Object struct {
Visibility string `json:"visibility"` Visibility string `json:"visibility"`
} }
type ReadRequest struct {
// name of the object
Name string `json:"name"`
}
type ReadResponse struct {
// The object itself
Object *Object `json:"object"`
}
type UpdateRequest struct { type UpdateRequest struct {
// The name of the object. Use forward slash delimiter to implement a nested directory-like structure e.g. images/foo.jpg // The name of the object. Use forward slash delimiter to implement a nested directory-like structure e.g. images/foo.jpg
Name string `json:"name"` Name string `json:"name"`

View File

@@ -75,6 +75,8 @@ type ZoneResponse struct {
Location string `json:"location"` Location string `json:"location"`
// e.g -0.37 // e.g -0.37
Longitude float64 `json:"longitude"` Longitude float64 `json:"longitude"`
// UTC offset in hours
Offset int32 `json:"offset"`
// region of timezone // region of timezone
Region string `json:"region"` Region string `json:"region"`
// the timezone e.g Europe/London // the timezone e.g Europe/London

View File

@@ -80,6 +80,8 @@ type URLPair struct {
Created string `json:"created"` Created string `json:"created"`
// destination url // destination url
DestinationUrl string `json:"destinationURL"` DestinationUrl string `json:"destinationURL"`
// The number of times the short URL has been resolved
HitCount int64 `json:"hitCount,string"`
// shortened url // shortened url
ShortUrl string `json:"shortURL"` ShortUrl string `json:"shortURL"`
} }

Some files were not shown because too many files have changed in this diff Show More