Documentation ¶
Index ¶
- type Ban
- type Bans
- type Broadcast
- type Client
- func (c *Client) Ban(b Ban) (int, error)
- func (c *Client) Bans() (bans Ban, err error)
- func (c *Client) Broadcast(b Broadcast) (int, error)
- func (c *Client) Custom(cu Custom) (int, error)
- func (c *Client) GraphQL() *gql.Client
- func (c *Client) GraphQLRequest(query string) *gql.Request
- func (c *Client) Kick(k Kick) (int, error)
- func (c *Client) Ping() (ping *Ping, err error)
- func (c *Client) Players() (players Players, err error)
- func (c *Client) Plugins() (plugins Plugins, err error)
- func (c *Client) TPS() (tps *TPS, err error)
- func (c *Client) TempBan(t TempBan) (int, error)
- func (c *Client) Unban(u Unban) (int, error)
- func (c *Client) World(name string) (world *World, err error)
- func (c *Client) Worlds() (worlds Worlds, err error)
- type ClientOption
- type Custom
- type Kick
- type Ping
- type Player
- type Players
- type Plugin
- type Plugins
- type TPS
- type TempBan
- type Unban
- type Weather
- type World
- type Worlds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ban ¶
Ban is a Minecraft ban
type Broadcast ¶
Broadcast is a server-wide message
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client aimed at a specific ServerAPI endpoint
func NewClient ¶
func NewClient(endpoint string, opts ...ClientOption) *Client
NewClient returns a new Client for making ServerAPI requests
func (*Client) Bans ¶
Bans gets a list of Ban from a ServerAPI instance
func (*Client) Broadcast ¶
Broadcast sends a message to the server
func (*Client) Custom ¶
Custom sends a custom command to the server
func (*Client) GraphQL ¶
GraphQL returns a gql.Client for a ServerAPI instance
func (*Client) GraphQLRequest ¶
GraphQLRequest returns a pre-filled gql.Request with the password set
func (*Client) Players ¶
Players returns a list of Player from a ServerAPI instance
func (*Client) Plugins ¶
Plugins returns a list of Plugin from a ServerAPI instance
func (*Client) TPS ¶
TPS returns TPS from a ServerAPI instance
func (*Client) TempBan ¶
TempBan temporarily bans a player
func (*Client) World ¶
World returns a single World from a ServerAPI instance
type ClientOption ¶
type ClientOption func(c *Client)
ClientOption is options for a Client
func WithHTTP ¶
func WithHTTP(http *http.Client) ClientOption
WithHTTP is a ClientOption for setting the http.Client of a Client
func WithToken ¶
func WithToken(token string) ClientOption
WithToken is a ClientOption for setting the token of a Client
type Custom ¶
Custom is for edge-cases
type Ping ¶
type Ping struct { CurrentPlayers int `json:"current_players"` MaxPlayers int `json:"max_players"` Type string `json:"type"` Version string `json:"version"` MOTD string `json:"motd"` }
Ping is a Minecraft ping query
type Player ¶
Player is a Minecraft player
type Plugin ¶
type Plugin struct { Name string `json:"name"` Version string `json:"version"` Website string `json:"website"` Authors []string `json:"authors"` }
Plugin is a Minecraft plugin
type TPS ¶
TPS is a Minecraft server's relative performance
type TempBan ¶
Ban is a Minecraft ban with an expiration