fossilizer

package
v0.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fossilizer defines types to implement a fossilizer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// Returns arbitrary information about the adapter.
	GetInfo(context.Context) (interface{}, error)

	// Adds a channel that receives events from the fossilizer
	AddFossilizerEventChan(chan *Event)

	// Requests data to be fossilized.
	// Meta is arbitrary data that will be forwarded to the websocket.
	Fossilize(ctx context.Context, data []byte, meta []byte) error
}

Adapter must be implemented by a fossilier.

type Event added in v0.2.0

type Event struct {
	EventType EventType
	Data      interface{}
}

Event is the object fossilizers send to notify of important events.

type EventType added in v0.2.0

type EventType string

EventType lets you know the kind of event received. A client should ignore events it doesn't care about or doesn't understand.

const (
	// DidFossilizeLink means that the link was fossilized
	DidFossilizeLink EventType = "DidFossilizeLink"
)

type Result

type Result struct {
	// Evidence created by the fossilizer.
	Evidence cs.Evidence

	// The data that was fossilized.
	Data []byte

	// The meta data that was given to Adapter.Fossilize.
	Meta []byte
}

Result is the type sent to the result channels.

Directories

Path Synopsis
Package fossilizerhttp is used to create an HTTP server from a fossilizer adapter.
Package fossilizerhttp is used to create an HTTP server from a fossilizer adapter.
Package fossilizertesting defines helpers to test fossilizers.
Package fossilizertesting defines helpers to test fossilizers.

Jump to

Keyboard shortcuts

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