Adding references to lemmy types from docs. (#1203)

* Adding references to lemmy types from docs.

* Updating TOC.

* Updating docs.
pull/1209/head
Dessalines 2020-10-15 13:56:16 -04:00 committed by GitHub
parent 3e35e4052f
commit 24484ed801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 1 deletions

View File

@ -5,6 +5,8 @@
<!-- toc --> <!-- toc -->
- [Data types](#data-types) - [Data types](#data-types)
* [Lemmy types](#lemmy-types)
* [Lower-level types](#lower-level-types)
- [Basic usage](#basic-usage) - [Basic usage](#basic-usage)
* [WebSocket](#websocket) * [WebSocket](#websocket)
+ [Testing with Websocat](#testing-with-websocat) + [Testing with Websocat](#testing-with-websocat)
@ -265,11 +267,28 @@
## Data types ## Data types
### Lemmy types
The fields for objects like Users, Comments, Communities, and Posts, are in the [lemmy_db](https://github.com/LemmyNet/lemmy/tree/main/lemmy_db/src) folder, with the suffix `_view`. The main types are:
- [CommentView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/comment_view.rs)
- [CommunityView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/community_view.rs)
- [PostView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/post_view.rs)
- [UserView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/user_view.rs)
- [PrivateMessageView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/private_message_view.rs)
- [UserMentionView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/user_mention_view.rs)
- [SiteView](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/site_view.rs)
- [Category](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/category.rs)
- [Moderator Views](https://github.com/LemmyNet/lemmy/blob/main/lemmy_db/src/moderator_views.rs)
The requests and responses, although copied below, are most up to date in [lemmy_structs](https://github.com/LemmyNet/lemmy/tree/main/lemmy_structs/src).
### Lower-level types
- `i16`, `i32` and `i64` are respectively [16-bit](https://en.wikipedia.org/wiki/16-bit), [32-bit](https://en.wikipedia.org/wiki/32-bit) and [64-bit](https://en.wikipedia.org/wiki/64-bit_computing) integers. - `i16`, `i32` and `i64` are respectively [16-bit](https://en.wikipedia.org/wiki/16-bit), [32-bit](https://en.wikipedia.org/wiki/32-bit) and [64-bit](https://en.wikipedia.org/wiki/64-bit_computing) integers.
- <code>Option<***SomeType***></code> designates an option which may be omitted in requests and not be present in responses. It will be of type ***SomeType***. - <code>Option<***SomeType***></code> designates an option which may be omitted in requests and not be present in responses. It will be of type ***SomeType***.
- <code>Vec<***SomeType***></code> is a list which contains objects of type ***SomeType***. - <code>Vec<***SomeType***></code> is a list which contains objects of type ***SomeType***.
- `chrono::NaiveDateTime` is a timestamp string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Timestamps will be UTC. - `chrono::NaiveDateTime` is a timestamp string in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Timestamps will be UTC.
- Other data types are listed [here](../src/db).
## Basic usage ## Basic usage