Documentation ¶
Index ¶
- Constants
- func Acati(str, b string, n int) string
- func Acatui(str, b string, n uint64) string
- func Addrcat(host string, port int) string
- func AllowMethod(w http.ResponseWriter, m string, ms ...string) bool
- func Atoi(str string) uint64
- func ItoaQuick(i int) string
- func NewLimitedBufferReader(r io.Reader, n int) io.Reader
- type Error
- type StopListener
Constants ¶
View Source
const ( // ErrNone is none error ErrNone = 100 // ErrTopicNotExisted is topic not existed error ErrTopicNotExisted = 101 // ErrLineNotExisted is line not existed error ErrLineNotExisted = 102 // ErrNotDelivered is the message not delivered error ErrNotDelivered = 103 // ErrBadKey is key bad error ErrBadKey = 104 // ErrTopicExisted is topic has been existed error ErrTopicExisted = 105 // ErrLineExisted is line has been existed error ErrLineExisted = 106 // ErrBadRequest is bad request error ErrBadRequest = 400 // ErrInternalError is internal error ErrInternalError = 500 )
Variables ¶
This section is empty.
Functions ¶
func AllowMethod ¶
func AllowMethod(w http.ResponseWriter, m string, ms ...string) bool
AllowMethod verifies that the given method is one of the allowed methods, and if not, it writes an error to w. A boolean is returned indicating whether or not the method is allowed.
Types ¶
type Error ¶
type Error struct { ErrorCode int `json:"errorCode"` Message string `json:"message"` Cause string `json:"cause,omitempty"` }
Error is the error type in uq
func (Error) WriteTo ¶
func (e Error) WriteTo(w http.ResponseWriter)
WriteTo writes the error to a http response
type StopListener ¶
type StopListener struct { *net.TCPListener //Wrapped listener // contains filtered or unexported fields }
StopListener is a stopable listener
func NewStopListener ¶
func NewStopListener(l net.Listener) (*StopListener, error)
NewStopListener returns a new StopListener with a net listener
Click to show internal directories.
Click to hide internal directories.