358 Commits
v0.7.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
m3o-actions
fc990c84ab Commit from m3o/m3o action 2022-02-15 22:22:36 +00:00
m3o-actions
e9229571ad Commit from m3o/m3o action 2022-02-15 17:32:16 +00:00
Asim Aslam
b310d3e1e0 remove auto complete example 2022-02-15 17:26:40 +00:00
m3o-actions
3e8a30c33a Commit from m3o/m3o action 2022-02-15 15:30:41 +00:00
m3o-actions
d5b9efe74e Commit from m3o/m3o action 2022-02-15 15:10:47 +00:00
m3o-actions
da28af7166 Commit from m3o/m3o action 2022-02-15 13:03:21 +00:00
m3o-actions
cceeb16d81 Commit from m3o/m3o action 2022-02-15 12:41:05 +00:00
m3o-actions
a25cabc9be Commit from m3o/m3o action 2022-02-15 12:34:07 +00:00
m3o-actions
4ca21d5561 Commit from m3o/m3o action 2022-02-15 12:32:59 +00:00
m3o-actions
39fcaa24c0 Commit from m3o/m3o action 2022-02-15 12:16:34 +00:00
m3o-actions
fc1099c437 Commit from m3o/m3o action 2022-02-15 11:52:09 +00:00
m3o-actions
f3af3fa1ba Commit from m3o/m3o action 2022-02-15 11:36:20 +00:00
m3o-actions
03a3a1bb91 Commit from m3o/m3o action 2022-02-15 11:27:21 +00:00
m3o-actions
1c58bf602d Commit from m3o/m3o action 2022-02-15 11:04:19 +00:00
m3o-actions
02fc6f735a Commit from m3o/m3o action 2022-02-15 10:02:49 +00:00
m3o-actions
7ea20aefbd Commit from m3o/m3o action 2022-02-15 10:00:53 +00:00
m3o-actions
7698310d1a Commit from m3o/m3o action 2022-02-15 10:00:04 +00:00
m3o-actions
9685cb5d53 Commit from m3o/m3o action 2022-02-14 16:40:54 +00:00
m3o-actions
63fb62a55e Commit from m3o/m3o action 2022-02-14 15:40:49 +00:00
m3o-actions
56cdd3c583 Commit from m3o/m3o action 2022-02-14 14:12:45 +00:00
m3o-actions
97accc758e Commit from m3o/m3o action 2022-02-13 18:44:01 +00:00
m3o-actions
7e5fdc7d77 Commit from m3o/m3o action 2022-02-13 18:13:54 +00:00
m3o-actions
90f27882e8 Commit from m3o/m3o action 2022-02-11 15:10:20 +00:00
m3o-actions
70fd591952 Commit from m3o/m3o action 2022-02-11 14:43:11 +00:00
m3o-actions
7add4ca16b Commit from m3o/m3o action 2022-02-11 14:40:54 +00:00
m3o-actions
243d779a03 Commit from m3o/m3o action 2022-02-11 14:28:51 +00:00
m3o-actions
6b9caa1e59 Commit from m3o/m3o action 2022-02-11 14:27:47 +00:00
m3o-actions
2bbe49f716 Commit from m3o/m3o action 2022-02-10 20:54:17 +00:00
m3o-actions
046127532d Commit from m3o/m3o action 2022-02-09 22:11:39 +00:00
m3o-actions
2e14a4252f Commit from m3o/m3o action 2022-02-09 21:55:39 +00:00
m3o-actions
d1be4f25bc Commit from m3o/m3o action 2022-02-09 17:41:21 +00:00
m3o-actions
f38850c259 Commit from m3o/m3o action 2022-02-09 16:54:13 +00:00
m3o-actions
99979e1167 Commit from m3o/m3o action 2022-02-09 16:22:26 +00:00
m3o-actions
d144fd0b22 Commit from m3o/m3o action 2022-02-09 15:12:53 +00:00
m3o-actions
75cd109929 Commit from m3o/m3o action 2022-02-09 12:34:26 +00:00
m3o-actions
4cd429a8b3 Commit from m3o/m3o action 2022-02-09 12:32:09 +00:00
m3o-actions
aef44febce Commit from m3o/m3o action 2022-02-09 12:28:25 +00:00
m3o-actions
6446146553 Commit from m3o/m3o action 2022-02-09 10:44:26 +00:00
m3o-actions
f251e45b0b Commit from m3o/m3o action 2022-02-08 21:53:46 +00:00
m3o-actions
01f99e0b6d Commit from m3o/m3o action 2022-02-08 21:52:55 +00:00
m3o-actions
d9cabd803a Commit from m3o/m3o action 2022-02-08 21:50:47 +00:00
m3o-actions
064734211e Commit from m3o/m3o action 2022-02-08 21:49:28 +00:00
m3o-actions
d0aeac6b3c Commit from m3o/m3o action 2022-02-08 13:52:58 +00:00
m3o-actions
eb93a5a449 Commit from m3o/m3o action 2022-02-08 12:06:36 +00:00
m3o-actions
78d8e2fa1e Commit from m3o/m3o action 2022-02-07 16:49:25 +00:00
m3o-actions
6bca5af6c5 Commit from m3o/m3o action 2022-02-07 16:44:05 +00:00
m3o-actions
d132d7c27c Commit from m3o/m3o action 2022-02-07 16:25:19 +00:00
m3o-actions
6f3a7a4dd3 Commit from m3o/m3o action 2022-02-07 16:13:31 +00:00
m3o-actions
a2eb34e59a Commit from m3o/m3o action 2022-02-07 15:27:01 +00:00
m3o-actions
709e4180ec Commit from m3o/m3o action 2022-02-06 19:14:19 +00:00
m3o-actions
3abd701901 Commit from m3o/m3o action 2022-02-06 19:13:50 +00:00
m3o-actions
ea5aa65039 Commit from m3o/m3o action 2022-02-06 18:47:42 +00:00
m3o-actions
1ae6969f65 Commit from m3o/m3o action 2022-02-05 23:52:42 +00:00
m3o-actions
9901807b67 Commit from m3o/m3o action 2022-02-05 21:34:41 +00:00
m3o-actions
efb35c528c Commit from m3o/m3o action 2022-02-05 21:34:19 +00:00
m3o-actions
a64a7a6162 Commit from m3o/m3o action 2022-02-05 21:32:59 +00:00
m3o-actions
c7afdd237d Commit from m3o/m3o action 2022-02-05 21:32:06 +00:00
m3o-actions
6f5714dc73 Commit from m3o/m3o action 2022-02-03 22:42:38 +00:00
m3o-actions
6ce3f89757 Commit from m3o/m3o action 2022-02-03 22:02:09 +00:00
m3o-actions
3e655dea52 Commit from m3o/m3o action 2022-02-03 22:01:41 +00:00
m3o-actions
80ca5f8229 Commit from m3o/m3o action 2022-02-03 17:36:03 +00:00
m3o-actions
993c0b1e1c Commit from m3o/m3o action 2022-02-03 17:23:40 +00:00
m3o-actions
f7c6ac50e2 Commit from m3o/m3o action 2022-02-03 16:13:46 +00:00
m3o-actions
1f72651636 Commit from m3o/m3o action 2022-02-03 16:06:11 +00:00
m3o-actions
9f65103806 Commit from m3o/m3o action 2022-02-03 14:18:46 +00:00
m3o-actions
fb85cd000f Commit from m3o/m3o action 2022-02-03 11:32:32 +00:00
m3o-actions
e78ab622d6 Commit from m3o/m3o action 2022-02-03 11:21:15 +00:00
m3o-actions
84a739197e Commit from m3o/m3o action 2022-02-02 16:54:08 +00:00
m3o-actions
83d8cd3702 Commit from m3o/m3o action 2022-02-02 16:49:58 +00:00
m3o-actions
a94d784928 Commit from m3o/m3o action 2022-02-02 16:41:56 +00:00
m3o-actions
fd3a1063b0 Commit from m3o/m3o action 2022-02-02 16:32:36 +00:00
m3o-actions
2b935c2eb1 Commit from m3o/m3o action 2022-02-02 15:30:54 +00:00
m3o-actions
2d46dc2672 Commit from m3o/m3o action 2022-02-02 15:03:48 +00:00
m3o-actions
06f2db6618 Commit from m3o/m3o action 2022-02-02 12:14:14 +00:00
m3o-actions
c0731399ee Commit from m3o/m3o action 2022-02-02 11:33:16 +00:00
m3o-actions
9057f09e41 Commit from m3o/m3o action 2022-02-02 10:29:34 +00:00
m3o-actions
b7853960a4 Commit from m3o/m3o action 2022-02-01 17:25:12 +00:00
m3o-actions
1d96d4517b Commit from m3o/m3o action 2022-02-01 17:11:32 +00:00
m3o-actions
dd282e7ab9 Commit from m3o/m3o action 2022-02-01 15:16:59 +00:00
m3o-actions
8f3fe3d33c Commit from m3o/m3o action 2022-02-01 12:52:37 +00:00
m3o-actions
7e17640b3e Commit from m3o/m3o action 2022-02-01 12:14:35 +00:00
m3o-actions
a46a505a9f Commit from m3o/m3o action 2022-02-01 11:50:37 +00:00
m3o-actions
0a690f02d9 Commit from m3o/m3o action 2022-02-01 11:23:28 +00:00
m3o-actions
434a7615b7 Commit from m3o/m3o action 2022-02-01 11:12:15 +00:00
m3o-actions
7552377ffc Commit from m3o/m3o action 2022-02-01 08:52:03 +00:00
122 changed files with 4465 additions and 1461 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)
This is the Go client to access APIs on the M3O Platform

View File

@@ -67,7 +67,7 @@ func (t *AppService) Resolve(request *ResolveRequest) (*ResolveResponse, error)
}
// Run an app from a source repo. Specify region etc.
// Run an app from source
func (t *AppService) Run(request *RunRequest) (*RunResponse, error) {
rsp := &RunResponse{}
@@ -150,7 +150,7 @@ type ResolveResponse struct {
type RunRequest struct {
// branch. defaults to master
Branch string `json:"branch"`
// associatede env vars to pass in
// associated env vars to pass in
EnvVars map[string]string `json:"env_vars"`
// name of the app
Name string `json:"name"`
@@ -205,6 +205,8 @@ type StatusResponse struct {
}
type UpdateRequest struct {
// Additional env vars to update
EnvVars map[string]string `json:"env_vars"`
// name of the app
Name string `json:"name"`
}

View File

@@ -20,7 +20,7 @@ type AvatarService struct {
client *client.Client
}
//
// Generate an unique avatar
func (t *AvatarService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
@@ -29,22 +29,21 @@ func (t *AvatarService) Generate(request *GenerateRequest) (*GenerateResponse, e
}
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"`
// avatar's gender, `male` or `female`, default is `male`
// avatar's gender: `male` or `female`; default is `male`
Gender string `json:"gender"`
// if upload to m3o CDN, default is `false`
// if update = true, then it'll return the CDN url
// set to true to upload to the M3O CDN and receive the url
Upload bool `json:"upload"`
// avatar's username, unique username will generates the unique avatar;
// if username == "", will generate a random avatar in every request
// if upload == true, username will be used as CDN filename rather than a random uuid string
// avatar's username, unique username will generate the unique avatar;
// if empty, every request generates a random avatar;
// if upload == true, username will be the CDN filename rather than a random uuid string
Username string `json:"username"`
}
type GenerateResponse struct {
// base64encode string of the avatar image
// base64 encoded string of the avatar image
Base64 string `json:"base64"`
// Micro's CDN url of the avatar image
// M3O's CDN url of the avatar image
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
}
//
// Create a contact
func (t *ContactService) Create(request *CreateRequest) (*CreateResponse, error) {
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) {
rsp := &DeleteResponse{}
@@ -40,7 +40,7 @@ func (t *ContactService) Delete(request *DeleteRequest) (*DeleteResponse, error)
}
//
// List contacts
func (t *ContactService) List(request *ListRequest) (*ListResponse, error) {
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) {
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) {
rsp := &UpdateResponse{}

View File

@@ -9,6 +9,7 @@ type Crypto interface {
News(*NewsRequest) (*NewsResponse, error)
Price(*PriceRequest) (*PriceResponse, error)
Quote(*QuoteRequest) (*QuoteResponse, error)
Symbols(*SymbolsRequest) (*SymbolsResponse, error)
}
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 {
// the date published
Date string `json:"date"`
@@ -133,3 +142,15 @@ type QuoteResponse struct {
// the UTC timestamp of the quote
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)
Flag(*FlagRequest) (*FlagResponse, error)
Print(*PrintRequest) (*PrintResponse, error)
Send(*SendRequest) (*SendResponse, error)
}
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 {
// the alias code e.g :beer:
Alias string `json:"alias"`
@@ -85,17 +76,3 @@ type PrintResponse struct {
// text with rendered emojis
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,62 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/app/api](https
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
@@ -89,7 +145,7 @@ func ListTheApps() {
```
## Run
Run an app from a source repo. Specify region etc.
Run an app from source
[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)
@@ -104,7 +160,7 @@ import(
"go.m3o.com/app"
)
// Run an app from a source repo. Specify region etc.
// Run an app from source
func RunAnApp() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Run(&app.RunRequest{
@@ -174,59 +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)
}
```

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/app"
)
// Run an app from a source repo. Specify region etc.
// Run an app from source
func main() {
appService := app.NewAppService(os.Getenv("M3O_API_TOKEN"))
rsp, err := appService.Run(&app.RunRequest{

View File

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

View File

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

View File

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

View File

@@ -4,6 +4,62 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/cache/api](htt
Endpoints:
## Decrement
Decrement a value (if it's a number). If key not found it is equivalent to set.
[https://m3o.com/cache/api#Decrement](https://m3o.com/cache/api#Decrement)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Decrement a value (if it's a number). If key not found it is equivalent to set.
func DecrementAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Decrement(&cache.DecrementRequest{
Key: "counter",
Value: 2,
})
fmt.Println(rsp, err)
}
```
## ListKeys
List all the available keys
[https://m3o.com/cache/api#ListKeys](https://m3o.com/cache/api#ListKeys)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// List all the available keys
func ListTheKeys() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.ListKeys(&cache.ListKeysRequest{
})
fmt.Println(rsp, err)
}
```
## Set
Set an item in the cache. Overwrites any existing value already set.
@@ -118,59 +174,3 @@ Value: 2,
}
```
## Decrement
Decrement a value (if it's a number). If key not found it is equivalent to set.
[https://m3o.com/cache/api#Decrement](https://m3o.com/cache/api#Decrement)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// Decrement a value (if it's a number). If key not found it is equivalent to set.
func DecrementAvalue() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.Decrement(&cache.DecrementRequest{
Key: "counter",
Value: 2,
})
fmt.Println(rsp, err)
}
```
## ListKeys
List all the available keys
[https://m3o.com/cache/api#ListKeys](https://m3o.com/cache/api#ListKeys)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/cache"
)
// List all the available keys
func ListTheKeys() {
cacheService := cache.NewCacheService(os.Getenv("M3O_API_TOKEN"))
rsp, err := cacheService.ListKeys(&cache.ListKeysRequest{
})
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

@@ -4,9 +4,93 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/contact/api](h
Endpoints:
## Delete
Delete a contact
[https://m3o.com/contact/api#Delete](https://m3o.com/contact/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
// Delete a contact
func DeleteAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Delete(&contact.DeleteRequest{
Id: "42e48a3c-6221-11ec-96d2-acde48001122",
})
fmt.Println(rsp, err)
}
```
## List
List contacts
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
// List contacts
func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{
})
fmt.Println(rsp, err)
}
```
## List
List contacts
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
// List contacts
func ListContactsWithSpecificOffsetAndLimit() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{
Limit: 1,
Offset: 1,
})
fmt.Println(rsp, err)
}
```
## Create
Create a contact
[https://m3o.com/contact/api#Create](https://m3o.com/contact/api#Create)
@@ -21,7 +105,7 @@ import(
"go.m3o.com/contact"
)
//
// Create a contact
func CreateAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Create(&contact.CreateRequest{
@@ -56,7 +140,7 @@ contact.Phone{
```
## Update
Update a contact
[https://m3o.com/contact/api#Update](https://m3o.com/contact/api#Update)
@@ -71,7 +155,7 @@ import(
"go.m3o.com/contact"
)
//
// Update a contact
func UpdateAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Update(&contact.UpdateRequest{
@@ -107,7 +191,7 @@ contact.Phone{
```
## Read
Read contact details
[https://m3o.com/contact/api#Read](https://m3o.com/contact/api#Read)
@@ -122,7 +206,7 @@ import(
"go.m3o.com/contact"
)
//
// Read contact details
func GetAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Read(&contact.ReadRequest{
@@ -133,87 +217,3 @@ func GetAcontact() {
}
```
## Delete
[https://m3o.com/contact/api#Delete](https://m3o.com/contact/api#Delete)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
//
func DeleteAcontact() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.Delete(&contact.DeleteRequest{
Id: "42e48a3c-6221-11ec-96d2-acde48001122",
})
fmt.Println(rsp, err)
}
```
## List
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
//
func ListContactsWithDefaultOffsetAndLimitDefaultLimitIs20() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{
})
fmt.Println(rsp, err)
}
```
## List
[https://m3o.com/contact/api#List](https://m3o.com/contact/api#List)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/contact"
)
//
func ListContactsWithSpecificOffsetAndLimit() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
rsp, err := contactService.List(&contact.ListRequest{
Limit: 1,
Offset: 1,
})
fmt.Println(rsp, err)
}
```

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@ import (
"go.m3o.com/contact"
)
//
// Update a contact
func main() {
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
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:
## 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
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,6 +4,61 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/currency/api](
Endpoints:
## Codes
Codes returns the supported currency codes for the API
[https://m3o.com/currency/api#Codes](https://m3o.com/currency/api#Codes)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Codes returns the supported currency codes for the API
func GetSupportedCodes() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Codes(&currency.CodesRequest{
})
fmt.Println(rsp, err)
}
```
## Rates
Rates returns the currency rates for a given code e.g USD
[https://m3o.com/currency/api#Rates](https://m3o.com/currency/api#Rates)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Rates returns the currency rates for a given code e.g USD
func GetRatesForUsd() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Rates(&currency.RatesRequest{
Code: "USD",
})
fmt.Println(rsp, err)
}
```
## Convert
Convert returns the currency conversion rate between two pairs e.g USD/GBP
@@ -92,58 +147,3 @@ Date: "2021-05-30",
}
```
## Codes
Codes returns the supported currency codes for the API
[https://m3o.com/currency/api#Codes](https://m3o.com/currency/api#Codes)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Codes returns the supported currency codes for the API
func GetSupportedCodes() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Codes(&currency.CodesRequest{
})
fmt.Println(rsp, err)
}
```
## Rates
Rates returns the currency rates for a given code e.g USD
[https://m3o.com/currency/api#Rates](https://m3o.com/currency/api#Rates)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Rates returns the currency rates for a given code e.g USD
func GetRatesForUsd() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Rates(&currency.RatesRequest{
Code: "USD",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,150 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/db/api](https:
Endpoints:
## 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)
}
```
## Read
Read data from a table. Lookup can be by ID or via querying any field in the record.
[https://m3o.com/db/api#Read](https://m3o.com/db/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Read data from a table. Lookup can be by ID or via querying any field in the record.
func ReadRecords() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Read(&db.ReadRequest{
Query: "age == 43",
Table: "example",
})
fmt.Println(rsp, err)
}
```
## DropTable
Drop a table in the DB
[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Drop a table in the DB
func DropTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.DropTable(&db.DropTableRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Count
Count records in a table
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Count records in a table
func CountEntriesInAtable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Count(&db.CountRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## ListTables
List tables in the DB
[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// List tables in the DB
func ListTables() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{
})
fmt.Println(rsp, err)
}
```
## Create
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
@@ -180,6 +36,38 @@ 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)
}
```
## Delete
@@ -209,6 +97,63 @@ Table: "example",
})
fmt.Println(rsp, err)
}
```
## Count
Count records in a table
[https://m3o.com/db/api#Count](https://m3o.com/db/api#Count)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Count records in a table
func CountEntriesInAtable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Count(&db.CountRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Read
Read data from a table. Lookup can be by ID or via querying any field in the record.
[https://m3o.com/db/api#Read](https://m3o.com/db/api#Read)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Read data from a table. Lookup can be by ID or via querying any field in the record.
func ReadRecords() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Read(&db.ReadRequest{
Query: "age == 43",
Table: "example",
})
fmt.Println(rsp, err)
}
```
## Truncate
@@ -237,6 +182,61 @@ func TruncateTable() {
})
fmt.Println(rsp, err)
}
```
## DropTable
Drop a table in the DB
[https://m3o.com/db/api#DropTable](https://m3o.com/db/api#DropTable)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// Drop a table in the DB
func DropTable() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.DropTable(&db.DropTableRequest{
Table: "example",
})
fmt.Println(rsp, err)
}
```
## ListTables
List tables in the DB
[https://m3o.com/db/api#ListTables](https://m3o.com/db/api#ListTables)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/db"
)
// List tables in the DB
func ListTables() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{
})
fmt.Println(rsp, err)
}
```
## RenameTable

View File

@@ -12,8 +12,8 @@ func main() {
dbService := db.NewDbService(os.Getenv("M3O_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"id": "1",
"age": 43,
"id": "1",
},
Table: "example",
})

View File

@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/email/api](htt
Endpoints:
## Validate
Validate an email address format
[https://m3o.com/email/api#Validate](https://m3o.com/email/api#Validate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/email"
)
// Validate an email address format
func ValidateEmail() {
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emailService.Validate(&email.ValidateRequest{
Address: "joe@example.com",
})
fmt.Println(rsp, err)
}
```
## Send
Send an email by passing in from, to, subject, and a text or html body
@@ -92,3 +64,31 @@ func ParseEmail() {
}
```
## Validate
Validate an email address format
[https://m3o.com/email/api#Validate](https://m3o.com/email/api#Validate)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/email"
)
// Validate an email address format
func ValidateEmail() {
emailService := email.NewEmailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := emailService.Validate(&email.ValidateRequest{
Address: "joe@example.com",
})
fmt.Println(rsp, err)
}
```

View File

@@ -89,33 +89,3 @@ func PrintTextIncludingEmoji() {
}
```
## 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)
}
```

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,6 +4,39 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/event/api](htt
Endpoints:
## Publish
Publish a event to the event stream.
[https://m3o.com/event/api#Publish](https://m3o.com/event/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/event"
)
// Publish a event to the event stream.
func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
},
Topic: "user",
})
fmt.Println(rsp, err)
}
```
## Consume
Consume events from a given topic.
@@ -73,36 +106,3 @@ func ReadEventsOnAtopic() {
}
```
## Publish
Publish a event to the event stream.
[https://m3o.com/event/api#Publish](https://m3o.com/event/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/event"
)
// Publish a event to the event stream.
func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
},
Topic: "user",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,6 +4,38 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/file/api](http
Endpoints:
## Save
Save a file
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Save a file
func SaveFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Save(&file.SaveRequest{
File: &file.Record{
Content: "file content example",
Path: "/document/text-files/file.txt",
Project: "examples",
},
})
fmt.Println(rsp, err)
}
```
## List
List files by their project and optionally a path.
@@ -90,35 +122,3 @@ Project: "examples",
}
```
## Save
Save a file
[https://m3o.com/file/api#Save](https://m3o.com/file/api#Save)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/file"
)
// Save a file
func SaveFile() {
fileService := file.NewFileService(os.Getenv("M3O_API_TOKEN"))
rsp, err := fileService.Save(&file.SaveRequest{
File: &file.Record{
Content: "file content example",
Path: "/document/text-files/file.txt",
Project: "examples",
},
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,12 +4,12 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/function/api](
Endpoints:
## Reserve
## Proxy
Reserve function names and resources beyond free quota
Return the backend url for proxying
[https://m3o.com/function/api#Reserve](https://m3o.com/function/api#Reserve)
[https://m3o.com/function/api#Proxy](https://m3o.com/function/api#Proxy)
```go
package example
@@ -21,11 +21,11 @@ import(
"go.m3o.com/function"
)
// Reserve function names and resources beyond free quota
func ReserveAfunction() {
// Return the backend url for proxying
func ProxyUrl() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Reserve(&function.ReserveRequest{
Name: "helloworld",
rsp, err := functionService.Proxy(&function.ProxyRequest{
Id: "helloworld",
})
fmt.Println(rsp, err)
@@ -64,60 +64,6 @@ Subfolder: "examples/go-function",
})
fmt.Println(rsp, err)
}
```
## Regions
Return a list of supported regions
[https://m3o.com/function/api#Regions](https://m3o.com/function/api#Regions)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Return a list of supported regions
func ListRegions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Regions(&function.RegionsRequest{
})
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)
}
```
## Delete
@@ -148,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
package example
@@ -165,10 +111,10 @@ import(
"go.m3o.com/function"
)
// Get the info for a deployed function
func DescribeFunctionStatus() {
// Reserve function names and resources beyond free quota
func ReserveAfunction() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Describe(&function.DescribeRequest{
rsp, err := functionService.Reserve(&function.ReserveRequest{
Name: "helloworld",
})
@@ -176,12 +122,12 @@ func DescribeFunctionStatus() {
}
```
## Proxy
## Runtimes
Return the backend url for proxying
Return a list of supported runtimes
[https://m3o.com/function/api#Proxy](https://m3o.com/function/api#Proxy)
[https://m3o.com/function/api#Runtimes](https://m3o.com/function/api#Runtimes)
```go
package example
@@ -193,11 +139,37 @@ import(
"go.m3o.com/function"
)
// Return the backend url for proxying
func ProxyUrl() {
// Return a list of supported runtimes
func ListRuntimes() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Proxy(&function.ProxyRequest{
Id: "helloworld",
rsp, err := functionService.Runtimes(&function.RuntimesRequest{
})
fmt.Println(rsp, err)
}
```
## Regions
Return a list of supported regions
[https://m3o.com/function/api#Regions](https://m3o.com/function/api#Regions)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/function"
)
// Return a list of supported regions
func ListRegions() {
functionService := function.NewFunctionService(os.Getenv("M3O_API_TOKEN"))
rsp, err := functionService.Regions(&function.RegionsRequest{
})
fmt.Println(rsp, err)
@@ -263,3 +235,58 @@ Request: map[string]interface{}{
}
```
## 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
func CallTheHelloworldService() {
func CallHelloworld() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
rsp, err := helloworldService.Call(&helloworld.CallRequest{
Name: "John",
@@ -50,7 +50,7 @@ import(
)
// Stream returns a stream of "Hello $name" responses
func StreamsResponsesFromTheServerUsingWebsockets() {
func StreamHelloworld() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
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:
## 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 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)
}

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)
}

34
examples/minecraft/README.md Executable file
View File

@@ -0,0 +1,34 @@
# Minecraft
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/minecraft/api](https://m3o.com/minecraft/api).
Endpoints:
## Ping
Ping a minecraft server
[https://m3o.com/minecraft/api#Ping](https://m3o.com/minecraft/api#Ping)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/minecraft"
)
// Ping a minecraft server
func PingAminecraftServer() {
minecraftService := minecraft.NewMinecraftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := minecraftService.Ping(&minecraft.PingRequest{
Address: "funcraft.net",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/minecraft"
)
// Ping a minecraft server
func main() {
minecraftService := minecraft.NewMinecraftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := minecraftService.Ping(&minecraft.PingRequest{
Address: "funcraft.net",
})
fmt.Println(rsp, err)
}

View File

@@ -4,6 +4,39 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/mq/api](https:
Endpoints:
## Publish
Publish a message. Specify a topic to group messages for a specific topic.
[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/mq"
)
// Publish a message. Specify a topic to group messages for a specific topic.
func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
},
Topic: "events",
})
fmt.Println(rsp, err)
}
```
## Subscribe
Subscribe to messages for a given topic.
@@ -45,36 +78,3 @@ func SubscribeToAtopic() {
}
}
```
## Publish
Publish a message. Specify a topic to group messages for a specific topic.
[https://m3o.com/mq/api#Publish](https://m3o.com/mq/api#Publish)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/mq"
)
// Publish a message. Specify a topic to group messages for a specific topic.
func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
},
Topic: "events",
})
fmt.Println(rsp, err)
}
```

View File

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

View File

@@ -4,12 +4,12 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/nft/api](https
Endpoints:
## Collections
## Asset
Get a list of collections
Get a single asset by the contract
[https://m3o.com/nft/api#Collections](https://m3o.com/nft/api#Collections)
[https://m3o.com/nft/api#Asset](https://m3o.com/nft/api#Asset)
```go
package example
@@ -21,11 +21,38 @@ import(
"go.m3o.com/nft"
)
// Get a list of collections
func ListCollections() {
// Get a single asset by the contract
func GetAsingleAsset() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Collections(&nft.CollectionsRequest{
Limit: 1,
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)
@@ -89,3 +116,31 @@ Name: "Guybrush Threepwood",
}
```
## Collections
Get a list of collections
[https://m3o.com/nft/api#Collections](https://m3o.com/nft/api#Collections)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/nft"
)
// Get a list of collections
func ListCollections() {
nftService := nft.NewNftService(os.Getenv("M3O_API_TOKEN"))
rsp, err := nftService.Collections(&nft.CollectionsRequest{
Limit: 1,
})
fmt.Println(rsp, err)
}
```

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,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/notes/api](htt
Endpoints:
## 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 a note
@@ -189,3 +162,30 @@ func ReadAnote() {
}
```
## 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)
}

90
examples/ping/README.md Executable file
View File

@@ -0,0 +1,90 @@
# Ping
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/ping/api](https://m3o.com/ping/api).
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
Ping a TCP port is open
[https://m3o.com/ping/api#Tcp](https://m3o.com/ping/api#Tcp)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a TCP port is open
func DialAtcpAddress() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Tcp(&ping.TcpRequest{
Address: "google.com:80",
})
fmt.Println(rsp, err)
}
```
## Url
Ping a HTTP URL
[https://m3o.com/ping/api#Url](https://m3o.com/ping/api#Url)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a HTTP URL
func CheckAurl() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Url(&ping.UrlRequest{
Address: "google.com",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping an IP address
func main() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Ip(&ping.IpRequest{
Address: "google.com",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a TCP port is open
func main() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Tcp(&ping.TcpRequest{
Address: "google.com:80",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,17 @@
package main
import (
"fmt"
"os"
"go.m3o.com/ping"
)
// Ping a HTTP URL
func main() {
pingService := ping.NewPingService(os.Getenv("M3O_API_TOKEN"))
rsp, err := pingService.Url(&ping.UrlRequest{
Address: "google.com",
})
fmt.Println(rsp, err)
}

65
examples/place/README.md Executable file
View File

@@ -0,0 +1,65 @@
# Place
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/place/api](https://m3o.com/place/api).
Endpoints:
## Nearby
Find places nearby using a location
[https://m3o.com/place/api#Nearby](https://m3o.com/place/api#Nearby)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/place"
)
// Find places nearby using a location
func FindPlacesNearby() {
placeService := place.NewPlaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := placeService.Nearby(&place.NearbyRequest{
Keyword: "tesco",
Location: "51.5074577,-0.1297515",
Type: "store",
})
fmt.Println(rsp, err)
}
```
## Search
Search for places by text query
[https://m3o.com/place/api#Search](https://m3o.com/place/api#Search)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/place"
)
// Search for places by text query
func SearchForPlaces() {
placeService := place.NewPlaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := placeService.Search(&place.SearchRequest{
Location: "51.5074577,-0.1297515",
Query: "food",
})
fmt.Println(rsp, err)
}
```

View File

@@ -0,0 +1,19 @@
package main
import (
"fmt"
"os"
"go.m3o.com/place"
)
// Find places nearby using a location
func main() {
placeService := place.NewPlaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := placeService.Nearby(&place.NearbyRequest{
Keyword: "tesco",
Location: "51.5074577,-0.1297515",
Type: "store",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"os"
"go.m3o.com/place"
)
// Search for places by text query
func main() {
placeService := place.NewPlaceService(os.Getenv("M3O_API_TOKEN"))
rsp, err := placeService.Search(&place.SearchRequest{
Location: "51.5074577,-0.1297515",
Query: "food",
})
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:
## 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 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

@@ -6,7 +6,7 @@ Endpoints:
## Index
Index a document i.e. insert a document to search for.
Index a record i.e. insert a document to search for.
[https://m3o.com/search/api#Index](https://m3o.com/search/api#Index)
@@ -21,17 +21,14 @@ import(
"go.m3o.com/search"
)
// Index a document i.e. insert a document to search for.
func IndexAdocument() {
// 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{
Document: &search.Document{
Contents: map[string]interface{}{
Data: map[string]interface{}{
"starsign": "Leo",
"name": "John Doe",
"age": 37,
"starsign": "Leo",
},
Id: "1234",
},
Index: "customers",
@@ -42,7 +39,7 @@ Index: "customers",
```
## Search
Search for documents in a given in index
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
@@ -57,8 +54,8 @@ import(
"go.m3o.com/search"
)
// Search for documents in a given in index
func SearchForAdocument() {
// 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",
@@ -71,7 +68,7 @@ Query: "name == 'John'",
```
## Search
Search for documents in a given in index
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
@@ -86,7 +83,7 @@ import(
"go.m3o.com/search"
)
// Search for documents in a given in index
// Search for records in a given in index
func SearchOnMultipleFieldsand() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
@@ -100,7 +97,7 @@ Query: "name == 'John' AND starsign == 'Leo'",
```
## Search
Search for documents in a given in index
Search for records in a given in index
[https://m3o.com/search/api#Search](https://m3o.com/search/api#Search)
@@ -115,7 +112,7 @@ import(
"go.m3o.com/search"
)
// Search for documents in a given in index
// Search for records in a given in index
func SearchOnMultipleFieldsor() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{
@@ -129,7 +126,7 @@ Query: "name == 'John' OR name == 'Jane'",
```
## 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)
@@ -144,8 +141,8 @@ import(
"go.m3o.com/search"
)
// Delete a document given its ID
func DeleteAdocument() {
// Delete a record given its ID
func DeleteArecord() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Delete(&search.DeleteRequest{
Id: "1234",

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"
)
// Index a document i.e. insert a document to search for.
// Index a record i.e. insert a document to search for.
func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Index(&search.IndexRequest{
Document: &search.Document{
Contents: map[string]interface{}{
Data: map[string]interface{}{
"starsign": "Leo",
"name": "John Doe",
"age": 37,
"starsign": "Leo",
},
Id: "1234",
},
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"
)
// Search for documents in a given in index
// Search for records in a given in index
func main() {
searchService := search.NewSearchService(os.Getenv("M3O_API_TOKEN"))
rsp, err := searchService.Search(&search.SearchRequest{

View File

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

View File

@@ -4,34 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/space/api](htt
Endpoints:
## 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 an object in space
@@ -232,3 +204,31 @@ func ListObjectsWithPrefix() {
}
```
## 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,6 +4,37 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/sunnah/api](ht
Endpoints:
## Hadiths
Hadiths returns a list of hadiths and their corresponding text for a
given book within a collection.
[https://m3o.com/sunnah/api#Hadiths](https://m3o.com/sunnah/api#Hadiths)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/sunnah"
)
// Hadiths returns a list of hadiths and their corresponding text for a
// given book within a collection.
func ListTheHadithsInAbook() {
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
rsp, err := sunnahService.Hadiths(&sunnah.HadithsRequest{
Book: 1,
Collection: "bukhari",
})
fmt.Println(rsp, err)
}
```
## Collections
Get a list of available collections. A collection is
@@ -92,34 +123,3 @@ Collection: "bukhari",
}
```
## Hadiths
Hadiths returns a list of hadiths and their corresponding text for a
given book within a collection.
[https://m3o.com/sunnah/api#Hadiths](https://m3o.com/sunnah/api#Hadiths)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/sunnah"
)
// Hadiths returns a list of hadiths and their corresponding text for a
// given book within a collection.
func ListTheHadithsInAbook() {
sunnahService := sunnah.NewSunnahService(os.Getenv("M3O_API_TOKEN"))
rsp, err := sunnahService.Hadiths(&sunnah.HadithsRequest{
Book: 1,
Collection: "bukhari",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,6 +4,34 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/twitter/api](h
Endpoints:
## User
Get a user's twitter profile
[https://m3o.com/twitter/api#User](https://m3o.com/twitter/api#User)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Get a user's twitter profile
func GetAusersTwitterProfile() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.User(&twitter.UserRequest{
Username: "crufter",
})
fmt.Println(rsp, err)
}
```
## Timeline
Get the timeline for a given user
@@ -88,31 +116,3 @@ func GetTheCurrentGlobalTrendingTopics() {
}
```
## User
Get a user's twitter profile
[https://m3o.com/twitter/api#User](https://m3o.com/twitter/api#User)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/twitter"
)
// Get a user's twitter profile
func GetAusersTwitterProfile() {
twitterService := twitter.NewTwitterService(os.Getenv("M3O_API_TOKEN"))
rsp, err := twitterService.User(&twitter.UserRequest{
Username: "crufter",
})
fmt.Println(rsp, err)
}
```

View File

@@ -4,12 +4,15 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/user/api](http
Endpoints:
## ReadSession
## VerifyToken
Read a session by the session id. In the event it has expired or is not found and error is returned.
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#ReadSession](https://m3o.com/user/api#ReadSession)
[https://m3o.com/user/api#VerifyToken](https://m3o.com/user/api#VerifyToken)
```go
package example
@@ -21,11 +24,89 @@ import(
"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() {
// 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.ReadSession(&user.ReadSessionRequest{
SessionId: "df91a612-5b24-4634-99ff-240220ab8f55",
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)
@@ -61,12 +142,13 @@ Offset: 0,
}
```
## ResetPassword
## SendPasswordResetEmail
Reset password with the code sent by the "SendPasswordResetEmail" endoint.
Send an email with a verification code to reset password.
Call "ResetPassword" endpoint once user provides the code.
[https://m3o.com/user/api#ResetPassword](https://m3o.com/user/api#ResetPassword)
[https://m3o.com/user/api#SendPasswordResetEmail](https://m3o.com/user/api#SendPasswordResetEmail)
```go
package example
@@ -78,14 +160,16 @@ import(
"go.m3o.com/user"
)
// Reset password with the code sent by the "SendPasswordResetEmail" endoint.
func ResetPassword() {
// 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.ResetPassword(&user.ResetPasswordRequest{
Code: "012345",
ConfirmPassword: "NewPassword1",
Email: "joe@example.com",
NewPassword: "NewPassword1",
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)
@@ -121,6 +205,123 @@ 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
@@ -149,6 +350,41 @@ func DeleteUserAccount() {
})
fmt.Println(rsp, err)
}
```
## SendMagicLink
Login using email only - Passwordless
[https://m3o.com/user/api#SendMagicLink](https://m3o.com/user/api#SendMagicLink)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Login using email only - Passwordless
func SendAmagicLink() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendMagicLink(&user.SendMagicLinkRequest{
Address: "www.example.com",
Email: "joe@example.com",
Endpoint: "verifytoken",
FromName: "Awesome Dot Com",
Subject: "MagicLink to access your account",
TextContent: `Hi there,
Click here to access your account $micro_verification_link`,
})
fmt.Println(rsp, err)
}
```
## Create
@@ -180,6 +416,37 @@ Username: "joe",
})
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)
}
```
## Read
@@ -266,270 +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)
}
```
## 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)
}
```
## 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{
Email: "joe@example.com",
Token: "012345",
})
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)
}
```
## SendMagicLink
Login using email only - Passwordless
[https://m3o.com/user/api#SendMagicLink](https://m3o.com/user/api#SendMagicLink)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/user"
)
// Login using email only - Passwordless
func SendAmagicLink() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.SendMagicLink(&user.SendMagicLinkRequest{
Address: "www.example.com",
Email: "joe@example.com",
Endpoint: "verifytoken",
FromName: "Awesome Dot Com",
Subject: "MagicLink to access your account",
TextContent: `Hi there,
Click here to access your account $micro_verification_link`,
})
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)
}
```
## SendVerificationEmail
Send a verification email
to the user being signed up. Email from will be from 'noreply@email.m3ocontent.com',
but you can provide the title and contents.
The verification link will be injected in to the email as a template variable, $micro_verification_link.
Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
The variable will be replaced with an actual url that will look similar to this:
'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 the user being signed up. Email from will be from 'noreply@email.m3ocontent.com',
// but you can provide the title and contents.
// The verification link will be injected in to the email as a template variable, $micro_verification_link.
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with an actual url that will look similar to this:
// '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)
}
```

View File

@@ -7,7 +7,7 @@ import (
"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() {
userService := user.NewUserService(os.Getenv("M3O_API_TOKEN"))
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{

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