data_stream

package
v0.0.0-...-eb01247 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init provides setup for interacting with Reuters/Refinitiv DATA_STREAM_USERNAME and DATA_STREAM_PASSWORD credentials must be provided in ENV Saves access token for future requests.

TODO: Handle Token expiration

Types

type IdentifierType

type IdentifierType int
const (
	RIC IdentifierType = iota
	ISIN
)

type LoginResponse

type LoginResponse struct {
	TokenValue  string `json:"TokenValue"`
	TokenExpiry string `json:"TokenExpiry"`
}

type RefinitivDate

type RefinitivDate struct {
	time.Time
}

This is a special type to parse Refinitiv date formats eg. Date(1514764800000+0000) (should be 2018-01-01)

func (*RefinitivDate) UnmarshalJSON

func (sd *RefinitivDate) UnmarshalJSON(input []byte) error

type StreamRequest

type StreamRequest struct {
	StartDate  string
	EndDate    string
	Type       IdentifierType
	Identifier string
}

type StreamResponse

type StreamResponse struct {
	DataResponse struct {
		AdditionalResponses []struct {
			Key   string
			Value string
		}
		DataTypeNames  string
		DataTypeValues []struct {
			DataType     string
			SymbolValues []struct {
				Currency string
				Symbol   string
				Type     int
				Value    []decimal.Decimal
			}
		}
		Dates       []RefinitivDate
		SymbolNames string
		Tag         string
	}
	Properties string
}

func Stream

func Stream(sr StreamRequest) StreamResponse

Stream fetches the data from refinitiv. Result is saved in the Stream Request

TODO: save the result in the original Request instead of creating a new one

Jump to

Keyboard shortcuts

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