skymp-master-api-go

module
v0.0.0-...-bef6861 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: AGPL-3.0

README

SkyMP Master API

Red House SkyMP Master API implementation written on Go. Supports only MongoDB databases. Verification methods are not yet provided.

Build

Prerequisites
  • Go for build.
  • Docker for use local MongoDB database.
Installing dependencies
go get -d -v ./
Building app
go build -o main ./cmd/app/main.go
Run app without build
go run ./cmd/app/main.go

Configuration

App use environment variables and config file.

All environment variables:

  • MONGO_URI - string
  • PASSWORD_SALT - string
  • JWT_SECRET - string
  • PORT - uint16 (0 < port < 65535)
  • PRODUCTION - bool

Development

During development, you can use local database instance in docker via:

docker run --name mongodb -d -p 27017:27017 mongo

Tests

Run tests:

go test ./...
Mock generation

Install GoMock:

go install github.com/golang/mock/mockgen@v1.6.0

Generate:

mockgen -source="./internal/service/service.go" -destination="./internal/service/mocks/mock.go"

Directories

Path Synopsis
cmd
app
internal
service/mocks
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

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