Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

# Runs on PRs and pushes to the default branch. We use `pull_request` (never
# `pull_request_target`), so secrets are NOT exposed to pull requests from forks.
on:
pull_request:
push:
branches: [main, master]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build SDK
working-directory: client
run: go build ./...
- name: Sync test module dependencies
run: go mod tidy
- name: Run tests
run: go test ./tests/... -v
env:
FASTCOMMENTS_API_KEY: ${{ secrets.FASTCOMMENTS_API_KEY }}
FASTCOMMENTS_TENANT_ID: ${{ secrets.FASTCOMMENTS_TENANT_ID }}
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,43 @@ func main() {
}
```

#### Moderation API (Moderator Dashboard)

The ModerationAPI powers the moderator dashboard. It provides methods for listing,
counting, searching, and exporting comments, moderation actions (remove/restore,
flag, set review/spam/approval status, votes, reopen/close threads), bans (ban from
comment, undo, pre-ban summaries, ban status and preferences, banned-user counts),
and badges & trust (award/remove badges, manual badges, get/set trust factor, user
internal profile). All Moderation methods accept an `sso` parameter for
SSO-authenticated moderators:

```go
package main

import (
"context"
"fmt"
"github.com/fastcomments/fastcomments-go/client"
)

func main() {
config := client.NewConfiguration()
apiClient := client.NewAPIClient(config)

// List comments for moderation using ModerationAPI
response, httpResp, err := apiClient.ModerationAPI.GetApiComments(
context.Background(),
).Sso("your-sso-token").Execute()

if err != nil {
panic(err)
}

fmt.Printf("Status: %d\n", httpResp.StatusCode)
fmt.Printf("Comments: %+v\n", response)
}
```

## Usage

### Simple SSO
Expand Down
Loading
Loading