http

package
v0.0.0-...-b6406c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Bind specifies "<host>:<port>" to listen on
	Bind string
	// GymUpdates receiver
	GymUpdates chan pogo.Gym
	// SpawnUpdates receiver
	SpawnUpdates chan pogo.Spawn
	// RaidUpdates receiver
	RaidUpdates chan pogo.Raid
)

Functions

func Init

func Init()

Init sets up the routes

func Run

func Run()

Run starts the httpd

func Stop

func Stop()

Stop stops the http server immediately

Types

type BasePokemon

type BasePokemon struct {
	PokemonID int `json:"pokemon_id"`
	Form      int `json:"form,omitempty"`
	Gender    int `json:"gender,omitempty"`
	Costume   int `json:"costume,omitempty"`
}

BasePokemon for raids and spawns

type Envelope

type Envelope struct {
	Type    string          `json:"type"` // gym, pokemon, raid, pokestop, weather
	Message json.RawMessage `json:"message"`
}

Envelope is the thing that MAD posts to the configures webhooks

type GymMessage

type GymMessage struct {
	Location
	GymID            string `json:"gym_id"`
	TeamID           int    `json:"team_id"`
	Name             string `json:"name"`
	SlotsAvailable   int    `json:"slots_available"`
	URL              string `json:"url,omitempty"`
	IsExRaidEligible int    `json:"is_ex_raid_eligible"`
}

GymMessage contains raid/egg and defender info

type Location

type Location struct {
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
}

Location in geo coordinates

type PokemonMessage

type PokemonMessage struct {
	Location
	BasePokemon
	EncounterID        big.Int `json:"encounter_id"`
	SpawnpointID       big.Int `json:"spawnpoint_id"`
	DisappearTimestamp int64   `json:"disappear_time"`
	KnownDisappearTime bool    `json:"verified"`
	Rarity             int     `json:"rarity"`
}

PokemonMessage describes a spawned pokemon

type RaidMessage

type RaidMessage struct {
	Location
	Level            int    `json:"level"`
	TeamID           int    `json:"team_id"`
	StartTimestamp   int    `json:"start"`
	EndTimestamp     int    `json:"end"`
	Name             string `json:"name"`
	GymID            string `json:"gym_id"`
	URL              string `json:"url,omitempty"`
	IsExRaidEligible bool   `json:"is_ex_raid_eligible"`
	IsExclusive      bool   `json:"is_exclusive"`

	BasePokemon
}

RaidMessage contains raid info for a gym

type RaidPokemon

type RaidPokemon struct {
	CP        int `json:"cp"`
	Evolution int `json:"evolution"`
	Move1     int `json:"move_1"`
	Move2     int `json:"move_2"`

	// when spawned:
	BasePokemon
}

RaidPokemon describes an egg or spawned raid boss

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL