No description
Find a file
GnomeZworc e16d9ed188
1.3.0: ci: update with lint params
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-09-26 02:36:21 +02:00
.forgejo/workflows 1.3.0: ci: update with lint params 2025-09-26 02:36:21 +02:00
cmd v1.3.0: back: use lib for the request data 2024-04-08 13:56:25 +02:00
config v1.2.0: back: use gorm in code 2024-03-31 00:06:52 +01:00
docs Merge branch 'release-v1.2.0' into 'main' 2024-04-01 19:34:44 +00:00
internal v1.3.0: back: use lib for the request data 2024-04-08 13:56:25 +02:00
lib v1.3.0: lib: add login struct in lib 2024-04-08 13:55:22 +02:00
scripts 1.3.0: docker: mise au propre 2025-09-26 02:21:47 +02:00
.gitignore v1.0.0: docker: add docker compose element 2024-03-15 18:09:29 +01:00
.gitlab-ci.yml v1.2.0: ci: rename job 2024-04-01 17:26:59 +02:00
Dockerfile 1.3.0: docker: update url link #1 2025-09-25 23:29:46 +02:00
go.mod v1.2.0: back: first use of gorm for the database 2024-03-30 11:07:41 +01:00
go.sum v1.2.0: back: first use of gorm for the database 2024-03-30 11:07:41 +01:00
LICENCE add LICENCE 2024-03-13 13:54:24 +01:00
README.md release-v1.2.0 2024-04-01 21:30:58 +02:00

User api management

The purpose to this project is permit the auth, register and settings of users.

This project is exclusevli develop in go, and validation lib are provided for go only.

Has this project is in H6N global project his requirement will first meet H6N needs.

Version

v1.2.0: Helium

Developpement

  • Golang
  • Docker

generate swagger

swag init --parseInternal --generalInfo ./cmd/main.go --output ./cmd/docs/

with docker compose

cat <<ENDFILE > docker-compose.yml
version: '3.1'

services:
  postgres:
    image: postgres:15.2-alpine3.17
    restart: unless-stopped
    environment:
      POSTGRES_USER: 'acc'
      POSTGRES_PASSWORD: 'totor'
      POSTGRES_DB: 'accounts'
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5
  users:
    build:
      context: .
      target: develop
    ports:
      - 127.0.0.1:2300:1222
    volumes:
      - .:/app:ro
      - ./docker/keys:/keys
    depends_on:
      postgres:
        condition: service_healthy
ENDFILE

cat config/db.sql|  docker compose exec -T postgres psql -U acc accounts

curl -s http://127.0.0.1:2300/ -H "Content-Type: application/json" -d "{\"username\":\"root@root.fr\",\"password\":\"root\"}" | jq -r '.token'