mattn / go-mastodon

mastodon client for golang
MIT License
604 stars 88 forks source link
go golang mastodon

go-mastodon

Build Status Codecov Go Reference Go Report Card

Usage

There are three ways to authenticate users. Fully working examples can be found in the examples directory.

User Credentials

This method is the simplest and allows you to use an application registered in your account to interact with the Mastodon API on your behalf.

Working example: examples/user-credentials/main.go

Public Application

Public applications use application tokens and have limited access to the API, allowing access only to public data.

Learn more at: Mastodon docs

Working example: examples/public-application/main.go

Application with Client Credentials (OAuth)

This option allows you to create an application that can interact with the Mastodon API on behalf of a user. It registers the application and requests user authorization to obtain an access token.

Learn more at: Mastodon docs

Working example: examples/user-oauth-authorization/main.go

Status of implementations

Installation

go install github.com/mattn/go-mastodon@latest

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)