utils

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MultiPartFormData = "multipart/form-data"

Variables

This section is empty.

Functions

func BlockPayloadToTxIDs

func BlockPayloadToTxIDs(blockPayload interface{}) ([]string, error)

func GetBase64urlKey added in v0.2.8

func GetBase64urlKey(params map[string]string, name string) (string, error)

func GetBlockNum

func GetBlockNum(params map[string]string) (uint64, error)

func GetBlockNumAndTxIndex

func GetBlockNumAndTxIndex(params map[string]string) (uint64, uint64, error)

func GetStartAndEndBlockNum

func GetStartAndEndBlockNum(params map[string]string) (uint64, uint64, error)

func GetUintParam

func GetUintParam(key string, params map[string]string) (uint64, *types.HttpResponseErr)

func GetVersion

func GetVersion(params map[string]string) (*types.Version, error)

func IsConfigBlock

func IsConfigBlock(block *types.Block) bool

func MarshalJsonOrPanic

func MarshalJsonOrPanic(o interface{}) []byte

func MarshalOrPanic

func MarshalOrPanic(m proto.Message) []byte

func SendHTTPRedirectServer

func SendHTTPRedirectServer(w http.ResponseWriter, r *http.Request, hostPort string)

SendHTTPRedirectServer replaces the Host in the request URL with hostPort, and redirects using StatusTemporaryRedirect (307).

func SendHTTPResponse

func SendHTTPResponse(w http.ResponseWriter, code int, payload interface{})

SendHTTPResponse writes HTTP response back including HTTP code number and encode payload

Types

This section is empty.

Jump to

Keyboard shortcuts

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