service

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 38 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
	Delegators      *delegation.DelegationStore
	NetwkDelegators *netwkDeleg.MasterStore
	EvidenceStore   *evidence.EvidenceStore
	FeePool         *fees.Store
	ValidatorSet    *identity.ValidatorStore
	WitnessSet      *identity.WitnessStore
	Trackers        *bitcoin.TrackerStore
	EthTrackers     *ethTracker.TrackerStore
	// configurations
	Cfg                   config.Server
	Currencies            *balance.CurrencySet
	ProposalMaster        *governance.ProposalMasterStore
	RewardMaster          *rewards.RewardMasterStore
	Govern                *governance.Store
	ExtStores             data.Router
	ExtServiceMap         common.ExtServiceMap
	GovUpdate             *action.GovernaceUpdateAndValidate
	NetwkDelegatorsMaster *network_delegation.MasterStore
	NodeContext           node.Context

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

	TxTypes *[]action.TxTypeDescribe

	// evm
	Contracts     *evm.ContractStore
	AccountKeeper balance.AccountKeeper
	StateDB       *vm.CommitStateDB
}

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