netki

package module
v0.0.0-...-426acb5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2016 License: BSD-3-Clause Imports: 15 Imported by: 1

README

Go Netki Partner Client

This is an Go implementation of the Netki Partner API Client.

Importing

import github.com/netkicorp/go-partner-client

Documentation

Visit the docs on gopkgdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalletNameLookup

func WalletNameLookup(uri, currency string) (string, error)

WalletNameLookup resolves an address from a netki address and currency.

Types

type Domain

type Domain struct {
	DomainName        string
	Status            string
	DelegationStatus  bool
	DelegationMessage string
	WalletNameCount   int
	Namesevers        []string
	NextRollDate      time.Time
	PublicSigningKey  string
	DsRecords         []string
}

type EcdsaSig

type EcdsaSig struct {
	R, S *big.Int
}

type NetkiError

type NetkiError struct {
	ErrorString string
	Failures    []string
}

Define our Error Type

func (NetkiError) Error

func (e NetkiError) Error() string

type NetkiPartner

type NetkiPartner struct {
	Requester     NetkiRequest
	PartnerId     string
	ApiKey        string
	ApiUrl        string
	UserKey       *ecdsa.PrivateKey
	KeySigningKey *ecdsa.PublicKey
	KeySignature  []byte
}

func NewNetkiPartner

func NewNetkiPartner(partnerId string, apiKey string, apiUrl string) *NetkiPartner

Constructor / NetkiPartner Factory

func NewNetkiRemotePartner

func NewNetkiRemotePartner(apiUrl string, userKey *ecdsa.PrivateKey, keySigningKey *ecdsa.PublicKey, keySignature []byte) *NetkiPartner

func (NetkiPartner) CreateNewDomain

func (n NetkiPartner) CreateNewDomain(domainName string, partner Partner) (Domain, error)

Domain Handlers

func (NetkiPartner) CreateNewPartner

func (n NetkiPartner) CreateNewPartner(partnerName string) (Partner, error)

Define NetkiPartner methods

func (NetkiPartner) CreateNewWalletName

func (n NetkiPartner) CreateNewWalletName(domain Domain, name string, wallets []Wallet, externalId string) WalletName

func (NetkiPartner) DeleteDomain

func (n NetkiPartner) DeleteDomain(domain Domain) error

func (NetkiPartner) DeletePartner

func (n NetkiPartner) DeletePartner(partner Partner) error

func (NetkiPartner) GetDomainDnssec

func (n NetkiPartner) GetDomainDnssec(domain Domain) (returnDomain Domain, err error)

func (NetkiPartner) GetDomainStatus

func (n NetkiPartner) GetDomainStatus(domain Domain) (returnDomain Domain, err error)

func (NetkiPartner) GetDomains

func (n NetkiPartner) GetDomains() ([]Domain, error)

func (NetkiPartner) GetKeySigningKey

func (n NetkiPartner) GetKeySigningKey() string

func (NetkiPartner) GetPartners

func (n NetkiPartner) GetPartners() ([]Partner, error)

func (NetkiPartner) GetUserPublicKey

func (n NetkiPartner) GetUserPublicKey() string

Define NetkiPartner Utility methods

func (NetkiPartner) GetWalletNames

func (n NetkiPartner) GetWalletNames(domain Domain, externalId string) ([]WalletName, error)

func (NetkiPartner) SetKeySignature

func (n NetkiPartner) SetKeySignature(sig []byte)

func (NetkiPartner) SetKeySigningKey

func (n NetkiPartner) SetKeySigningKey(signingKey *ecdsa.PublicKey)

func (NetkiPartner) SetUserKey

func (n NetkiPartner) SetUserKey(userKey *ecdsa.PrivateKey)

type NetkiRequest

type NetkiRequest interface {
	ProcessRequest(partner *NetkiPartner, uri string, method string, bodyData string) (*simplejson.Json, error)
}

type NetkiRequester

type NetkiRequester struct {
	HTTPClient *http.Client
}

func (NetkiRequester) ProcessRequest

func (n NetkiRequester) ProcessRequest(partner *NetkiPartner, uri string, method string, bodyData string) (*simplejson.Json, error)

Generic Request Handling

func (NetkiRequester) SignRequest

func (n NetkiRequester) SignRequest(uri string, bodyData string, key *ecdsa.PrivateKey) (string, error)

Sign Request

type Partner

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

type Wallet

type Wallet struct {
	Currency, WalletAddress string
}

type WalletName

type WalletName struct {
	Id         string
	DomainName string
	Name       string
	Wallets    []Wallet
	ExternalId string
}

func (WalletName) Delete

func (w WalletName) Delete(partner *NetkiPartner) error

func (WalletName) GetAddress

func (w WalletName) GetAddress(currency string) string

Defined WalletName Methods

func (*WalletName) RemoveCurrency

func (w *WalletName) RemoveCurrency(currency string)

func (*WalletName) Save

func (w *WalletName) Save(partner *NetkiPartner) error

func (*WalletName) SetCurrencyAddress

func (w *WalletName) SetCurrencyAddress(currency string, address string)

func (WalletName) UsedCurrencies

func (w WalletName) UsedCurrencies() []string

Jump to

Keyboard shortcuts

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