fds

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MIT

README

FDS Core

API

/
Methods
  • NewFDSClient(url string) *Client NewFDSClient creates a new client for the FDS API. For most cases, it is recommended to use the SetToken method soon after to set the token.
  • SetToken(token string) SetToken (on Client) sets the token for the client. This token is used for authentication.
/discord
POST /verify Meant for linking Discord to Minecraft accounts
Request Body (JSON)
type DiscordVerifyRequest struct {
  ID   string `json:"id"`
  Nick string `json:"nick"`
  Name string `json:"name"`
}
Response Body (JSON)
type DiscordVerifyResponse struct {
  Actual string `json:"actual"`
}
Method (on Client)
PATCH /:id/daily Claim a daily reward for a Discord user by id
Request Parameters
  • id the Discord id of the user whose daily should be claimed
Response Body (JSON)
type DiscordDailyResponse struct {
  Actual string `json:"actual"`
}
Method (on Client)

ClaimDaily(id string) (*DiscordDailyResponse, error) Daily is used to claim the daily reward for a Discord user. The backend will return the user's updated stats.

POST /bot-login Log in port for a Discord bot instance no auth
Request Body (JSON)
type DiscordBotLoginRequest struct {
  Pwd string `json:"pwd" query:"pwd"`
}
Response Body (JSON)
type DiscordBotLoginResponse struct {
  Actual string `json:"actual"`
}
Method (on Client)

BotLogin(input *DiscordBotLoginRequest) (*DiscordBotLoginResponse, error) BotLogin is used to login the bot to the Discord API. No token is required for this endpoint.

Environment Variables

  • port - The port to listen on
  • db_host - The host of the database
  • db_port - The port of the database
  • db_user - The user of the database
  • db_pwd - The password of the database
  • db_name - The name of the database
  • db_namespace - The namespace of the database
  • jwt_secret - The secret used to sign JWTs
  • bot_pwd - The password of the Discord bot
  • hypixel_api_key - The Hypixel API key

ToDo

  • Migrate from GraphQL to REST
  • Migrate from Neo4j to SurrealDB
  • Add response tables to API definition
  • Create REST documentation
  • Create HTTP bindings
  • Document HTTP bindings
  • Create WebSocket bindings
  • Document WebSocket bindings
  • Create SSE bindings
  • Document SSE bindings
  • Migrate from Mux to Echo
  • Implement authentication

Directories

Path Synopsis
cmd
app command
internal
pkg
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL