confirmer

package
v1.8.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirmer

type Confirmer struct {
	// contains filtered or unexported fields
}

Confirmer is used to ask for some value (e.g. a confirmation from a GUI element) in a threadsafe manner and retrieve that value later.

func New

func New() *Confirmer

func (*Confirmer) NewRequest

func (c *Confirmer) NewRequest(timeout time.Duration) *Request

NewRequest creates a new request object that waits up to the given amount of time for the result.

func (*Confirmer) SetResult

func (c *Confirmer) SetResult(id string, value bool) error

SetResult sets the result value of the request with the given ID.

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request provides a result when it becomes available.

func (*Request) ID

func (r *Request) ID() string

ID returns the request's ID, used to set the request's value.

func (*Request) Result

func (r *Request) Result() (bool, error)

Result returns the result or an error if it is not available within the request timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL