Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Admin() *admin.Service
- func (c *Client) Antennas() *antennas.Service
- func (c *Client) App() *app.Service
- func (c *Client) Clips() *clips.Service
- func (c *Client) Drive() *drive.Service
- func (c *Client) Federation() *federation.Service
- func (c *Client) Following() *following.Service
- func (c *Client) Hashtags() *hashtags.Service
- func (c *Client) LogLevel(level logrus.Level)
- func (c *Client) Meta() *meta.Service
- func (c *Client) Notes() *notes.Service
- func (c *Client) Notifications() *notifications.Service
- func (c *Client) Promo() *promo.Service
- func (c *Client) Users() *users.Service
- type ClientOption
- type ClientOptionError
Constants ¶
const RequestTimout = 10
RequestTimout is the timeout of a request in seconds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string Token string HTTPClient core.HTTPClient // contains filtered or unexported fields }
Client is the main Misskey client struct.
func NewClientWithOptions ¶ added in v1.1.0
func NewClientWithOptions(options ...ClientOption) (*Client, error)
NewClientWithOptions creates a new Misskey Client with defined options.
func (*Client) Federation ¶
func (c *Client) Federation() *federation.Service
Federation contains all endpoints under /federation.
func (*Client) Meta ¶
Meta is all the endpoints under Meta in the documentation. They don't have an API pth prefix.
func (*Client) Notifications ¶
func (c *Client) Notifications() *notifications.Service
Notifications contains all endpoints under /notifications.
type ClientOption ¶ added in v1.1.0
ClientOption is a function that can be used to configure a client.
func WithAPIToken ¶ added in v1.1.0
func WithAPIToken(token string) ClientOption
WithAPIToken configures the API token on the client.
func WithBaseURL ¶ added in v1.1.0
func WithBaseURL(protocol, domain, path string) ClientOption
WithBaseURL configures the base url of the Misskey instance.
- Protocol: http, https
- Domain: Well, that's the domain name
- Path: Leave it empty, unless the target instance is not served from the root path. Important: Do not add a tailing slash.
func WithHTTPClient ¶ added in v1.1.0
func WithHTTPClient(httpClient core.HTTPClient) ClientOption
WithHTTPClient configures an HTTP Client instead of creating a new one.
func WithLogLevel ¶ added in v1.1.0
func WithLogLevel(level logrus.Level) ClientOption
WithLogLevel configures the logger to use the specified log level.
func WithSimpleConfig ¶ added in v1.1.0
func WithSimpleConfig(baseURL, token string) ClientOption
WithSimpleConfig configures the client with similar logic as NewClient().
The sole purpose of this to make it easier to migrate to the new function.
type ClientOptionError ¶ added in v1.1.0
type ClientOptionError struct {
Message string
}
ClientOptionError occures when something goes wrong with any of the requested options.
func (ClientOptionError) Error ¶ added in v1.1.0
func (e ClientOptionError) Error() string