alpaca

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

README

alpaca

Documentation

Index

Constants

View Source
const (
	Paper Environment = "paper"
	Live              = "live"

	Data    = "https://data.alpaca.markets/"
	Version = "v2"
)

Variables

View Source
var (
	// DefaultClient is a shared client using environment variables for authentication.
	DefaultClient = NewClient(&Credentials{
		KeyID:     os.Getenv("ALPACA_KEY_ID"),
		SecretKey: os.Getenv("ALPACA_SECRET_KEY"),
	})
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Environment Environment
	Credentials *Credentials
}

Client null

func NewClient

func NewClient(credentials *Credentials) *Client

NewClient null

func (*Client) Stream

func (c *Client) Stream(streams []string, handler func(StreamEvent)) error

Stream null

func (*Client) URL

func (c *Client) URL() string

URL null

type Credentials

type Credentials struct {
	KeyID     string
	SecretKey string
}

Credentials null

func NewCredentials

func NewCredentials(key, secret string) *Credentials

NewCredentials null

type Environment

type Environment string

Environment the Alpaca API environment.

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Error null

type StreamEvent

type StreamEvent struct {
	Stream string          `json:"stream"`
	Data   StreamEventData `json:"data"`
}

StreamEvent null

type StreamEventData

type StreamEventData map[string]interface{}

StreamEventData null

func (StreamEventData) ContainsKey

func (s StreamEventData) ContainsKey(key string) bool

ContainsKey null

func (StreamEventData) Float32

func (s StreamEventData) Float32(key string) float32

Float32 null

func (StreamEventData) Float64

func (s StreamEventData) Float64(key string) float64

Float64 null

func (StreamEventData) Int

func (s StreamEventData) Int(key string) int

Int null

func (StreamEventData) Int64

func (s StreamEventData) Int64(key string) int64

Int64 null

func (StreamEventData) Interface

func (s StreamEventData) Interface(key string) interface{}

Interface null

func (StreamEventData) String

func (s StreamEventData) String(key string) string

String null

Jump to

Keyboard shortcuts

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