model

package
v0.3.6-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountStateSubscription ...
	AccountStateSubscription   = "account"
	PositionsStateSubscription = "position"
	OrdersStateSubscription    = "order"
	HeartbeatSubscription      = "account"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	XMLName xml.Name `xml:"body"`

	Username                string `xml:"username"`
	Currency                string `xml:"currency"`
	AccountID               int64  `xml:"accountId"`
	RegistrationLegalEntity string `xml:"registrationLegalEntity"`
	DisplayLocale           string `xml:"displayLocale"`
	FundingDisallowed       bool   `xml:"fundingDisallowed"`
}

Account ...

type EventsManager

type EventsManager interface {
	AddEventListener(t events.Type, o events.Observer)
	RemoveEventListener(t events.Type, o events.Observer)
}

EventsManager ...

type Header interface {
	Get(key string) string
}

Header ...

type Request

type Request interface {
	Header() map[string]string

	RequestURI() string
	Write(w io.Writer) error

	AddParam(key, value string)
}

Request ...

type RequestWrapper

type RequestWrapper struct {
	XMLName xml.Name `xml:"req"`

	Body interface{} `xml:"body"`
}

RequestWrapper ...

func NewRequestWrapper

func NewRequestWrapper(r interface{}) *RequestWrapper

NewRequestWrapper ...

func NewSubscriptionWrapper

func NewSubscriptionWrapper(s interface{}) *RequestWrapper

NewSubscriptionWrapper ...

type RestAPI

type RestAPI interface {
	Post(request Request, success func(r io.Reader), failure func(code int, r io.Reader)) error
	Get(request Request, success func(r io.Reader), failure func(code int, r io.Reader)) error
}

RestAPI ...

type Server

type Server interface {
	Serve() error
	Stop() error
	Wait()
}

Server ...

type Session

type Session interface {
	Server
	RestAPI
	SessionCredentials
	EventsManager

	Logout(request Request, success func(r io.Reader), failure func(code int, r io.Reader)) error
	HeartbeatRequest(request Request, success func(), failure func(code int, r io.Reader), disconnected func()) error
}

Session ...

type SessionCredentials

type SessionCredentials interface {
	ID() string
	UserAgent() string
}

SessionCredentials ...

type Stream

type Stream interface {
	Serve() error
	Stop()
}

Stream ...

type StreamHandler

type StreamHandler interface {
	Handle(data []byte)
}

StreamHandler ...

type Subscription

type Subscription struct {
	XMLName xml.Name `xml:"body"`

	Body struct {
		XMLName xml.Name `xml:"subscription"`

		Type string `xml:"type"`
	}
	// contains filtered or unexported fields
}

Subscription ...

func NewSubscription

func NewSubscription() *Subscription

NewStateRequest ...

func (*Subscription) AddParam

func (s *Subscription) AddParam(key, value string)

Header ...

func (*Subscription) Header

func (s *Subscription) Header() map[string]string

Header ...

func (*Subscription) RequestURI

func (s *Subscription) RequestURI() string

RequestURI ...

func (*Subscription) SetType

func (s *Subscription) SetType(t string)

SetType ...

func (*Subscription) Write

func (s *Subscription) Write(w io.Writer) error

PositionsSubscriptionRequest ...

Jump to

Keyboard shortcuts

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