state

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeightView

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

Immutable instance of height+view

func (*HeightView) Height

func (hv *HeightView) Height() primitives.BlockHeight

func (*HeightView) OlderThan added in v0.2.4

func (hv *HeightView) OlderThan(otherHv *HeightView) bool

func (*HeightView) String

func (hv *HeightView) String() string

func (*HeightView) View

func (hv *HeightView) View() primitives.View

type State

type State struct {
	sync.RWMutex

	Contexts *ViewContexts
	// contains filtered or unexported fields
}

Mutable, goroutine-safe State object

func NewState

func NewState() *State

func (*State) GcOldContexts added in v0.2.4

func (s *State) GcOldContexts()

func (*State) Height

func (s *State) Height() primitives.BlockHeight

func (*State) HeightView

func (s *State) HeightView() *HeightView

func (*State) SetHeightAndResetView

func (s *State) SetHeightAndResetView(newHeight primitives.BlockHeight) (*HeightView, error)

func (*State) SetHeightView

func (s *State) SetHeightView(ctx context.Context, newHeight primitives.BlockHeight, newView primitives.View) (*HeightView, error)

TODO For testing only, so perhaps move it away

func (*State) SetView

func (s *State) SetView(newView primitives.View) (*HeightView, error)

func (*State) View

func (s *State) View() primitives.View

type ViewContexts added in v0.2.4

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

func NewViewContexts added in v0.2.4

func NewViewContexts() *ViewContexts

func (*ViewContexts) CancelOlderThan added in v0.2.4

func (w *ViewContexts) CancelOlderThan(hv *HeightView)

func (*ViewContexts) For added in v0.2.4

func (w *ViewContexts) For(hv *HeightView) (context.Context, error)

func (*ViewContexts) Shutdown added in v0.2.4

func (w *ViewContexts) Shutdown()

Jump to

Keyboard shortcuts

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