handlers

package
v0.0.0-...-46f0560 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBotHandler

func NewBotHandler(url, token string) *botHandler

Types

type Account

type Account struct {
	Id     int    `json:"id"`
	Login  string `json:"login"`
	Wealth int    `json:"wealth"`
}

type Asset

type Asset struct {
	Id       int64 `json:"company_id"`
	Quantity int64 `json:"count"`
}

type Bids

type Bids struct {
	Price    int64 `json:"Price"`
	Quantity int64 `json:"Quantity"`
}

type BotHandler

type BotHandler interface {
	LimitPriceSell(symbolId int64, price int64) (int, io.ReadCloser, error)
	LimitPriceBuy(symbolId int64, price int64) (int, io.ReadCloser, error)
	BestPriceSell(symbolId int64) (int, error)
	BestPriceBuy(symbolId int64) (int, error)
	GetCompanies() ([]Symbol, error)
	GetInfo() (Info, error)
}

type Info

type Info struct {
	Account Account `json:"account"`
	Assets  []Asset `json:"assets"`
}

type LimitPriceBid

type LimitPriceBid struct {
	Id         int64   `json:"id"`
	Account    Account `json:"account"`
	SymbolId   int64   `json:"SymbolId"`
	Price      int64   `json:"Price"`
	Type       string  `json:"type"`
	CreateDate string  `json:"createDate"`
}

type Stock

type Stock struct {
	Id     int64  `json:"id"`
	Ticker string `json:"ticker"`
	Bids   []Bids `json:"bids"`
}

func GetBuyStock

func GetBuyStock() ([]Stock, error)

func GetSellStock

func GetSellStock() ([]Stock, error)

type Symbol

type Symbol struct {
	Id     int64  `json:"id"`
	Ticker string `json:"name"`
}

Jump to

Keyboard shortcuts

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