Go to file
2023-10-04 17:14:28 -07:00
cmd/gen Unexport types that no longer need to be exported 2023-10-04 16:28:52 -07:00
examples/http Merge types package into root lemmy package 2023-10-04 16:23:31 -07:00
.gitignore Update for 0.18.0 2023-07-03 17:47:46 -07:00
errors.go Merge types package into root lemmy package 2023-10-04 16:23:31 -07:00
go.mod Rewrite generator and update for Lemmy 0.18.3 2023-09-24 19:28:46 -07:00
go.sum Rewrite generator and update for Lemmy 0.18.3 2023-09-24 19:28:46 -07:00
lemmy.go Add comment for ErrNoToken 2023-10-04 17:14:28 -07:00
LICENSE Add GPLv3 license 2022-12-10 09:18:40 -08:00
optional.go Return bool from Optional[T].Value() instead of an error 2023-10-04 16:44:07 -07:00
README.md Rewrite generator and update for Lemmy 0.18.3 2023-09-24 19:28:46 -07:00
routes.gen.go Unexport types that no longer need to be exported 2023-10-04 16:28:52 -07:00
types.gen.go Unexport types that no longer need to be exported 2023-10-04 16:28:52 -07:00
types.go Unexport types that no longer need to be exported 2023-10-04 16:28:52 -07:00

Go-Lemmy

Go Reference

Go bindings to the Lemmy API, automatically generated from Lemmy's source code using the generator in cmd/gen.

Examples:

How to generate

First, clone the lemmy-js-client repo at whatever version you need:

git clone https://github.com/LemmyNet/lemmy-js-client -b 0.18.3

Inside it, build the JSON docs file:

npm run docs -- --json docs.json

Next, build the generator:

go build ./cmd/gen

Remove all the existing generated code:

rm **/*.gen.go

Execute the generator:

./gen -json-file <path_to_docs.json> -out-dir .

And that's it! Your generated code should be ready for use.