Documentation ¶
Overview ¶
Package screeps - Screeps API Library
Index ¶
- func Example()
- type AuthMeResponse
- type AuthSigninRequest
- type AuthSigninResponse
- type AuthmodResponse
- type Badge
- type BaseResponse
- type Client
- func (c *Client) AuthMe() (*AuthMeResponse, error)
- func (c *Client) AuthSignin() (*AuthSigninResponse, error)
- func (c *Client) Authmod() (*AuthmodResponse, error)
- func (c *Client) GetMemory(path string, shard string) (*GetMemoryResponse, error)
- func (c *Client) GetMemorySegment(segment int, shard string) (*GetMemoryResponse, error)
- func (c *Client) GetMemorySegments(segments []int, shard string) ([]GetMemoryResponse, error)
- func (c *Client) GetVersion() (*VersionResponse, error)
- func (c *Client) IsOfficial() bool
- func (c *Client) QueryToken(token string) (*QueryTokenResponse, error)
- func (c *Client) RoomHistory(room string, tick int64, shard string) (*RoomHistoryResponse, error)
- func (c *Client) ServersList() (*ServersListResponse, error)
- func (c *Client) SetDebug(val bool)
- func (c *Client) Version() (*VersionResponse, error)
- type GetMemoryResponse
- type GetMemorySegmentsResponse
- type QueryTokenResponse
- type RoomHistoryResponse
- type RoomObject
- type ServersListResponse
- type Token
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthMeResponse ¶
type AuthMeResponse struct { BaseResponse `json:",inline"` ID string `json:"_id"` Email string Username string CPU int Badge Badge Password bool LastRespawnDate int64 NotifyPrefs struct { ErrorsInterval int } GCL int64 Credits int64 Subscription bool LifetimeSubscription bool Power int64 Money float64 SubscriptionTokens int CPUShard map[string]int CPUShardUpdatedTime int64 Runtime struct { IVM bool } PowerExperimentations int PowerExperimentationTime int64 Github struct { ID string Username string } Steam struct { ID string DisplayName string Ownership []int } }
AuthMeResponse AuthMeResponse
type AuthSigninRequest ¶
AuthSigninRequest AuthSigninRequest
type AuthSigninResponse ¶
type AuthSigninResponse struct { BaseResponse Token string }
AuthSigninResponse AuthSigninResponse
type AuthmodResponse ¶
type AuthmodResponse struct { BaseResponse Name string Version string AllowRegistration bool Steam bool Github string }
AuthmodResponse AuthmodResponse
type Client ¶
type Client struct { DefaultShard string // contains filtered or unexported fields }
Client Screeps API client
func (*Client) AuthSignin ¶
func (c *Client) AuthSignin() (*AuthSigninResponse, error)
AuthSignin POST /api/auth/signin
func (*Client) Authmod ¶
func (c *Client) Authmod() (*AuthmodResponse, error)
Authmod GET /api/authmod
func (*Client) GetMemory ¶
func (c *Client) GetMemory(path string, shard string) (*GetMemoryResponse, error)
GetMemory GET /api/user/memory
func (*Client) GetMemorySegment ¶
func (c *Client) GetMemorySegment(segment int, shard string) (*GetMemoryResponse, error)
GetMemorySegment GET /api/user/memory-segment
func (*Client) GetMemorySegments ¶
func (c *Client) GetMemorySegments(segments []int, shard string) ([]GetMemoryResponse, error)
GetMemorySegments GET /api/user/memory-segment
func (*Client) GetVersion ¶
func (c *Client) GetVersion() (*VersionResponse, error)
GetVersion - Returns the current server version and info (Cached)
func (*Client) IsOfficial ¶
IsOfficial Returns true if server is screeps.com
func (*Client) QueryToken ¶
func (c *Client) QueryToken(token string) (*QueryTokenResponse, error)
QueryToken GET /api/auth/query-token
func (*Client) RoomHistory ¶
RoomHistory GET /api/room-history Returns empty RoomHistoryResponse if history doesn't exist
func (*Client) ServersList ¶
func (c *Client) ServersList() (*ServersListResponse, error)
ServersList POST /api/servers/list
func (*Client) Version ¶
func (c *Client) Version() (*VersionResponse, error)
Version GET /api/version
type GetMemoryResponse ¶
type GetMemoryResponse struct { BaseResponse Data string }
GetMemoryResponse Response for #GetMemory
func (*GetMemoryResponse) Decompress ¶
func (mr *GetMemoryResponse) Decompress() error
Decompress - Decompresses gzip compressed data
func (*GetMemoryResponse) Parse ¶
func (mr *GetMemoryResponse) Parse(tgt *interface{}) error
Parse - Parses JSON data into struct
type GetMemorySegmentsResponse ¶
type GetMemorySegmentsResponse struct { BaseResponse Data []string }
GetMemorySegmentsResponse GetMemorySegmentsResponse
type QueryTokenResponse ¶
type QueryTokenResponse struct { BaseResponse Token Token }
QueryTokenResponse QueryTokenResponse
type RoomHistoryResponse ¶
type RoomHistoryResponse struct { Timestamp int64 Room string Base int64 Ticks map[string]map[string]RoomObject }
RoomHistoryResponse RoomHistoryResponse
type RoomObject ¶
type RoomObject struct { ID string `json:"_id"` Room string Type string X int8 Y int8 Props map[string]interface{} `json:",inline"` }
RoomObject - Screeps RoomObject
type ServersListResponse ¶
type ServersListResponse struct { BaseResponse Likes []interface{} Servers []struct { ID string `json:"_id"` LikeCount int Name string Settings struct { Host string Pass string Port string } Status string } }
ServersListResponse Response for #ServersList
type VersionResponse ¶
type VersionResponse struct { BaseResponse Package int Protocol int UseNativeAuth bool Users int ServerData struct { WelcomeText string HistoryChunkSize int Shards []string SocketUpdateThrottle int Renderer interface{} CustomObjectTypes interface{} } }
VersionResponse VersionResponse