fast_lem

package module
v0.0.0-...-e7c43d2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DetailsBucket = `DetailsByCusip`
	IsinBucket    = `CUSIPByISIN`
	SedolBucket   = `CUSIPBySEDOL`
)
View Source
const DescriptionDateFormat = `2006/01/02`
View Source
const FactSetDateFormat = `2006-01-02`

Variables

View Source
var (
	BadQuoteEscape  = []byte(`\"`)
	GoodQuoteEscape = []byte(`""`)
)
View Source
var (
	ERR_COUNT_TOO_LOW = errors.New("Provided count was less than actual number of records")
)

Functions

func NewDecoder

func NewDecoder() *encoding.Decoder

NewDecoder returns a decoder to handle character conversion and non-standard escaping of double quotation marks in CSV

func NewReader

func NewReader(source io.Reader) *csv.Reader

NewReader handles the transformations necessary to process a FactSet EDM data file with Go's csv library

Types

type Description

type Description struct {
	IssueType IssueType
	Coupon    float64
	Maturity  time.Time
	Ticker    string
}

ffjson: skip

func NewDescription

func NewDescription(code, ticker, coupon, maturity string) (d *Description, err error)

func (Description) MarshalJSON

func (d Description) MarshalJSON() ([]byte, error)

type Getter

type Getter interface {
	Get(keys ...string) ([]*Security, error)
}

Getter looks up details of Securities by ID

func NewGetter

func NewGetter(db *bolt.DB) Getter

type IssueType

type IssueType int
const (
	NA IssueType = iota
	AB
	AG
	AI
	BC
	BD
	CA
	CE
	CP
	DB
	DL
	DR
	EP
	EQ
	ET
	FM
	FU
	FX
	ID
	LN
	MB
	MT
	MU
	NT
	OE
	OP
	PF
	PQ
	PV
	SH
	UI
	UL
	US
	WT
)

func IssueTypeFromString

func IssueTypeFromString(code string) IssueType

func (IssueType) String

func (it IssueType) String() string

type QuoteEscaper

type QuoteEscaper struct {
	transform.NopResetter
}

QuoteEscaper implements transform.Transformer, replacing \" with "" This fixes non-standard escaping in some delimited text inputs

func (QuoteEscaper) Transform

func (q QuoteEscaper) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error)

Transform replaces the sequence `\"` with `""`

type Request

type Request struct {
	Keys []string
}

ffjson: noencoder

func (*Request) UnmarshalJSON

func (uj *Request) UnmarshalJSON(input []byte) error

func (*Request) UnmarshalJSONFFLexer

func (uj *Request) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Response

type Response struct {
	Results map[string]*Security
}

ffjson: nodecoder

func NewResponse

func NewResponse() *Response

func (*Response) MarshalJSON

func (mj *Response) MarshalJSON() ([]byte, error)

func (*Response) MarshalJSONBuf

func (mj *Response) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type Security

type Security struct {
	LegalEntityID string      `json:"LegalEntityId,omitempty"`
	CUSIP         string      `json:"Cusip,omitempty"`
	ISIN          string      `json:",omitempty"`
	SEDOL         string      `json:"Sedol,omitempty"`
	Ticker        string      `json:",omitempty"`
	Description   Description `json:",omitempty"`
}

ffjson: nodecoder

func New

func New(cusip, isin, sedol, ticker, entityID, issueTypeCode, coupon,
	maturity string) (s *Security)

func (*Security) MarshalJSON

func (mj *Security) MarshalJSON() ([]byte, error)

func (*Security) MarshalJSONBuf

func (mj *Security) MarshalJSONBuf(buf fflib.EncodingBuffer) error

type SecurityMaster

type SecurityMaster struct {
	Index      *mafsa.MinTree
	Securities []*Security
	ISINIndex  map[string]int
	SEDOLIndex map[string]int
}

func NewSecurityMaster

func NewSecurityMaster(securities chan *Security) (m *SecurityMaster, err error)

NewSecurityMaster returns an in-memory security master from a channel of securities which MUST be sorted in ascending order by CUSIP

func (*SecurityMaster) Get

func (m *SecurityMaster) Get(keys ...string) (response []*Security, err error)

Get "hydrates" security details from one or more identifiers

type Server

type Server struct {
	Getter
}

func (Server) QueryHandler

func (s Server) QueryHandler(w http.ResponseWriter, r *http.Request)

type Storage

type Storage interface {
	Getter
	Storer
}

Storage can store and retrieve Security details, and respond to queries via HTTP

func NewStorage

func NewStorage(db *bolt.DB) (Storage, error)

NewStorage returns a Security database ready to use

type Storer

type Storer interface {
	Store(chan *Security)
}

Storer persits Security details

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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