docs: add docstrings for confirmer

This commit is contained in:
James Houlahan
2020-07-23 14:38:45 +02:00
parent 36ef9f20ae
commit c988d739a1
2 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import (
"github.com/google/uuid"
)
// Request provides a result when it becomes available.
type Request struct {
uuid string
value chan bool
@ -38,10 +39,12 @@ func newRequest(timeout time.Duration) *Request {
}
}
// ID returns the request's ID, used to set the request's value.
func (r *Request) ID() string {
return r.uuid
}
// Result returns the result or an error if it is not available within the request timeout.
func (r *Request) Result() (bool, error) {
select {
case res := <-r.value: