isulog

package
v0.0.0-...-38c4f6e Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagSignup     = "signup"
	TagSignin     = "signin"
	TagBuyOrder   = "buy.order"
	TagSellOrder  = "sell.order"
	TagBuyError   = "buy.error"
	TagBuyDelete  = "buy.delete"
	TagSellDelete = "sell.delete"
	TagTrade      = "trade"
	TagBuyTrade   = "buy.trade"
	TagSellTrade  = "sell.trade"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuyError

type BuyError struct {
	UserID int64  `json:"user_id"`
	Amount int64  `json:"amount"`
	Price  int64  `json:"price"`
	Error  string `json:"error"`
}

func (*BuyError) Validate

func (d *BuyError) Validate() error

type Isulog

type Isulog struct {
	// contains filtered or unexported fields
}

func NewIsulog

func NewIsulog(endpoint, appid string) (*Isulog, error)

func (*Isulog) AppID

func (b *Isulog) AppID() string

func (*Isulog) GetTradeLogs

func (b *Isulog) GetTradeLogs(tradeID int64) ([]*Log, error)

func (*Isulog) GetUserLogs

func (b *Isulog) GetUserLogs(userID int64) ([]*Log, error)

func (*Isulog) Initialize

func (b *Isulog) Initialize() error

type Log

type Log struct {
	Tag        string          `json:"tag"`
	Time       time.Time       `json:"time"`
	Data       json.RawMessage `json:"data"`
	Signup     *Signup         `json:"-"`
	Signin     *Signin         `json:"-"`
	BuyOrder   *Order          `json:"-"`
	SellOrder  *Order          `json:"-"`
	BuyError   *BuyError       `json:"-"`
	BuyDelete  *OrderDelete    `json:"-"`
	SellDelete *OrderDelete    `json:"-"`
	Trade      *Trade          `json:"-"`
	BuyTrade   *OrderTrade     `json:"-"`
	SellTrade  *OrderTrade     `json:"-"`
}

type Order

type Order struct {
	UserID  int64 `json:"user_id"`
	OrderID int64 `json:"order_id"`
	Amount  int64 `json:"amount"`
	Price   int64 `json:"price"`
}

func (*Order) Validate

func (d *Order) Validate() error

type OrderDelete

type OrderDelete struct {
	OrderID int64  `json:"order_id"`
	UserID  int64  `json:"user_id"`
	Reason  string `json:"reason"`
}

func (*OrderDelete) Validate

func (d *OrderDelete) Validate() error

type OrderTrade

type OrderTrade struct {
	TradeID int64 `json:"trade_id"`
	UserID  int64 `json:"user_id"`
	OrderID int64 `json:"order_id"`
	Amount  int64 `json:"amount"`
	Price   int64 `json:"price"`
}

func (*OrderTrade) Validate

func (d *OrderTrade) Validate() error

type Signin

type Signin struct {
	UserID int64 `json:"user_id"`
}

func (*Signin) Validate

func (d *Signin) Validate() error

type Signup

type Signup struct {
	Name   string `json:"name"`
	BankID string `json:"bank_id"`
	UserID int64  `json:"user_id"`
}

func (*Signup) Validate

func (d *Signup) Validate() error

type Trade

type Trade struct {
	TradeID int64 `json:"trade_id"`
	Amount  int64 `json:"amount"`
	Price   int64 `json:"price"`
}

func (*Trade) Validate

func (d *Trade) Validate() error

Jump to

Keyboard shortcuts

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