Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Shallow type. Shallow GridType = "shallow" // Deep type. Deep GridType = "deep" // Unique artifact type. Unique GridArtifactType = "unique" // Legendary artifact type. Legendary GridArtifactType = "legendary" // Combinable artifact type. Combinable GridArtifactType = "combinable" // Result artifact type. Result GridArtifactType = "result" // Undiscovered status. Undiscovered GridStatus = "undiscovered" // Discovered status. Discovered GridStatus = "discovered" // Combined status. Combined GridStatus = "combined" // Donated status. Donated GridStatus = "donated" // Sold status. Sold GridStatus = "sold" )
View Source
const ( // ExplorationTime duration. ExplorationTime = 15 * time.Second )
Variables ¶
View Source
var ( // ErrNoRecord error. ErrNoRecord = errors.New("models: no matching record found") )
Functions ¶
This section is empty.
Types ¶
type Exploration ¶
type Exploration struct {
Grid string `json:"grid" redis:"grid"`
}
Exploration type.
type ExplorationRepository ¶
type ExplorationRepository interface { Create(*Exploration) error Find(*Grid) (*Exploration, error) }
ExplorationRepository type.
type Grid ¶
type Grid struct { Name string `json:"name" redis:"name"` Type GridType `json:"type" redis:"type"` Artifact string `json:"-" redis:"artifact"` ArtifactType GridArtifactType `json:"-" redis:"artifact_type"` Status GridStatus `json:"status" redis:"status"` }
Grid type.
type GridRepository ¶
type GridRepository interface { CreateOrUpdate(*Grid) error Find(string) (*Grid, error) Delete(string) error }
GridRepository type.
type Player ¶
type Player struct { Money int `json:"money" redis:"money"` BoatCount int `json:"boat_count" redis:"boat_count"` DiverCount int `json:"diver_count" redis:"diver_count"` SubmarineCount int `json:"submarine_count" redis:"submarine_count"` }
Player type.
type PlayerRepository ¶
type PlayerRepository interface { CreateOrUpdate(*Player) error Find() (*Player, error) Delete() error }
PlayerRepository type.
type RedisExplorationRepository ¶
RedisExplorationRepository type.
func (*RedisExplorationRepository) Create ¶
func (rer *RedisExplorationRepository) Create(exploration *Exploration) error
Create function.
func (*RedisExplorationRepository) Find ¶
func (rer *RedisExplorationRepository) Find(grid *Grid) (*Exploration, error)
Find function.
type RedisGridRepository ¶
RedisGridRepository type.
func (*RedisGridRepository) CreateOrUpdate ¶
func (rgr *RedisGridRepository) CreateOrUpdate(grid *Grid) error
CreateOrUpdate function.
func (*RedisGridRepository) Delete ¶
func (rgr *RedisGridRepository) Delete(name string) error
Delete function.
type RedisPlayerRepository ¶
RedisPlayerRepository type.
func (*RedisPlayerRepository) CreateOrUpdate ¶
func (rpr *RedisPlayerRepository) CreateOrUpdate(player *Player) error
CreateOrUpdate function.
func (*RedisPlayerRepository) Delete ¶
func (rpr *RedisPlayerRepository) Delete() error
Delete function.
func (*RedisPlayerRepository) Find ¶
func (rpr *RedisPlayerRepository) Find() (*Player, error)
Find function.
Click to show internal directories.
Click to hide internal directories.