Skip to content

Commit 8952b25

Browse files
author
Aaron Schlesinger
committed
doc(pkg/sshd/circuit.go): add more godocs
1 parent 2b8fc3b commit 8952b25

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pkg/sshd/circuit.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import (
55
"sync/atomic"
66
)
77

8+
// CircuitState represents the state of a Circuit
89
type CircuitState uint32
910

1011
const (
11-
OpenState CircuitState = 0
12+
// OpenState indicates that the circuit is in the open state, and thus non-functional
13+
OpenState CircuitState = 0
14+
// ClosedState indicates that the circuit is in the closed state, and thus functional
1215
ClosedState CircuitState = 1
1316
)
1417

18+
// String is the fmt.Stringer interface implementation
1519
func (c CircuitState) String() string {
1620
if c == OpenState {
1721
return "OPEN"
@@ -31,11 +35,12 @@ func (s CircuitState) toUint32() uint32 {
3135
// - OpenState - non functional
3236
// - ClosedState - functional
3337
//
34-
//
38+
// The circuit is intended as a point-in-time indicator of functionality. It has no backoff mechanism, jitter or ramp-up/ramp-down functionality
3539
type Circuit struct {
3640
bit uint32
3741
}
3842

43+
// NewCircuit creates a new circuit, in the open (non-functional) state
3944
func NewCircuit() *Circuit {
4045
return &Circuit{bit: OpenState.toUint32()}
4146
}

0 commit comments

Comments
 (0)