Documentation ¶
Overview ¶
Package schema defines database and JSON schema as structs, as well as functions for creating and using these structs
Package schema defines database and JSON schema as structs, as well as functions for creating and using these structs ¶
Package schema defines database and JSON schema as structs, as well as functions for creating and using these structs ¶
Package schema defines database and JSON schema as structs, as well as functions for creating and using these structs ¶
Package schema defines database and JSON schema as structs, as well as functions for creating and using these structs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HarvestableResource ¶
Defines harvestable resource
type InventoryResource ¶
type InventoryResource struct { Resource LocationSymbol string `json:"location_symbol" binding:"required"` }
Defines inventory resource
type Locale ¶
type Locale struct { Thing ResourceNodes []ResourceNode `json:"resource_nodes" binding:"required"` Routes []Route `json:"routes" binding:"required"` }
Defines the characteristics of Locales (e.g. cities, forests, etc.)
type PublicUserInfo ¶
type PublicUserInfo struct { Username string `json:"username" binding:"required"` Tagline string `json:"tagline" binding:"required"` Coins uint64 `json:"coins" binding:"required"` UserSince int64 `json:"user-since" binding:"required"` }
Defines the public User info for the /users/{username} endpoint
type ResourceNode ¶
type ResourceNode struct { Resource MaxQuantity int `json:"max_quantity" binding:"required"` RenewalRate int `json:"renewal_rate" binding:"required"` HarvestTime int `json:"harvest_time" binding:"required"` DropTable []HarvestableResource `json:"drop_table" binding:"required"` }
Defines harvestable resource node
type Route ¶
type Route struct { Thing DangerLevel int `json:"danger_level" binding:"required"` TravelTime int `json:"travel_time" binding:"required"` }
Defines the characteristics of Routes between locales
type Thing ¶
type Thing struct { Name string `json:"name" binding:"required"` Symbol string `json:"symbol" binding:"required"` Description string `json:"description" binding:"required"` }
Defines a 'Thing' which has Name, Symbol, Description
type User ¶
type User struct { Token string `json:"token" binding:"required"` Username string `json:"username" binding:"required"` Tagline string `json:"tagline" binding:"required"` Coins uint64 `json:"coins" binding:"required"` UserSince int64 `json:"user-since" binding:"required"` }
Defines a user which has Name, Symbol, Description
func GetUserFromDB ¶
Get user from DB, bool is user found