Documentation ¶
Index ¶
- Constants
- type Error
- type HTTP
- func (t *HTTP) Request(resource string, params *requestparams.RequestParams, timeout time.Duration) ([]byte, *Error)
- func (t *HTTP) SetPollingResource(subscriptionId, resource string)
- func (t *HTTP) SetPollingToken(accessToken string)
- func (t *HTTP) Subscribe(resource string, params *requestparams.RequestParams) (subscription *Subscription, subscriptionId string, err *Error)
- func (t *HTTP) Unsubscribe(subscriptionId string)
- type Params
- type Subscription
- type Transporter
- type WS
- func (t *WS) AfterReconnection(callback func())
- func (t *WS) Request(resource string, params *requestparams.RequestParams, timeout time.Duration) ([]byte, *Error)
- func (t *WS) Resubscribe()
- func (t *WS) Subscribe(resource string, params *requestparams.RequestParams) (subscription *Subscription, subscriptionId string, err *Error)
- func (t *WS) TerminateRequests(err error)
- func (t *WS) Unsubscribe(subscriptionId string)
Constants ¶
View Source
const ( ConnClosedErr = "connection closed" InvalidResponseErr = "invalid response" InvalidRequestErr = "invalid request" TimeoutErr = "timeout" )
View Source
const (
DefaultTimeout = 5 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
func (*HTTP) Request ¶
func (t *HTTP) Request(resource string, params *requestparams.RequestParams, timeout time.Duration) ([]byte, *Error)
func (*HTTP) SetPollingResource ¶
func (*HTTP) SetPollingToken ¶
func (*HTTP) Subscribe ¶
func (t *HTTP) Subscribe(resource string, params *requestparams.RequestParams) (subscription *Subscription, subscriptionId string, err *Error)
func (*HTTP) Unsubscribe ¶
type Subscription ¶
type Subscription struct { DataChan chan []byte ErrChan chan error // contains filtered or unexported fields }
func (*Subscription) ContinuePolling ¶
func (s *Subscription) ContinuePolling()
type Transporter ¶
type Transporter interface { Request(resource string, params *requestparams.RequestParams, timeout time.Duration) (res []byte, err *Error) Subscribe(resource string, params *requestparams.RequestParams) (subscription *Subscription, subscriptionId string, err *Error) Unsubscribe(subscriptionId string) }
type WS ¶
type WS struct {
// contains filtered or unexported fields
}
func (*WS) AfterReconnection ¶
func (t *WS) AfterReconnection(callback func())
func (*WS) Request ¶
func (t *WS) Request(resource string, params *requestparams.RequestParams, timeout time.Duration) ([]byte, *Error)
func (*WS) Resubscribe ¶
func (t *WS) Resubscribe()
func (*WS) Subscribe ¶
func (t *WS) Subscribe(resource string, params *requestparams.RequestParams) (subscription *Subscription, subscriptionId string, err *Error)
func (*WS) TerminateRequests ¶
func (*WS) Unsubscribe ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.