Documentation ¶
Index ¶
- func UnmarshalResponse(data []byte, v interface{}) bool
- type CPUResponse
- type CodeResponse
- type ConsoleResponse
- type MemoryResponse
- type MessageResponse
- type NewMessageResponse
- type RawRoomResponse
- type Response
- type RoomMapResponse
- type RoomResponse
- type ServerMessageResponse
- type SetActiveBranchResponse
- type WebSocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalResponse ¶
Types ¶
type CPUResponse ¶
type CodeResponse ¶
type ConsoleResponse ¶
type ConsoleResponse struct { Response Shard string `json:"shard"` Messages screepstype.ConsoleMessages `json:"messages"` }
type MemoryResponse ¶
type MemoryResponse struct {
Response
}
type MessageResponse ¶
type MessageResponse struct { Response NewMessage screepstype.NewMessage `json:"newMessage"` MessageRead screepstype.MessageRead `json:"messageRead"` }
type NewMessageResponse ¶
type NewMessageResponse struct {
Response
}
type RawRoomResponse ¶
type RawRoomResponse struct { Response Flags int `json:"flags"` Info screepstype.RoomInfo `json:"info"` Users map[string]screepstype.User `json:"users"` Objects map[string]json.RawMessage `json:"objects"` }
type RoomMapResponse ¶
type RoomMapResponse struct { Response Walls [][]int `json:"w"` Roads [][]int `json:"r"` PowerBanks [][]int `json:"pb"` Portals [][]int `json:"p"` Sources [][]int `json:"s"` Controllers [][]int `json:"c"` Minerals [][]int `json:"m"` KeeperLairs [][]int `json:"k"` UserObjects map[string][][]int }
func (*RoomMapResponse) UnmarshalJSON ¶
func (r *RoomMapResponse) UnmarshalJSON(b []byte) error
type RoomResponse ¶
type RoomResponse struct { Response Flags int `json:"flags"` Info screepstype.RoomInfo `json:"info"` Users map[string]screepstype.User `json:"users"` Controllers map[string]screepstype.Controller Creeps map[string]screepstype.Creep Energies map[string]screepstype.Energy Extensions map[string]screepstype.Extension Minerals map[string]screepstype.Mineral Roads map[string]screepstype.Road Sources map[string]screepstype.Source Spawns map[string]screepstype.Spawn Storages map[string]screepstype.Storage Towers map[string]screepstype.Tower Walls map[string]screepstype.Wall Deltas map[string]json.RawMessage }
func (*RoomResponse) UnmarshalJSON ¶
func (r *RoomResponse) UnmarshalJSON(b []byte) error
type ServerMessageResponse ¶
type ServerMessageResponse struct {
Response
}
type SetActiveBranchResponse ¶
type SetActiveBranchResponse struct { Response Branch string `json:"branch"` ActiveName screepstype.ActiveName `json:"branch"` }
type WebSocket ¶
type WebSocket interface { Close() error // Server SubscribeServerMessage() (<-chan ServerMessageResponse, error) UnsubscribeServerMessage() error // Room SubscribeRoom(shard, room string) (<-chan RoomResponse, error) UnsubscribeRoom(shard, room string) error SubscribeRoomMap(shard, room string) (<-chan RoomMapResponse, error) UnsubscribeRoomMap(shard, room string) error // User SubscribeCode(userID string) (<-chan CodeResponse, error) UnsubscribeCode(userID string) error SubscribeConsole(userID string) (<-chan ConsoleResponse, error) UnsubscribeConsole(userID string) error SubscribeCPU(userID string) (<-chan CPUResponse, error) UnsubscribeCPU(userID string) error SubscribeMemory(userID, path string) (<-chan MemoryResponse, error) UnsubscribeMemory(userID, path string) error SubscribeMessage(userID, respondentID string) (<-chan MessageResponse, error) UnsubscribeMessage(userID, respondentID string) error SubscribeMoney(userID string) (<-chan int, error) UnsubscribeMoney(userID string) error SubscribeNewMessage(userID string) (<-chan NewMessageResponse, error) UnsubscribeNewMessage(userID string) error SubscribeSetActiveBranch(userID string) (<-chan SetActiveBranchResponse, error) UnsubscribeSetActiveBranch(userID string) error }
func NewWebSocket ¶
Click to show internal directories.
Click to hide internal directories.