record

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LastModified

func LastModified(body interface{}) int64

func NewDefaultRecord

func NewDefaultRecord(rtype string, source string, id int64, uri string, body interface{}, t time.Duration) (catalog.Record, error)

func NewElasticsearchRecord

func NewElasticsearchRecord(id int64, uri string, body interface{}, t time.Duration) (catalog.Record, error)

func NewErrorRecord

func NewErrorRecord(source string, id int64, uri string, err error, t time.Duration) (catalog.Record, error)

Types

type DefaultRecord

type DefaultRecord struct {
	catalog.Record     `json:",omitempty"`
	RecordType         string        `json:"type"`
	RecordSource       string        `json:"source"`
	RecordID           int64         `json:"id"`
	RecordURI          string        `json:"uri"`
	RecordBody         interface{}   `json:"body"`
	RecordHash         string        `json:"hash"`
	RecordTiming       time.Duration `json:"timing"`
	RecordLastModified int64         `json:"lastmodified"`
}

func (*DefaultRecord) Body

func (r *DefaultRecord) Body() interface{}

func (*DefaultRecord) Id

func (r *DefaultRecord) Id() int64

func (*DefaultRecord) LastModified

func (r *DefaultRecord) LastModified() int64

func (*DefaultRecord) Source

func (r *DefaultRecord) Source() string

func (*DefaultRecord) Timing

func (r *DefaultRecord) Timing() time.Duration

func (*DefaultRecord) Type

func (r *DefaultRecord) Type() string

func (*DefaultRecord) URI

func (r *DefaultRecord) URI() string

type ElasticsearchRecord

type ElasticsearchRecord struct {
	catalog.Record     `json:",omitempty"`
	RecordType         string        `json:"type"`
	RecordSource       string        `json:"source"`
	RecordID           int64         `json:"id"`
	RecordURI          string        `json:"uri"`
	RecordBody         interface{}   `json:"body"`
	RecordHash         string        `json:"hash"`
	RecordTiming       time.Duration `json:"timing"`
	RecordLastModified int64         `json:"lastmodified"`
}

func (*ElasticsearchRecord) Body

func (r *ElasticsearchRecord) Body() interface{}

func (*ElasticsearchRecord) Id

func (r *ElasticsearchRecord) Id() int64

func (*ElasticsearchRecord) LastModified

func (r *ElasticsearchRecord) LastModified() int64

func (*ElasticsearchRecord) Source

func (r *ElasticsearchRecord) Source() string

func (*ElasticsearchRecord) Timing

func (r *ElasticsearchRecord) Timing() time.Duration

func (*ElasticsearchRecord) Type

func (r *ElasticsearchRecord) Type() string

func (*ElasticsearchRecord) URI

func (r *ElasticsearchRecord) URI() string

Jump to

Keyboard shortcuts

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