transportadapter

package
v0.0.0-...-afe3fbd Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenExpiredErr = "401 token expired"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPAdapter

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

func (*HTTPAdapter) Authenticate

func (a *HTTPAdapter) Authenticate(token string, timeout time.Duration) (bool, error)

func (*HTTPAdapter) RefreshToken

func (a *HTTPAdapter) RefreshToken() (accessToken string, err error)

func (*HTTPAdapter) Request

func (a *HTTPAdapter) Request(resourceName string, data map[string]interface{}, timeout time.Duration) ([]byte, error)

func (*HTTPAdapter) SetCreds

func (a *HTTPAdapter) SetCreds(login, password string)

func (*HTTPAdapter) SetRefreshToken

func (a *HTTPAdapter) SetRefreshToken(refTok string)

func (*HTTPAdapter) Subscribe

func (a *HTTPAdapter) Subscribe(resourceName string, pollingWaitTimeoutSeconds int, params map[string]interface{}) (subscription *transport.Subscription, subscriptionId string, err *transport.Error)

func (*HTTPAdapter) Unsubscribe

func (a *HTTPAdapter) Unsubscribe(resourceName, subscriptionId string, timeout time.Duration) error

type Timestamp

type Timestamp struct {
	Value string `json:"timestamp"`
}

type TransportAdapter

type TransportAdapter interface {
	Request(resourceName string, data map[string]interface{}, timeout time.Duration) (res []byte, err error)
	Subscribe(resourceName string, pollingWaitTimeoutSeconds int, params map[string]interface{}) (subscription *transport.Subscription, subscriptionId string, err *transport.Error)
	Unsubscribe(resourceName, subscriptionId string, timeout time.Duration) error
	Authenticate(token string, timeout time.Duration) (result bool, err error)
	SetCreds(login, password string)
	SetRefreshToken(refTok string)
	RefreshToken() (accessToken string, err error)
}

type WSAdapter

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

func (*WSAdapter) Authenticate

func (a *WSAdapter) Authenticate(token string, timeout time.Duration) (bool, error)

func (*WSAdapter) RefreshToken

func (a *WSAdapter) RefreshToken() (accessToken string, err error)

func (*WSAdapter) Request

func (a *WSAdapter) Request(resourceName string, data map[string]interface{}, timeout time.Duration) ([]byte, error)

func (*WSAdapter) SetCreds

func (a *WSAdapter) SetCreds(login, password string)

func (*WSAdapter) SetRefreshToken

func (a *WSAdapter) SetRefreshToken(refTok string)

func (*WSAdapter) Subscribe

func (a *WSAdapter) Subscribe(resourceName string, pollingWaitTimeoutSeconds int, params map[string]interface{}) (subscription *transport.Subscription, subscriptionId string, err *transport.Error)

func (*WSAdapter) Unsubscribe

func (a *WSAdapter) Unsubscribe(resourceName, subscriptionId string, timeout time.Duration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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