dummyfossilizer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package dummyfossilizer implements a fossilizer that can be used for testing.

It doesn't do much -- it just adds a timestamp.

Index

Constants

View Source
const (
	// Name is the name set in the fossilizer's information.
	Name = "dummy"

	// Description is the description set in the fossilizer's information.
	Description = "Indigo's Dummy Fossilizer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// A version string that will be set in the store's information.
	Version string

	// A git commit hash that will be set in the store's information.
	Commit string
}

Config contains configuration options for the store.

type DummyFossilizer

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

DummyFossilizer is the type that implements github.com/stratumn/go-indigocore/fossilizer.Adapter.

func New

func New(config *Config) *DummyFossilizer

New creates an instance of a DummyFossilizer.

func (*DummyFossilizer) AddFossilizerEventChan added in v0.2.0

func (a *DummyFossilizer) AddFossilizerEventChan(fossilizerEventChan chan *fossilizer.Event)

AddFossilizerEventChan implements github.com/stratumn/go-indigocore/fossilizer.Adapter.AddFossilizerEventChan.

func (*DummyFossilizer) Fossilize

func (a *DummyFossilizer) Fossilize(ctx context.Context, data []byte, meta []byte) error

Fossilize implements github.com/stratumn/go-indigocore/fossilizer.Adapter.Fossilize.

func (*DummyFossilizer) GetInfo

func (a *DummyFossilizer) GetInfo(ctx context.Context) (interface{}, error)

GetInfo implements github.com/stratumn/go-indigocore/fossilizer.Adapter.GetInfo.

type DummyProof added in v0.2.0

type DummyProof struct {
	Timestamp uint64 `json:"timestamp"`
}

DummyProof implements the cs.Proof interface

func (*DummyProof) FullProof added in v0.2.0

func (p *DummyProof) FullProof() []byte

FullProof returns a JSON formatted proof

func (*DummyProof) Time added in v0.2.0

func (p *DummyProof) Time() uint64

Time returns the timestamp from the block header

func (*DummyProof) Verify added in v0.2.0

func (p *DummyProof) Verify(interface{}) bool

Verify returns true if the proof of a given linkHash is correct

type Info

type Info struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
	Commit      string `json:"commit"`
}

Info is the info returned by GetInfo.

Jump to

Keyboard shortcuts

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