bitmarksdk

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: ISC Imports: 8 Imported by: 2

README

Bitmark SDK for Golang

The official Bitmark SDK for Golang

GoDoc GitHub issues GitHub forks Go Report Card Build Status

Setting Up

Prerequisites
  • Golang version 1.13+
Installing
Go Module

In go.mod file:

require (
	github.com/bitmark-inc/bitmark-sdk-go
)
Manually
go get github.com/bitmark-inc/bitmark-sdk-go

Documentation

Please refer to our SDK Document.

Sample code

This is a sample project. It shows how to use Bitmark SDK for Golang.

Opening Issues

If you encounter a bug with the Bitmark SDK for Golang we would like to hear from you. Search the existing issues and try to make sure your problem doesn’t exist yet before opening a new issue. It’s helpful if you could provide the version of the SDK, Golang and OS you’re using. Please include a stack trace and reproducible case if possible.

Documentation

Overview

SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc. Use of this source code is governed by an ISC license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	// Livenet - Defines the network type live
	Livenet = Network("livenet")
	// Testnet - Defines the network type test
	Testnet = Network("testnet")
)

Variables

This section is empty.

Functions

func Init

func Init(cfg *Config)

Init - SDK initialization

Types

type APIError

type APIError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Reason  string `json:"reason"`
}

APIError - struct that holds the API errors

func (*APIError) Error

func (ae *APIError) Error() string

type BackendImplementation

type BackendImplementation struct {
	HTTPClient        *http.Client
	URLAuthority      string
	APIToken          string
	MaxNetworkRetries int
}

BackendImplementation - structure used by the API client

func GetAPIClient

func GetAPIClient() *BackendImplementation

GetAPIClient - returns the API client

func (*BackendImplementation) Do

func (s *BackendImplementation) Do(req *http.Request, v interface{}) error

Do - sends an HTTP request

func (*BackendImplementation) NewRequest

func (s *BackendImplementation) NewRequest(method, path string, body io.Reader) (*http.Request, error)

NewRequest - returns a new Request given a method, URL and body

type Config

type Config struct {
	Network    Network
	HTTPClient *http.Client
	APIToken   string
}

Config - struct that initialize the API client connection

type Network

type Network string

Network - indicates which network to connect

func GetNetwork

func GetNetwork() Network

GetNetwork - returns the network used

Directories

Path Synopsis
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
bip39
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.
SPDX-License-Identifier: ISC Copyright (c) 2014-2020 Bitmark Inc.

Jump to

Keyboard shortcuts

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