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
func (*Ban) CreatedTime ¶
CreatedTime is Created converted to a time.Time
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) GraphQLRequest ¶
GraphQLRequest returns a pre-filled gql.Request with the password set
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 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 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 TempBan ¶
Ban is a Minecraft ban with an expiration
func (*TempBan) ExpirationTime ¶
ExpirationTime is Expiration converted to a time.Time
Click to show internal directories.
Click to hide internal directories.