gosteem

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

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

README

gosteem

Go SDK for Steem API.

GoDoc

You can use it to write clients in Go to communicate with steem nodes.

Compatibility

steemd 0.19.0

Usage

import "github.com/smallnest/gosteem"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Call(method string, params, result interface{}) error
}

type Error

type Error struct {
	Code    int64            `json:"code"`
	Message string           `json:"message"`
	Data    *json.RawMessage `json:"data"`
}

Error represents a JSON-RPC2 response error.

func (*Error) Error

func (e *Error) Error() string

func (Error) MarshalEasyJSON

func (v Error) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Error) MarshalJSON

func (v Error) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Error) UnmarshalEasyJSON

func (v *Error) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Error) UnmarshalJSON

func (v *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type HTTPClient

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

HTTPClient is the client to communicate with steemd via http.

func NewHTTPClient

func NewHTTPClient(nodeAddr string, timeout time.Duration) *HTTPClient

func (*HTTPClient) Call

func (c *HTTPClient) Call(method string, params, result interface{}) error

type Request

type Request struct {
	Version string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
	ID      uint64          `json:"id"`
}

Request represents a JSON-RPC request or notification. See http://www.jsonrpc.org/specification#request_object and http://www.jsonrpc.org/specification#notification.

func (Request) MarshalEasyJSON

func (v Request) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Request) MarshalJSON

func (v Request) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Request) UnmarshalEasyJSON

func (v *Request) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Request) UnmarshalJSON

func (v *Request) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Response

type Response struct {
	Version string          `json:"jsonrpc"`
	ID      uint64          `json:"id"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *Error          `json:"error,omitempty"`
}

func (Response) MarshalEasyJSON

func (v Response) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Response) MarshalJSON

func (v Response) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Response) UnmarshalEasyJSON

func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Response) UnmarshalJSON

func (v *Response) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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