service

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

README

Error Codes for services

InvalidParams         = 1001
IOError               = 1002
ParseError            = 1003
ConfigurationError    = 1004
ResourceNotFoundError = 1005
InternalError         = 1006

WalletError   = 2006
AccountsError = 2007

Documentation

Overview

Package service provides bindings for collecting services into a map and registering the min one go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	//stores
	Accounts     accounts.Wallet
	Balances     *balance.Store
	Domains      *ons.DomainStore
	FeePool      *fees.Store
	ValidatorSet *identity.ValidatorStore
	Trackers     *bitcoin.TrackerStore
	EthTrackers  *ethTracker.TrackerStore
	// configurations
	Cfg        config.Server
	Currencies *balance.CurrencySet

	NodeContext node.Context

	Router   action.Router
	Services client.ExtServiceContext
	Logger   *log.Logger

	TxTypes *[]action.TxTypeDescribe
}

Context is the master context for creating new contexts

type Map

type Map map[string]interface{}

Map of services, keyed by the name/prefix of the service

func NewMap

func NewMap(ctx *Context) (Map, error)

type RestfulRouter added in v0.12.0

type RestfulRouter map[string]http.HandlerFunc

type RestfulService added in v0.12.0

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

basic RestfulService entry point

func NewRestfulService added in v0.12.0

func NewRestfulService(ctx *Context) RestfulService

func (RestfulService) GetToken added in v0.13.0

func (rs RestfulService) GetToken() http.HandlerFunc

func (RestfulService) Router added in v0.12.0

func (rs RestfulService) Router() RestfulRouter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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