Versions in this module Expand all Collapse all v0 v0.9.0 Oct 19, 2020 Changes in this version + var RE_ADDRESS = regexp.MustCompile(`^(?i)[a-z0-9]{25,34}$`) + var RE_EMAIL = regexp.MustCompile(`^(?i)(` + dotAtom + `)@(` + dotAtom + `)$`) + var RE_HEX = regexp.MustCompile(`^(?i)[a-f0-9]+$`) + var RE_HOST = regexp.MustCompile(`^(?i)(` + domain + `)$`) + var RE_INT = regexp.MustCompile(`^-?[0-9]+$`) + func GetParam(r *http.Request, param string) string + func GetParamByteSlice(r *http.Request, param string) ([]byte, error) + func GetParamFloat64(r *http.Request, param string) (float64, error) + func GetParamInt32(r *http.Request, param string) (int32, error) + func GetParamInt64(r *http.Request, param string) (int64, error) + func GetParamRegexp(r *http.Request, param string, re *regexp.Regexp) (string, error) + func GetParamUint(r *http.Request, param string) (uint, error) + func GetParamUint64(r *http.Request, param string) (uint64, error) + func Listen(addr string, config *Config) (listener net.Listener, err error) + func NewWSConnection(baseConn *websocket.Conn, funcMap map[string]*RPCFunc, cdc *amino.Codec, ...) *wsConnection + func OnDisconnect(onDisconnect func(remoteAddr string)) func(*wsConnection) + func PingPeriod(pingPeriod time.Duration) func(*wsConnection) + func ReadLimit(readLimit int64) func(*wsConnection) + func ReadWait(readWait time.Duration) func(*wsConnection) + func RecoverAndLogHandler(handler http.Handler, logger log.Logger) http.Handler + func RegisterRPCFuncs(mux *http.ServeMux, funcMap map[string]*RPCFunc, cdc *amino.Codec, ...) + func StartHTTPAndTLSServer(listener net.Listener, handler http.Handler, certFile, keyFile string, ...) error + func StartHTTPServer(listener net.Listener, handler http.Handler, logger log.Logger, config *Config) error + func WriteChanCapacity(cap int) func(*wsConnection) + func WriteRPCResponseArrayHTTP(w http.ResponseWriter, res []types.RPCResponse) + func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) + func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RPCResponse) + func WriteWait(writeWait time.Duration) func(*wsConnection) + type Config struct + MaxBodyBytes int64 + MaxHeaderBytes int + MaxOpenConnections int + ReadTimeout time.Duration + WriteTimeout time.Duration + func DefaultConfig() *Config + type RPCFunc struct + func NewRPCFunc(f interface{}, args string) *RPCFunc + func NewWSRPCFunc(f interface{}, args string) *RPCFunc + type ResponseWriterWrapper struct + Status int + func (w *ResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w *ResponseWriterWrapper) WriteHeader(status int) + type WebsocketManager struct + func NewWebsocketManager(funcMap map[string]*RPCFunc, cdc *amino.Codec, ...) *WebsocketManager + func (wm *WebsocketManager) SetLogger(l log.Logger) + func (wm *WebsocketManager) WebsocketHandler(w http.ResponseWriter, r *http.Request)