nordnet

package module
v0.0.0-...-7f18eca Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MIT Imports: 3 Imported by: 0

README

Nordnet

Build Status GoDoc Go Report Card

Go implementation of the Nordnet External API.

https://api.test.nordnet.se/api-docs/index.html

Installation

go get github.com/denro/nordnet

Usage

REST API Client
package main

import (
	"fmt"
	"github.com/denro/nordnet/api"
	"github.com/denro/nordnet/util"
)

var (
	pemData = []byte(`-----BEGIN PUBLIC KEY-----`)
	user    = []byte(`...`)
	pass    = []byte(`...`)
)

func main() {
	cred, _ := util.GenerateCredentials(user, pass, pemData)
	client := api.NewAPIClient(cred)
	client.Login()

	fmt.Println(client.Accounts())
}

To use Nordnet test credentials, try client := api.NewAPITestClient(cred).

Feed Client
package main

import (
	"fmt"
	"github.com/denro/nordnet/feed"
)

var (
	sessionKey = "..."
	address    = "..."
)

func main() {
	feed, _ := feed.NewPrivateFeed(address)
	feed.Login(sessionKey, nil)

	msgChan := make(chan *PrivateMsg)
	errChan := make(chan error)
	feed.Dispatch(msgChan, errChan)

	for _, msg := range msgChan {
		fmt.Println(msg)
	}
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package api includes the HTTP client used to access the REST JSON API.
Package api includes the HTTP client used to access the REST JSON API.
Contains everything related to the public and private feeds More information available on https://api.test.nordnet.se/next/2/api-docs/docs/feeds
Contains everything related to the public and private feeds More information available on https://api.test.nordnet.se/next/2/api-docs/docs/feeds
Package util contains utility functions
Package util contains utility functions
models
Package models represents data returned by the API and in the private feed
Package models represents data returned by the API and in the private feed

Jump to

Keyboard shortcuts

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