state

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 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) String

func (hv *HeightView) String() string

func (*HeightView) View

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

type State

type State struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Mutable, goroutine-safe State object

func NewState

func NewState() *State

func (*State) CancelContextIfHeightViewUnchanged

func (s *State) CancelContextIfHeightViewUnchanged(cancel context.CancelFunc, height primitives.BlockHeight, view primitives.View) (*HeightView, bool)

func (*State) CompareWithEffectiveHeightAndCancel

func (s *State) CompareWithEffectiveHeightAndCancel(cancel context.CancelFunc, lastUpdated primitives.BlockHeight, height primitives.BlockHeight) (*HeightView, bool)

func (*State) Height

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

func (*State) HeightView

func (s *State) HeightView() *HeightView

func (*State) SetHeightAndResetView

func (s *State) SetHeightAndResetView(ctx context.Context, 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(ctx context.Context, newView primitives.View) (*HeightView, error)

func (*State) View

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

Jump to

Keyboard shortcuts

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