Documentation ¶ Index ¶ type Once func (o *Once) Reset() func (o *Once) Trigger() func (o *Once) Wait(ctx context.Context) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Once ¶ type Once struct { Handler func() sync.Mutex // contains filtered or unexported fields } func (*Once) Reset ¶ func (o *Once) Reset() Reset will rearm Wait() func (*Once) Trigger ¶ func (o *Once) Trigger() Trigger will start executing the handler function func (*Once) Wait ¶ func (o *Once) Wait(ctx context.Context) error Wait waits for the handler function to complete. If the function is not running it will be triggered. If the function is being executed the first time after Reset(), all callers will block in Wait, until it is completed. Source Files ¶ View all Source files once.go Click to show internal directories. Click to hide internal directories.