An open API service indexing awesome lists of open source software.

https://github.com/stardustdl/loment

Loment is a light comment service.
https://github.com/stardustdl/loment

acblog comment-system comments dotnet golang

Last synced: 21 days ago
JSON representation

Loment is a light comment service.

Awesome Lists containing this project

README

        

# loment

![CI](https://github.com/StardustDL/loment/workflows/CI/badge.svg) ![CD](https://github.com/StardustDL/loment/workflows/CD/badge.svg) ![License](https://img.shields.io/github/license/StardustDL/loment.svg) [![Loment](https://buildstats.info/nuget/Loment)](https://www.nuget.org/packages/Loment/)

Loment is a Light cOmMENT service.

## API

- **Post** `/` with *Comment* body: Create comment, return id
- **Post** `/query` with *CommentQuery* body: Query comments, return list of comments
- - **Post** `/count` with *CommentQuery* body: Query and count comments, return the number of comments
- **Get** `/id`: Get comment by id, return comment
- **Delete** `/id`: Delete comment by id, return if done
- **Put** `/id` with *Comment* body: Update comment by id, return if done

## Models

```go
type Comment struct {
Id string
CreationTime time.Time
ModificationTime time.Time
Content string
Uri string
Author string
Email string
Link string
Extra string
}

type CommentQuery struct {
Id string
CreationTime time.Time
ModificationTime time.Time
Content string
Uri string
Author string
Email string
Link string
Offset int
Limit int
}
```

## SDK

For C#.

```sh
dotnet add package Loment
```

API:

```csharp
public interface ILomentService
{
Task Create(Comment comment, CancellationToken cancellationToken = default);

Task> Query(CommentQuery query, CancellationToken cancellationToken = default);

Task Count(CommentQuery query, CancellationToken cancellationToken = default);

Task Get(string id, CancellationToken cancellationToken = default);

Task Delete(string id, CancellationToken cancellationToken = default);

Task Update(Comment comment, CancellationToken cancellationToken = default);
}
```

## Status

![](https://buildstats.info/github/chart/StardustDL/loment?branch=master)