Add gRPC Transport support (#356)

Co-authored-by: JimhHan <50871214+JimhHan@users.noreply.github.com>
This commit is contained in:
RPRX 2021-03-14 15:02:07 +00:00 committed by GitHub
parent 60b06877bf
commit a0a32ee00d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1564 additions and 4 deletions

View file

@ -31,6 +31,22 @@ func New() *Buffer {
}
}
func NewExisted(b []byte) *Buffer {
if cap(b) < Size {
panic("Invalid buffer")
}
oLen := len(b)
if oLen < Size {
b = append(b, make([]byte, Size-oLen)...)
}
return &Buffer{
v: b,
end: int32(oLen),
}
}
// StackNew creates a new Buffer object on stack.
// This method is for buffers that is released in the same function.
func StackNew() Buffer {