Documentation
¶
Index ¶
- Constants
- func GetSpecMethods(specName string) map[string]map[string]*Method
- func GetUnsubscribeMethod(specName, methodName string) (string, bool)
- func IsBlockTagNumber(num rpc.BlockNumber) bool
- func IsLocalMethod(specName, methodName string) bool
- func IsStickyCreateMethod(specMethod *Method) bool
- func IsStickySendMethod(specMethod *Method) bool
- func IsSubscribeMethod(specName, methodName string) bool
- type BlockNumberParam
- type BlockRangeParam
- type HashTagParam
- type Method
- type MethodData
- type MethodParam
- type MethodSettings
- type MethodSpec
- type MethodSpecLoader
- type ParserReturnType
- type SpecData
- type Sticky
- type StringParam
- type Subscription
- type TagParser
Constants ¶
View Source
const ( EthBlockNumber = "eth_blockNumber" EthGetBlockByNumber = "eth_getBlockByNumber" EthChainId = "eth_chainId" NetVersion = "net_version" )
View Source
const ( DefaultMethodGroup = "default" SpecPathVar = "NODECORE_SPECS_PATH" )
Variables ¶
This section is empty.
Functions ¶
func GetUnsubscribeMethod ¶
func IsBlockTagNumber ¶
func IsBlockTagNumber(num rpc.BlockNumber) bool
func IsLocalMethod ¶
func IsStickyCreateMethod ¶
func IsStickySendMethod ¶
func IsSubscribeMethod ¶
Types ¶
type BlockNumberParam ¶
type BlockNumberParam struct {
BlockNumber rpc.BlockNumber
}
type BlockRangeParam ¶
type BlockRangeParam struct {
From *rpc.BlockNumber
To *rpc.BlockNumber
}
type HashTagParam ¶
type HashTagParam struct {
Hash string
}
type Method ¶
type Method struct {
Subscription *Subscription
Sticky *Sticky
Name string
// contains filtered or unexported fields
}
func DefaultMethod ¶
func GetSpecMethod ¶
func MethodWithSettings ¶
func MethodWithSettings(name string, settings *MethodSettings, tagParser *TagParser) *Method
func (*Method) IsCacheable ¶
func (*Method) ShouldEnforceIntegrity ¶
type MethodData ¶
type MethodData struct {
Name string `json:"name"`
Group string `json:"group"`
Settings *MethodSettings `json:"settings"`
TagParser *TagParser `json:"tag-parser"`
Enabled *bool `json:"enabled"`
}
type MethodParam ¶
type MethodParam interface {
// contains filtered or unexported methods
}
type MethodSettings ¶
type MethodSettings struct {
Cacheable *bool `json:"cacheable"`
EnforceIntegrity bool `json:"enforce-integrity"`
Sticky *Sticky `json:"sticky"`
Subscription *Subscription `json:"subscription"`
Local bool `json:"local"`
}
type MethodSpec ¶
type MethodSpec struct {
SpecData *SpecData `json:"spec"`
SpecImports []string `json:"spec-imports"`
Methods []*MethodData `json:"methods"`
}
type MethodSpecLoader ¶
type MethodSpecLoader struct {
// contains filtered or unexported fields
}
func NewMethodSpecLoader ¶
func NewMethodSpecLoader() MethodSpecLoader
func NewMethodSpecLoaderWithFs ¶
func NewMethodSpecLoaderWithFs(specsFS fs.FS) MethodSpecLoader
func (MethodSpecLoader) Load ¶
func (m MethodSpecLoader) Load() error
type ParserReturnType ¶
type ParserReturnType string
const ( BlockNumberType ParserReturnType = "blockNumber" // hex number or tag (latest, earliest, etc) BlockRefType ParserReturnType = "blockRef" // hash, hex number or tag (latest, earliest, etc) ObjectType ParserReturnType = "object" // generic object StringType ParserReturnType = "string" // string values BlockRangeType ParserReturnType = "blockRange" // block range (from, to) )
type StringParam ¶
type StringParam struct {
Value string
}
type Subscription ¶
type TagParser ¶
type TagParser struct {
ReturnType ParserReturnType `json:"type"`
Path string `json:"path"`
}
Click to show internal directories.
Click to hide internal directories.