Go to file
2023-01-05 13:46:07 -08:00
cmd/gen Add new LemmyTime type and remove omitempty from json tag 2023-01-05 13:42:24 -08:00
types Add new LemmyTime type and remove omitempty from json tag 2023-01-05 13:42:24 -08:00
.gitignore Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
go.mod Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
go.sum Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
lemmy.go Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
LICENSE Add GPLv3 license 2022-12-10 09:18:40 -08:00
README.md Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
routes.gen.go Use autogenerated bindings for Lemmy 0.16.7 2023-01-05 12:51:45 -08:00
websocket.go Remove debug code 2023-01-05 13:46:07 -08:00

Go-Lemmy

Go Reference

Go bindings to the Lemmy API

Example:

ctx := context.Background()

c, err := lemmy.New("https://lemmygrad.ml")
if err != nil {
	panic(err)
}

err = c.ClientLogin(ctx, types.Login{
	UsernameOrEmail: "user@example.com",
	Password:        `TestPwd`,
})
if err != nil {
	panic(err)
}

_, err = c.SaveUserSettings(ctx, types.SaveUserSettings{
	BotAccount: types.NewOptional(true),
})
if err != nil {
	panic(err)
}