server

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: BSD-2-Clause Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Subscribe   = "subscribe"
	Unsubscribe = "unsubscribe"
	Ping        = "ping"
)
View Source
const (
	ReadTimeout  = 10
	WriteTimeout = 10
	WaitTimeout  = 10

	DexTopic = "coinex-dex"
	DbName   = "dex-trade"
)
View Source
const FilePrefix = "backup-"
View Source
const (
	SwaggerPath = "/swagger/swagger.yaml"
)

Variables

This section is empty.

Functions

func ErrInvalidParams

func ErrInvalidParams(params string) error

func ErrInvalidTag

func ErrInvalidTag() error

func ErrInvalidTimespan

func ErrInvalidTimespan() error

func ErrNegativeParams

func ErrNegativeParams(params string) error

func ErrNilParams

func ErrNilParams(params string) error

func QueryBancorDealsRequestHandlerFn added in v0.0.19

func QueryBancorDealsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryBancorInfosRequestHandlerFn

func QueryBancorInfosRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryBancorTradesRequestHandlerFn

func QueryBancorTradesRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryBlockTimesRequestHandlerFn

func QueryBlockTimesRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryCandleSticksRequestHandlerFn

func QueryCandleSticksRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryCommentsRequestHandlerFn

func QueryCommentsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryDealsRequestHandlerFn

func QueryDealsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryDelistRequestHandlerFn added in v0.0.20

func QueryDelistRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryDelistsRequestHandlerFn added in v0.0.20

func QueryDelistsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryDepthsRequestHandlerFn

func QueryDepthsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryDonationsRequestHandlerFn

func QueryDonationsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryIncomesRequestHandlerFn

func QueryIncomesRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryLatestHeight added in v0.2.6

func QueryLatestHeight(hub *core.Hub) http.HandlerFunc

func QueryLockedRequestHandlerFn

func QueryLockedRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryOrdersRequestHandlerFn

func QueryOrdersRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryRedelegationsRequestHandlerFn

func QueryRedelegationsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QuerySlashingsRequestHandlerFn

func QuerySlashingsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryTickersRequestHandlerFn

func QueryTickersRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryTxsByHashRequestHandlerFn

func QueryTxsByHashRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryTxsRequestHandlerFn

func QueryTxsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryUnbondingsRequestHandlerFn

func QueryUnbondingsRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func QueryUnlocksRequestHandlerFn

func QueryUnlocksRequestHandlerFn(hub *core.Hub) http.HandlerFunc

func ServeWsHandleFn

func ServeWsHandleFn(wsManager *core.WebsocketManager, hub *core.Hub) http.HandlerFunc

Types

type Consumer added in v0.0.19

type Consumer interface {
	Consume()
	Close()
	String() string
}

func NewConsumer

func NewConsumer(svrConfig *toml.Tree, hub *core.Hub) (Consumer, error)

func NewConsumerWithDirTail added in v0.0.19

func NewConsumerWithDirTail(svrConfig *toml.Tree, hub *core.Hub) (Consumer, error)

type DataWrapped

type DataWrapped struct {
	Data    interface{} `json:"data"`
	TimeSid []int64     `json:"timesid"`
}

func NewDataWrapped

func NewDataWrapped(data interface{}, timesid []int64) DataWrapped

type DepthResponse

type DepthResponse struct {
	Sell []*core.PricePoint `json:"sell"`
	Buy  []*core.PricePoint `json:"buy"`
}

func NewDepthResponse

func NewDepthResponse(sell []*core.PricePoint, buy []*core.PricePoint) DepthResponse

type MsgWriter

type MsgWriter interface {
	WriteKV(k, v []byte) error
	Close() error
	String() string
}

func NewFileMsgWriter

func NewFileMsgWriter(filePath string) (MsgWriter, error)

type OpCommand

type OpCommand struct {
	Op    string   `json:"op"`
	Args  []string `json:"args"`
	Depth int      `json:"depth"`
}

func NewCommand added in v0.2.0

func NewCommand(msg []byte) *OpCommand

func (*OpCommand) HandleCommand added in v0.2.0

func (op *OpCommand) HandleCommand(hub *core.Hub, wsManager *core.WebsocketManager, wsConn *core.Conn) bool

type RestSwagger

type RestSwagger struct {
	Paths map[string]interface{} `yaml:"paths"`
}

type TradeConsumer

type TradeConsumer struct {
	sarama.Consumer
	// contains filtered or unexported fields
}

func NewKafkaConsumer added in v0.0.19

func NewKafkaConsumer(svrConfig *toml.Tree, topic string, hub *core.Hub) (*TradeConsumer, error)

func (*TradeConsumer) Close

func (tc *TradeConsumer) Close()

func (*TradeConsumer) Consume

func (tc *TradeConsumer) Consume()

func (*TradeConsumer) String added in v0.0.19

func (tc *TradeConsumer) String() string

type TradeConsumerWithDirTail added in v0.0.19

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

func (*TradeConsumerWithDirTail) Close added in v0.0.19

func (tc *TradeConsumerWithDirTail) Close()

func (*TradeConsumerWithDirTail) Consume added in v0.0.19

func (tc *TradeConsumerWithDirTail) Consume()

func (*TradeConsumerWithDirTail) String added in v0.0.19

func (tc *TradeConsumerWithDirTail) String() string

type TradeConsumerWithMemBuf added in v0.2.7

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

func NewConsumerWithMemBuf added in v0.2.7

func NewConsumerWithMemBuf(svrConfig *toml.Tree, hub *core.Hub) (*TradeConsumerWithMemBuf, error)

func (*TradeConsumerWithMemBuf) Consumer added in v0.2.7

func (tc *TradeConsumerWithMemBuf) Consumer()

func (*TradeConsumerWithMemBuf) PutMsg added in v0.2.7

func (tc *TradeConsumerWithMemBuf) PutMsg(k, v []byte)

func (*TradeConsumerWithMemBuf) String added in v0.2.7

func (tc *TradeConsumerWithMemBuf) String() string

type TradeServer added in v0.1.1

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

func NewServer

func NewServer(svrConfig *toml.Tree) *TradeServer

func (*TradeServer) Start added in v0.1.1

func (ts *TradeServer) Start(svrConfig *toml.Tree)

func (*TradeServer) Stop added in v0.1.1

func (ts *TradeServer) Stop()

Jump to

Keyboard shortcuts

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