Go to file
2022-12-12 18:12:22 -08:00
types Add WebSocket types 2022-12-12 18:11:57 -08:00
.gitignore Initial Commit 2022-12-10 09:17:16 -08:00
admin.go Remove List prefixes to match naming of other functions 2022-12-10 12:15:14 -08:00
comment.go Remove List prefixes to match naming of other functions 2022-12-10 12:15:14 -08:00
community.go Initial Commit 2022-12-10 09:17:16 -08:00
go.mod Add support for websocket api 2022-12-12 17:35:41 -08:00
go.sum Add support for websocket api 2022-12-12 17:35:41 -08:00
lemmy.go Check response status code more strictly 2022-12-10 15:40:52 -08:00
LICENSE Add GPLv3 license 2022-12-10 09:18:40 -08:00
person.go Remove duplicate MarkCommentReplyAsRead 2022-12-10 12:07:30 -08:00
post.go Remove List prefixes to match naming of other functions 2022-12-10 12:15:14 -08:00
privateMessage.go Initial Commit 2022-12-10 09:17:16 -08:00
README.md Add Go Reference badge to README 2022-12-10 17:52:09 +00:00
search.go Add search endpoint 2022-12-10 12:07:19 -08:00
site.go Initial Commit 2022-12-10 09:17:16 -08:00
websocket.go Add login support for WebSocket API 2022-12-12 18:12:22 -08:00

Go-Lemmy

Go Reference

Go bindings to the Lemmy API

Example:

ctx := context.Background()

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

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

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