feat(bsr): Define container and the required fs interfaces

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
This commit is contained in:
Timothy MessierandIrena Rindos committed 2023-05-31 12:18:11 +00:00
1 parent 9302705d1b
commit 2a31ddd881
56 files changed
+2549 -71

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package bsr
// ByteSource identifies whether bytes are flowing from the user to target (client)
// or target to user (server)
type ByteSource uint8
// ByteDirections
const (
UnknownByteSource ByteSource = iota
Client
Server
)
func (d ByteSource) String() string {
switch d {
case Client:
return "client"
case Server:
return "server"
default:
return "unknown bytesource"
}
}
// ValidByteSource checks if a given ByteSource is valid.
func ValidByteSource(d ByteSource) bool {
switch d {
case Client, Server:
return true
}
return false
}