No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-26 12:45:26 +01:00
.github Add FUNDING.yml 2023-12-15 16:08:14 -08:00
examples Add tokensave example 2026-10-25 18:34:17 +01:00
.gitignore Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
gen.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
go.mod Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
go.sum Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
LICENSE Add GPLv3 license 2022-12-10 09:18:40 -08:00
oas_cfg_gen.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
oas_client_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
oas_json_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
oas_operations_gen.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
oas_parameters_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
oas_request_encoders_gen.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
oas_response_decoders_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
oas_schemas_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
oas_security_gen.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
oas_validators_gen.go Rewrite openapi spec to use integer instead of number (temporary fix) 2026-10-26 12:45:26 +01:00
ogen.yml Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00
README.md Add v4 note 2026-10-25 18:37:19 +01:00
securitysource.go Update Lemmy bindings for api v4 2026-10-25 17:11:20 +01:00

Go-Lemmy

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

v4 Note

The latest version of this library uses the Lemmy v4 API. That API version hasn't been fully released yet so most Lemmy instances are still using the v3 API. If you want to continue using the v3 API for compatibility with older Lemmy instances, import go.elara.ws/go-lemmy/v3. Otherwise, import go.elara.ws/go-lemmy/v4. Note that these versions purely track the current Lemmy API version, so breaking changes can occur if the OpenAPI spec changes in such a way to cause them.

Examples

Examples can be found in the examples directory.

How to generate

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

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

Inside it, build the openapi spec:

pnpm tsoa

Next, leave that directory and run:

go generate .

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