aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/google/flatbuffers/go/lib.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-01-22 16:07:17 +0100
committerTaras Madan <tarasmadan@google.com>2025-01-23 10:42:36 +0000
commit7b4377ad9d8a7205416df8d6217ef2b010f89481 (patch)
treee6fec4fd12ff807a16d847923f501075bf71d16c /vendor/github.com/google/flatbuffers/go/lib.go
parent475a4c203afb8b7d3af51c4fd32bb170ff32a45e (diff)
vendor: delete
Diffstat (limited to 'vendor/github.com/google/flatbuffers/go/lib.go')
-rw-r--r--vendor/github.com/google/flatbuffers/go/lib.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/github.com/google/flatbuffers/go/lib.go b/vendor/github.com/google/flatbuffers/go/lib.go
deleted file mode 100644
index a4e99de10..000000000
--- a/vendor/github.com/google/flatbuffers/go/lib.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package flatbuffers
-
-// FlatBuffer is the interface that represents a flatbuffer.
-type FlatBuffer interface {
- Table() Table
- Init(buf []byte, i UOffsetT)
-}
-
-// GetRootAs is a generic helper to initialize a FlatBuffer with the provided buffer bytes and its data offset.
-func GetRootAs(buf []byte, offset UOffsetT, fb FlatBuffer) {
- n := GetUOffsetT(buf[offset:])
- fb.Init(buf, n+offset)
-}
-
-// GetSizePrefixedRootAs is a generic helper to initialize a FlatBuffer with the provided size-prefixed buffer
-// bytes and its data offset
-func GetSizePrefixedRootAs(buf []byte, offset UOffsetT, fb FlatBuffer) {
- n := GetUOffsetT(buf[offset+sizePrefixLength:])
- fb.Init(buf, n+offset+sizePrefixLength)
-}
-
-// GetSizePrefix reads the size from a size-prefixed flatbuffer
-func GetSizePrefix(buf []byte, offset UOffsetT) uint32 {
- return GetUint32(buf[offset:])
-}
-
-// GetIndirectOffset retrives the relative offset in the provided buffer stored at `offset`.
-func GetIndirectOffset(buf []byte, offset UOffsetT) UOffsetT {
- return offset + GetUOffsetT(buf[offset:])
-}
-
-// GetBufferIdentifier returns the file identifier as string
-func GetBufferIdentifier(buf []byte) string {
- return string(buf[SizeUOffsetT:][:fileIdentifierLength])
-}
-
-// GetBufferIdentifier returns the file identifier as string for a size-prefixed buffer
-func GetSizePrefixedBufferIdentifier(buf []byte) string {
- return string(buf[SizeUOffsetT+sizePrefixLength:][:fileIdentifierLength])
-}
-
-// BufferHasIdentifier checks if the identifier in a buffer has the expected value
-func BufferHasIdentifier(buf []byte, identifier string) bool {
- return GetBufferIdentifier(buf) == identifier
-}
-
-// BufferHasIdentifier checks if the identifier in a buffer has the expected value for a size-prefixed buffer
-func SizePrefixedBufferHasIdentifier(buf []byte, identifier string) bool {
- return GetSizePrefixedBufferIdentifier(buf) == identifier
-}