aboutsummaryrefslogtreecommitdiff
path: root/lib/channel.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/channel.ml')
-rw-r--r--lib/channel.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/channel.ml b/lib/channel.ml
new file mode 100644
index 0000000..904bbde
--- /dev/null
+++ b/lib/channel.ml
@@ -0,0 +1,10 @@
+type t = {
+ id: string;
+ name: string;
+}
+
+let from_json term =
+ let module J = Yojson.Basic.Util in
+ let id = J.(member "id" term |> to_string) in
+ let name = J.(member "name" term |> to_string) in
+ { id; name; }