mirror of
https://github.com/fhmq/hmq.git
synced 2026-05-04 07:08:32 +00:00
Plugins support (#46)
* modify * update * add acl * add feature * update dockerfile * add deploy * update * update * plugins * plugins * update * update * update * fixed * remove * fixed * add log * update * fixed * update * fix config * add http api * add http api * resp * add config for work chan * update * fixed * update * disable trace * fixed * change acl * fixed * fixed res * dd * dd * ddd * dd * update * fixed * update * add * fixed * update key * add log * update * format * update * update auth * update * update readme * added * update * fixed * fixed * fix * upade * update * update
This commit is contained in:
35
vendor/github.com/DataDog/zstd/errors.go
generated
vendored
Normal file
35
vendor/github.com/DataDog/zstd/errors.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package zstd
|
||||
|
||||
/*
|
||||
#define ZSTD_STATIC_LINKING_ONLY
|
||||
#include "zstd.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
// ErrorCode is an error returned by the zstd library.
|
||||
type ErrorCode int
|
||||
|
||||
// Error returns the error string given by zstd
|
||||
func (e ErrorCode) Error() string {
|
||||
return C.GoString(C.ZSTD_getErrorName(C.size_t(e)))
|
||||
}
|
||||
|
||||
func cIsError(code int) bool {
|
||||
return int(C.ZSTD_isError(C.size_t(code))) != 0
|
||||
}
|
||||
|
||||
// getError returns an error for the return code, or nil if it's not an error
|
||||
func getError(code int) error {
|
||||
if code < 0 && cIsError(code) {
|
||||
return ErrorCode(code)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsDstSizeTooSmallError returns whether the error correspond to zstd standard sDstSizeTooSmall error
|
||||
func IsDstSizeTooSmallError(e error) bool {
|
||||
if e != nil && e.Error() == "Destination buffer is too small" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user