Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

notify

package
v0.27.3Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:4Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcNotify

func Notify(condCondition, intervaltime.Duration, countdown ...time.Duration) (closeFunc func())

Notify is a convenience function that initializes a new Notifierwith the given condition, interval, and countdown.It is the responsibility of the caller to call close to stop polling.

Types

typeCondition

type Condition func(nowtime.Time) (deadlinetime.Time, callback func())

Condition is a function that gets executed with a certain time.

  • It should return the deadline for the notification, as well as acallback function to execute once the time to the deadline isless than one of the notify attempts. If deadline is the zerotime, callback will not be executed.
  • Callback is executed once for every time the difference between deadlineand the current time is less than an element of countdown.
  • To enforce a minimum interval between consecutive callbacks, truncatethe returned deadline to the minimum interval.

typeNotifier

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

Notifier calls a Condition at most once for each count in countdown.

funcNew

func New(condCondition, countdown ...time.Duration) *Notifier

New returns a Notifier that calls cond once every time it polls.

  • Duplicate values are removed from countdown, and it is sorted indescending order.

func (*Notifier)Closeadded inv0.8.2

func (n *Notifier) Close()error

func (*Notifier)Poll

func (n *Notifier) Poll(ticker <-chantime.Time)

Poll polls once immediately, and then once for every value from ticker.Poll exits when ticker is closed.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp