Source File
errors.go
Belonging Package
github.com/gobwas/ws
package ws// RejectOption represents an option used to control the way connection is// rejected.type RejectOption func(*ConnectionRejectedError)// RejectionReason returns an option that makes connection to be rejected with// given reason.func ( string) RejectOption {return func( *ConnectionRejectedError) {.reason =}}// RejectionStatus returns an option that makes connection to be rejected with// given HTTP status code.func ( int) RejectOption {return func( *ConnectionRejectedError) {.code =}}// RejectionHeader returns an option that makes connection to be rejected with// given HTTP headers.func ( HandshakeHeader) RejectOption {return func( *ConnectionRejectedError) {.header =}}// RejectConnectionError constructs an error that could be used to control the// way handshake is rejected by Upgrader.func ( ...RejectOption) error {:= new(ConnectionRejectedError)for , := range {()}return}// ConnectionRejectedError represents a rejection of connection during// WebSocket handshake error.//// It can be returned by Upgrader's On* hooks to indicate that WebSocket// handshake should be rejected.type ConnectionRejectedError struct {reason stringcode intheader HandshakeHeader}// Error implements error interface.func ( *ConnectionRejectedError) () string {return .reason}func ( *ConnectionRejectedError) () int {return .code}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |