server

package
v0.0.0-...-252c1c9 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadMinStrike    = Error{/* contains filtered or unexported fields */}
	ErrBadMaxStrike    = Error{/* contains filtered or unexported fields */}
	ErrNoStrikesFound  = Error{/* contains filtered or unexported fields */}
	ErrNoStrikeArgs    = Error{/* contains filtered or unexported fields */}
	ErrNoExpiryArgs    = Error{/* contains filtered or unexported fields */}
	ErrNoExpiriesFound = Error{/* contains filtered or unexported fields */}
)
View Source
var (
	ErrNotImplemented = Error{http.StatusNotImplemented, "Not implemented"}
)

Functions

func GetAccounts

func GetAccounts(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetHistoricalData

func GetHistoricalData(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetOptionsAttributes

func GetOptionsAttributes(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetOptionsQuote

func GetOptionsQuote(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetPositions

func GetPositions(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetQuote

func GetQuote(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func GetQuotes

func GetQuotes(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, _ map[string]string)

func GetTrades

func GetTrades(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func HealthHandler

func HealthHandler(logger log.Logger, engine *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

func Run

func Run(bind string, engine *brokers.EngineList)

Types

type ArrayOutputError

type ArrayOutputError struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}

func NewArrayOutputError

func NewArrayOutputError(err error) ArrayOutputError

type Error

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

func (Error) Code

func (e Error) Code() int

func (Error) Error

func (e Error) Error() string

type ErrorAndSymbol

type ErrorAndSymbol struct {
	ArrayOutputError
	Symbol string `json:"symbol"`
}

type Handler

type Handler func(logger log.Logger, engines *brokers.EngineList, w *ResponseWriter, r *http.Request, params map[string]string)

type HistoricalDataResponse

type HistoricalDataResponse struct {
	Symbol string         `json:"symbol"`
	Type   string         `json:"type"`
	Bars   []*types.Quote `json:"bars"`
}

type HttpError

type HttpError interface {
	Code() int
	Error() string
}

type MiddlewareFactory

type MiddlewareFactory func(handler Handler) httptreemux.HandlerFunc

type MiddlewareFunc

type MiddlewareFunc func(handler Handler) httptreemux.HandlerFunc

type QuoteAndSymbol

type QuoteAndSymbol struct {
	*types.Quote
	Symbol string `json:"symbol"`
}

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	WroteStatus bool
	StatusCode  int
	Error       error
}

ResponseWriter is a simple wrapper around the http package's interface of the same name that allows tracking of whether or not a status code was written.

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *ResponseWriter

func (*ResponseWriter) GetStatus

func (w *ResponseWriter) GetStatus() int

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(code int)

Jump to

Keyboard shortcuts

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