Documentation ¶
Index ¶
- Variables
- func DialContext(ctx context.Context, urlStr string, requestHeader http.Header, ...) (net.Conn, *http.Response, error)
- func LoadPeriod(ctx context.Context, buf []byte, configF File, configS *[]Config, ...) error
- func LoadX509PubKey(certPEMBlock []byte) tls.Certificate
- func MarkRetry(e error) error
- func Test(ctx context.Context, port int, logger Logger)
- func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (net.Conn, error)
- type Back
- type Config
- type ErrCanRetry
- type File
- type HandshakeError
- type Logger
- type Route
- type Setting
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRedirect = errors.New("ErrRedirect") ErrNoHttp = errors.New("ErrNoHttp") ErrNoWs = errors.New("ErrNoWs") ErrCopy = errors.New("ErrCopy") ErrReqReBodyFail = errors.New("ErrReqReBodyFail") ErrReqReBodyOverflow = errors.New("ErrReqReBodyOverflow") ErrReqCreFail = errors.New("ErrReqCreFail") ErrReqDoFail = errors.New("ErrReqDoFail") ErrResDoFail = errors.New("ErrResDoFail") ErrResFail = errors.New("ErrResFail") ErrResTO = errors.New("ErrResTO") ErrUriTooLong = errors.New("ErrUriTooLong") ErrPatherCheckFail = errors.New("ErrPatherCheckFail") ErrHeaderCheckFail = errors.New("ErrHeaderCheckFail") ErrBodyCheckFail = errors.New("ErrBodyCheckFail") ErrAllBacksFail = errors.New("ErrAllBacksFail") ErrBackFail = errors.New("ErrBackFail") ErrNoRoute = errors.New("ErrNoRoute") ErrDealReqUri = errors.New("ErrDealReqUri") ErrDealReqHeader = errors.New("ErrDealReqHeader") ErrDealResHeader = errors.New("ErrDealResHeader") ErrCerVerify = errors.New("ErrCerVerify") )
View Source
var (
ErrEmptyVerifyPeerCerByte = errors.New("ErrEmptyVerifyPeerCerByte")
)
Functions ¶
func DialContext ¶ added in v0.1.20231214143418
func LoadPeriod ¶
func LoadPeriod(ctx context.Context, buf []byte, configF File, configS *[]Config, logger Logger) error
加载
func LoadX509PubKey ¶ added in v0.1.20240323030221
func LoadX509PubKey(certPEMBlock []byte) tls.Certificate
Types ¶
type Back ¶
type Config ¶
type Config struct { Addr string `json:"addr"` TLS struct { Pub string `json:"pub"` Key string `json:"key"` } `json:"tls"` RetryBlocks struct { SizeB int `json:"sizeB"` Num int `json:"num"` } `json:"retryBlocks"` RetryBlocksI pslice.BlocksI[byte] `json:"-"` MatchRule string `json:"matchRule"` CopyBlocks int `json:"copyBlocks"` BlocksI pslice.BlocksI[byte] `json:"-"` Routes []Route `json:"routes"` // contains filtered or unexported fields }
type ErrCanRetry ¶ added in v0.1.20241009015120
type ErrCanRetry struct { CanRetry bool // contains filtered or unexported fields }
type HandshakeError ¶ added in v0.1.20231214143418
type HandshakeError struct {
// contains filtered or unexported fields
}
func (HandshakeError) Error ¶ added in v0.1.20231214143418
func (t HandshakeError) Error() string
type Route ¶
type Route struct { Path []string `json:"path"` PathAdd bool `json:"pathAdd"` RollRule string `json:"rollRule"` ReqBody filiter.Body `json:"reqBody"` Setting Backs []Back `json:"backs"` // contains filtered or unexported fields }
func (*Route) FiliterBackByRequest ¶ added in v0.1.20240305005058
type Setting ¶ added in v0.1.20240321070814
type Setting struct { ErrToSec float64 `json:"errToSec"` Splicing int `json:"splicing"` ErrBanSec int `json:"errBanSec"` InsecureSkipVerify bool `json:"insecureSkipVerify"` VerifyPeerCer string `json:"verifyPeerCer"` Filiter filiter.Filiter `json:"filiter"` Dealer dealer.Dealer `json:"dealer"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.