web

package
v0.0.0-...-121767f Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package web provides support for http protocol by default, provides rpc server with http protocol, and provides rpc database for calling http protocol.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultServerCodec is the default http server codec.
	DefaultServerCodec = &ServerCodec{}
)
View Source
var DefaultWebTransport = NewWebTransport()

DefaultWebTransport default server http client.

Functions

func NewWebTransport

func NewWebTransport() transport.Transport

NewWebTransport create a new web transport.

Types

type ServerCodec

type ServerCodec struct{}

ServerCodec http server side decoder.

func (*ServerCodec) Decode

func (sc *ServerCodec) Decode(msg *cc.Msg, _ []byte) ([]byte, error)

Decode implements codec.Codec, decode http head http server has filled all the body of request into ctx, and reqBuf here is empty.

func (*ServerCodec) Encode

func (sc *ServerCodec) Encode(msg *cc.Msg, respBody []byte) (b []byte, err error)

Encode implements codec.Codec, encode http head. The buffer of the returned packet has been written to the response writer in head, no need to return respBuf.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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