Add confirmation struct

This commit is contained in:
Kevin Cotugno 2017-09-22 07:24:42 -07:00
parent 163e3244f9
commit d3c17fe482
2 changed files with 18 additions and 0 deletions

View File

@ -13,3 +13,8 @@ CREATE UNIQUE INDEX product_trade_id_index ON trades (
trade_id);
CREATE INDEX timestamp_index ON trades (timestamp);
CREATE TABLE confirmations (
id SERIAL PRIMARY KEY,
product CHAR(7) NOT NULL,
last_trade_id INTEGER NOT NULL DEFAULT 0);

13
confirmation.go Normal file
View File

@ -0,0 +1,13 @@
package tacitus
type Confirmation struct {
Id int `json:"id"`
Product string `json:"product"`
LastTradeId int `json:"last_trade_id"`
}
type ConfirmationService interface {
Confirmation(product string) (*Confirmation, error)
CreateConfirmation(c *Confirmation) error
UpdateConfirmation(c *Confirmation) error
}