Documentation ¶
Index ¶
- Constants
- Variables
- func CapStringLen(inp string) string
- func ParseBlockHashFromReplyAndDecode(rpcInput RPCInput, resultParser spectypes.BlockParser, ...) (string, error)
- func ParseDefaultBlockParameter(block string) (int64, error)
- func ParseRawBlock(rpcInput RPCInput, parsedInput *ParsedInput, defaultValue string)
- type ParsedInput
- func NewParsedInput() *ParsedInput
- func ParseBlockFromParams(rpcInput RPCInput, blockParser spectypes.BlockParser, ...) *ParsedInput
- func ParseBlockFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser, ...) *ParsedInput
- func ParseWithGenericParsers(rpcInput RPCInput, genericParsers []spectypes.GenericParser) (*ParsedInput, error)
- type RPCInput
Constants ¶
View Source
const ( PARSE_PARAMS = 0 PARSE_RESULT = 1 MinimumHashLength = 32 // minimum hash length is 32 bits, which is MD5. SHA-1=40, SHA256=64, SHA512=128. )
View Source
const RAW_NOT_APPLICABLE = "-1"
Variables ¶
View Source
var ValueNotSetError = sdkerrors.New("Value Not Set ", 6662, "when trying to parse, the value that we attempted to parse did not exist")
Functions ¶
func CapStringLen ¶
func ParseBlockHashFromReplyAndDecode ¶
func ParseBlockHashFromReplyAndDecode(rpcInput RPCInput, resultParser spectypes.BlockParser, genericParsers []spectypes.GenericParser) (string, error)
This returns the parsed response after decoding
func ParseRawBlock ¶
func ParseRawBlock(rpcInput RPCInput, parsedInput *ParsedInput, defaultValue string)
ParseRawBlock attempts to parse a block from rpcInput and store it in parsedInput. If parsing fails or rawBlock is empty, it uses defaultValue if provided. If parsing the defaultValue also fails, it sets the block to NOT_APPLICABLE.
Types ¶
type ParsedInput ¶
type ParsedInput struct {
// contains filtered or unexported fields
}
func NewParsedInput ¶
func NewParsedInput() *ParsedInput
func ParseBlockFromParams ¶
func ParseBlockFromParams(rpcInput RPCInput, blockParser spectypes.BlockParser, genericParsers []spectypes.GenericParser) *ParsedInput
func ParseBlockFromReply ¶
func ParseBlockFromReply(rpcInput RPCInput, blockParser spectypes.BlockParser, genericParsers []spectypes.GenericParser) *ParsedInput
func ParseWithGenericParsers ¶
func ParseWithGenericParsers(rpcInput RPCInput, genericParsers []spectypes.GenericParser) (*ParsedInput, error)
func (*ParsedInput) GetBlock ¶
func (p *ParsedInput) GetBlock() int64
func (*ParsedInput) GetBlockHashes ¶
func (p *ParsedInput) GetBlockHashes() ([]string, error)
func (*ParsedInput) GetRawParsedData ¶
func (p *ParsedInput) GetRawParsedData() string
func (*ParsedInput) SetBlock ¶
func (p *ParsedInput) SetBlock(block int64)
Click to show internal directories.
Click to hide internal directories.