Documentation ¶
Index ¶
- Constants
- func AppendFormatFloat(in []byte, fVal float64, prec, bitSize int) []byte
- func LengthEncodedIntSize(n uint64) int
- func NewCorsHandler(handler http.Handler, cfg *config.Config) http.Handler
- func NewTestConfig() *config.Config
- func ParseLengthEncodedBytes(b []byte) ([]byte, bool, int, error)
- func ParseLengthEncodedInt(b []byte) (num uint64, isNull bool, n int)
- func ParseNullTermString(b []byte) (str []byte, remain []byte)
- type BufferedReadConn
- type CorsHandler
- type InputDecoder
Constants ¶
const DefaultReaderSize = 16 * 1024
DefaultReaderSize is the default size of bufio.Reader.
Variables ¶
This section is empty.
Functions ¶
func AppendFormatFloat ¶
AppendFormatFloat appends a float64 to dst in MySQL format.
func LengthEncodedIntSize ¶
LengthEncodedIntSize returns the size of length encoded integer.
func NewCorsHandler ¶
NewCorsHandler creates a new CorsHandler.
func NewTestConfig ¶
NewTestConfig creates a new config for test.
func ParseLengthEncodedBytes ¶
ParseLengthEncodedBytes parses a length encoded byte slice.
func ParseLengthEncodedInt ¶
ParseLengthEncodedInt parses a length encoded integer.
func ParseNullTermString ¶
ParseNullTermString parses a null terminated string.
Types ¶
type BufferedReadConn ¶
BufferedReadConn is a net.Conn compatible structure that reads from bufio.Reader.
func NewBufferedReadConn ¶
func NewBufferedReadConn(conn net.Conn) *BufferedReadConn
NewBufferedReadConn creates a BufferedReadConn.
type CorsHandler ¶
type CorsHandler struct {
// contains filtered or unexported fields
}
CorsHandler adds Cors Header if `cors` config is set.
func (CorsHandler) ServeHTTP ¶
func (h CorsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler interface.
type InputDecoder ¶
type InputDecoder struct {
// contains filtered or unexported fields
}
InputDecoder is used to decode input.
func NewInputDecoder ¶
func NewInputDecoder(chs string) *InputDecoder
NewInputDecoder creates a new InputDecoder.
func (*InputDecoder) DecodeInput ¶
func (i *InputDecoder) DecodeInput(src []byte) []byte
DecodeInput decodes input.