duplex

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Link(a Stream, b Stream)

func Parse added in v1.1.0

func Parse() pull.Pulls

func Serialize added in v1.1.0

func Serialize() pull.Through

Types

type Buffer added in v1.0.1

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

todo.线程安全的必要性

func NewBuffer added in v1.0.1

func NewBuffer() *Buffer

func (*Buffer) Length added in v1.0.1

func (b *Buffer) Length() int

func (*Buffer) Push added in v1.0.1

func (b *Buffer) Push(item interface{})

Add items to the end of an array

func (*Buffer) Shift added in v1.0.1

func (b *Buffer) Shift() interface{}

Remove an item from the beginning of an array

func (*Buffer) Unshift added in v1.0.1

func (b *Buffer) Unshift(item interface{})

Add items to the beginning of an array

type Duplex

type Duplex struct {
	*event.Emitter
	// contains filtered or unexported fields
}

func NewDuplex

func NewDuplex(sb *sb.Scuttlebutt, opts ...Option) *Duplex

Sink (reader or writable stream that consumes values) Source (readable stream that produces values)

func (*Duplex) End added in v1.0.1

func (d *Duplex) End(data interface{})

func (*Duplex) Sink added in v1.0.1

func (d *Duplex) Sink() interface{}

func (*Duplex) Source added in v1.0.1

func (d *Duplex) Source() interface{}

type OnClose

type OnClose func(err error)

type Option

type Option func(s *Duplex)

func WithName

func WithName(name string) Option

func WithReadable

func WithReadable(readable bool) Option

func WithWritable

func WithWritable(writable bool) Option

type Outgoing

type Outgoing struct {
	Id     sb.SourceId     `json:"id"`
	Clock  sb.Sources      `json:"clock"`
	Meta   interface{}     `json:"-"`
	Accept *sb.ModelAccept `json:"accept"`
}

type Stream added in v1.1.0

type Stream interface {
	Source() interface{}
	Sink() interface{}
}

Jump to

Keyboard shortcuts

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