cache

package
v0.0.0-...-487cae6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeOrderOpen   = "ORDER-OPEN"
	EventTypeOrderMatch  = "ORDER-MATCH"
	EventTypeOrderCancel = "ORDER-CANCEL"
)

Variables

This section is empty.

Functions

func Redis

func Redis(ctx context.Context) *redis.Client

func SetupRedis

func SetupRedis(ctx context.Context, client *redis.Client) context.Context

Types

type BlazeMessage

type BlazeMessage struct {
	Id     string                 `json:"id"`
	Action string                 `json:"action"`
	Params map[string]interface{} `json:"params,omitempty"`
	Data   interface{}            `json:"data,omitempty"`
	Error  string                 `json:"error,omitempty"`
}

type Client

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

func NewClient

func NewClient(ctx context.Context, hub *Hub, conn *websocket.Conn, id string, cancel context.CancelFunc) (*Client, error)

func (*Client) ReadPump

func (client *Client) ReadPump(ctx context.Context) error

func (*Client) WritePump

func (client *Client) WritePump(ctx context.Context) error

type Event

type Event struct {
	Market    string                 `json:"market"`
	Type      string                 `json:"event"`
	Sequence  string                 `json:"sequence"`
	Data      map[string]interface{} `json:"data,omitempty"`
	Timestamp time.Time              `json:"timestamp"`
}

func Book

func Book(ctx context.Context, market string, limit int) (*Event, error)

func ListPendingEvents

func ListPendingEvents(ctx context.Context, key string) ([]*Event, error)

type EventResponse

type EventResponse struct {
	Channel string
	Source  string
	Event   *Event
}

type Hub

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

func NewHub

func NewHub() *Hub

func (*Hub) Register

func (hub *Hub) Register(ctx context.Context, client *Client) error

func (*Hub) Run

func (hub *Hub) Run(ctx context.Context) error

func (*Hub) SubscribePendingEvents

func (hub *Hub) SubscribePendingEvents(ctx context.Context, market, cid string) error

func (*Hub) Unregister

func (hub *Hub) Unregister(client *Client) error

func (*Hub) UnsubscribePendingEvents

func (hub *Hub) UnsubscribePendingEvents(ctx context.Context, market, cid string) error

type Member

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

type Queue

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

func NewQueue

func NewQueue(ctx context.Context, market string) *Queue

func (*Queue) AttachEvent

func (queue *Queue) AttachEvent(ctx context.Context, typ string, data map[string]interface{})

func (*Queue) Loop

func (queue *Queue) Loop(ctx context.Context)

type Subscription

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

Jump to

Keyboard shortcuts

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