blob

package
v0.0.0-...-20c3865 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	// Data is the payload content.
	Data *simplejson.Json

	// ID sets the blob primary key in the Elastic Search store.
	ID string

	// SnapshotID identifies the field of the snapshotted data that should be
	// used as the snapshot Id.
	SnapshotID string

	// SnapshotField identifies the field of the blob data that should be
	// extracted and used as a snapshot.
	SnapshotField string

	// Timestamp is the creation time of the blob. It defaults to the object
	// creation time but can be overriden, most notably in the case of life
	// events when the queue timestamp will be used instead.
	Timestamp time.Time

	// Type is the blob type in the Elastic Search store.
	Type string
}

Blob is a opaque type representing an arbitrary payload from GitHub.

func NewBlob

func NewBlob(event, id string) *Blob

NewBlob returns an empty Blob for that particular event type and id.

func NewBlobFromJSON

func NewBlobFromJSON(event, id string, json *simplejson.Json) *Blob

func NewBlobFromPayload

func NewBlobFromPayload(event, id string, payload []byte) (*Blob, error)

func (*Blob) Encode

func (b *Blob) Encode() ([]byte, error)

func (*Blob) HasAttribute

func (b *Blob) HasAttribute(attr string) bool

func (*Blob) Push

func (b *Blob) Push(key string, value interface{}) error

func (*Blob) Snapshot

func (b *Blob) Snapshot() *Blob

Snapshot returns the ID and Data for the snapshot for a Blob that models a live event.

Jump to

Keyboard shortcuts

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