deadline

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package deadline provides deadline timer used to implement net.Conn compatible connection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deadline

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

Deadline signals updatable deadline timer. Also, it implements context.Context.

func New

func New() *Deadline

New creates new deadline timer.

func (*Deadline) Deadline

func (d *Deadline) Deadline() (time.Time, bool)

Deadline returns current deadline.

func (*Deadline) Done

func (d *Deadline) Done() <-chan struct{}

Done receives deadline signal.

func (*Deadline) Err

func (d *Deadline) Err() error

Err returns context.DeadlineExceeded if the deadline is exceeded. Otherwise, it returns nil.

func (*Deadline) Set

func (d *Deadline) Set(t time.Time)

Set new deadline. Zero value means no deadline.

func (*Deadline) Value

func (d *Deadline) Value(interface{}) interface{}

Value returns nil.

Jump to

Keyboard shortcuts

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