websocket

package
v0.0.0-...-a8d0dae Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DexSpotAccount     = "dex_spot/account"
	DexSpotOrder       = "dex_spot/order"
	DexSpotMatch       = "dex_spot/matches"
	DexSpotAllTicker3s = "dex_spot/all_ticker_3s"
	DexSpotTicker      = "dex_spot/ticker"
	DexSpotDepthBook   = "dex_spot/optimized_depth"
)

Variables

This section is empty.

Functions

func GetDepthBookFromCache

func GetDepthBookFromCache(product string) (depthBook pushservice.BookRes, ok bool)

func InitialCache

func InitialCache(ctx sdk.Context, orderKeeper types.OrderKeeper, dexKeeper types.DexKeeper, logger log.Logger)

func NewEngine

func NewEngine(url string, logger log.Logger, cfg *appCfg.StreamConfig) (types.IStreamEngine, error)

func StartWSServer

func StartWSServer(logger log.Logger, endpoint string)

func UpdateDepthBookCache

func UpdateDepthBookCache(product string, bookRes pushservice.BookRes)

Types

type BaseOp

type BaseOp struct {
	Op   string   `json:"op"`
	Args []string `json:"args"`
}

type Conn

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

type Context

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

type Engine

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

Engine

func (*Engine) NewEvent

func (engine *Engine) NewEvent(channel string, data interface{}) (sdk.Event, error)

func (*Engine) URL

func (engine *Engine) URL() string

func (*Engine) Write

func (engine *Engine) Write(data types.IStreamData, success *bool)

type ErrorResponse

type ErrorResponse struct {
	Event     string `json:"event"`
	Message   string `json:"message"`
	ErrorCode int    `json:"errorCode"`
}

func (*ErrorResponse) Valid

func (r *ErrorResponse) Valid() bool

type EventResponse

type EventResponse struct {
	Event   string `json:"event"`
	Success string `json:"success"`
	Channel string `json:"Channel"`
}

func (*EventResponse) Valid

func (r *EventResponse) Valid() bool

type PushData

type PushData struct {
	*pushservice.RedisBlock
	// contains filtered or unexported fields
}

func NewPushData

func NewPushData() *PushData

func (PushData) DataType

func (data PushData) DataType() types.StreamDataKind

func (*PushData) SetData

func (data *PushData) SetData(ctx sdk.Context, orderKeeper types.OrderKeeper, tokenKeeper types.TokenKeeper,
	dexKeeper types.DexKeeper, swapKeeper types.SwapKeeper, cache *common.Cache)

type SubscriptionTopic

type SubscriptionTopic struct {
	Channel string
	Filter  string `default:""`
}

func FormSubscriptionTopic

func FormSubscriptionTopic(str string) *SubscriptionTopic

func (*SubscriptionTopic) NeedLogin

func (st *SubscriptionTopic) NeedLogin() bool

func (*SubscriptionTopic) ToString

func (st *SubscriptionTopic) ToString() (topic string, err error)

type TableResponse

type TableResponse struct {
	Table  string        `json:"table"`
	Action string        `json:"action"`
	Data   []interface{} `json:"data"`
}

func (*TableResponse) Valid

func (r *TableResponse) Valid() bool

Jump to

Keyboard shortcuts

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