Documentation
¶
Index ¶
- Constants
- func CheckSizeLimit(size int64, limit int64, kind string) error
- func CopyDiscardLimited(r io.Reader, limit int64, kind string) error
- func DecodeWSMessage(bytes []byte, msg proto.Message) error
- func ReadAllLimited(r io.Reader, limit int64, kind string) ([]byte, error)
- func ResolveMaxMessageSize(maxMessageSize int64) int64
- func WriteWSMessage(conn *websocket.Conn, msg proto.Message, maxMessageSize int64) error
- type NopLogger
- type OptionalDuration
- type SizeLimitError
Constants ¶
View Source
const DefaultMaxMessageSize int64 = 64 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func CheckSizeLimit ¶ added in v0.24.0
func CopyDiscardLimited ¶ added in v0.24.0
func DecodeWSMessage ¶ added in v0.5.0
DecodeWSMessage decodes a websocket message as bytes into a proto.Message.
func ReadAllLimited ¶ added in v0.24.0
func ResolveMaxMessageSize ¶ added in v0.24.0
Types ¶
type OptionalDuration ¶
type OptionalDuration struct {
Duration time.Duration
// true if duration field is defined.
Defined bool
}
func ExtractRetryAfterHeader ¶
func ExtractRetryAfterHeader(resp *http.Response) OptionalDuration
ExtractRetryAfterHeader extracts Retry-After response header if the status is 503 or 429. Returns 0 duration if the header is not found or the status is different.
type SizeLimitError ¶ added in v0.24.0
func (*SizeLimitError) Error ¶ added in v0.24.0
func (e *SizeLimitError) Error() string
Click to show internal directories.
Click to hide internal directories.