You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/bsr/direction.go

36 lines
596 B

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package bsr
// Direction identifies the directionality of the data captured
// in the chunk.
type Direction uint8
// Directions
const (
UnknownDirection Direction = iota
Inbound
Outbound
)
func (d Direction) String() string {
switch d {
case Inbound:
return "inbound"
case Outbound:
return "outbound"
default:
return "unknown direction"
}
}
// ValidDirection checks if a given Direction is valid.
func ValidDirection(d Direction) bool {
switch d {
case Inbound, Outbound:
return true
}
return false
}