Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountNotExists = errors.New("account doesnt exist") // for when trying to login or get account ErrAccountExists = errors.New("account already exists") // trying to register an already existing username/account ErrMissingCredentials = errors.New("neither username or password were provided") )
View Source
var (
ItemElectron = Item{0.01, 20, "electron", 0}
)
Functions ¶
Types ¶
type Account ¶
type Account struct { Username string `db:"username"` Node *Node // pointer since a person won't have a node immediately on register Op bool `db:"op"` }
A client's account
type AuthPayload ¶
For register and login methods
type ClientResponse ¶
type ClientResponse struct { SessionID string `json:"sessionID"` Method string `json:"method"` Data *interface{} `json:"data,omitempty"` }
Fields we should expect from the client
type Econetwork ¶
type Econetwork struct { Address string // contains filtered or unexported fields }
func New ¶
func New() (*Econetwork, error)
func (*Econetwork) Start ¶
func (e *Econetwork) Start()
func (*Econetwork) Stop ¶
func (e *Econetwork) Stop()
type EconodeInfoPayload ¶
type EconodeNewPayload ¶
type EconodeNewPayload struct {
Name string
}
type Node ¶
type Node struct { ID int Name string Balance int Owner int Members []int Inventory map[string]*Item Multi float64 }
Someone's econode The idea is that we can have other people growing a single node together
type ServerResponse ¶
type ServerResponse struct { Code string `json:"code"` Method string `json:"method"` Data *interface{} `json:"data,omitempty"` }
The server response struct What we should send, as defined by the procotol
type StatsPayload ¶
Click to show internal directories.
Click to hide internal directories.