From 1fe78a76ab9d45ce1eb4063458cd3248ad722598 Mon Sep 17 00:00:00 2001 From: ilbinek Date: Fri, 10 Apr 2026 20:49:18 +0200 Subject: [PATCH] Add README with install and logging docs --- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..149d4b3 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# reforger_utils + +Utilities for downloading and processing Arma Reforger workshop content. + +## Install + +This module is hosted on a private Gitea instance. + +Set private module settings once: + +```powershell +go env -w GOPRIVATE=gitea.tbdevent.eu +``` + +Then install a version: + +```powershell +go get gitea.tbdevent.eu/ilbinek/reforger_utils@v0.0.15 +``` + +## Features + +- Download asset metadata and manifests from BI APIs. +- Download and rebuild fragmented files. +- Parse PAK file entries. +- Optional SOCKS5/Tor support for HTTP requests. + +## Basic Usage + +```go +package main + +import ( + "fmt" + + "gitea.tbdevent.eu/ilbinek/reforger_utils" +) + +func main() { + assets, err := reforger_utils.DoAssetsRequest("BADC0DEDABBEDA5E", "0.12.4573") + if err != nil { + panic(err) + } + + fmt.Printf("found %d assets\n", len(assets)) +} +``` + +## Logging + +The library uses structured slog logging and writes JSON logs to stdout by default. +This is container-friendly (including Dokploy) because logs are newline-based and do not overwrite previous output. + +You can inject your own logger: + +```go +package main + +import ( + "log/slog" + "os" + + "gitea.tbdevent.eu/ilbinek/reforger_utils" +) + +func main() { + logger := slog.New(slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelInfo})) + reforger_utils.SetLogger(logger) +} +``` + +## Development + +```powershell +go test ./... +```