util

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Span added in v0.1.6

func Span(name string) func()

Types

type Lifetime

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

func NewLifetime

func NewLifetime(ctx context.Context) Lifetime

func (*Lifetime) Cancel

func (s *Lifetime) Cancel()

func (*Lifetime) Ctx

func (s *Lifetime) Ctx() context.Context

func (*Lifetime) IsDone

func (s *Lifetime) IsDone() bool

func (*Lifetime) Started

func (s *Lifetime) Started() time.Time

type Publisher

type Publisher[T any] struct {
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher[T any]() *Publisher[T]

func (*Publisher[T]) Publish

func (p *Publisher[T]) Publish(value T)

func (*Publisher[T]) Subscribe

func (t *Publisher[T]) Subscribe(ctx context.Context) *Subscriber[T]

type Resizable

type Resizable interface {
	Resize(width, height int)
}

type Subscriber

type Subscriber[T any] struct {
	Lifetime
	// contains filtered or unexported fields
}

func (*Subscriber[T]) Done

func (t *Subscriber[T]) Done()

func (*Subscriber[T]) Recv

func (t *Subscriber[T]) Recv() <-chan T

type WaitBuffer

type WaitBuffer struct {
	deadlock.Mutex
	// contains filtered or unexported fields
}

A buffer where Read() blocks until the next Write().

func NewWaitBuffer

func NewWaitBuffer() *WaitBuffer

func (*WaitBuffer) Read

func (w *WaitBuffer) Read(p []byte) (n int, err error)

func (*WaitBuffer) Write

func (w *WaitBuffer) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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