jsonfile

package
v0.0.0-...-9d38f52 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package jsonfile is a generated protocol buffer package.

It is generated from these files:

checkpoint.proto

It has these top-level messages:

Checkpoint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	Pos  int64  `protobuf:"varint,2,opt,name=Pos" json:"Pos,omitempty"`
	Name string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
}

func (*Checkpoint) Descriptor

func (*Checkpoint) Descriptor() ([]byte, []int)

func (*Checkpoint) GetName

func (m *Checkpoint) GetName() string

func (*Checkpoint) GetPos

func (m *Checkpoint) GetPos() int64

func (*Checkpoint) ProtoMessage

func (*Checkpoint) ProtoMessage()

func (*Checkpoint) Reset

func (m *Checkpoint) Reset()

func (*Checkpoint) String

func (m *Checkpoint) String() string

type Source

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

Source from JSON encoded values.

func New

func New(prototype interface{}, name string) *Source

New json file source. Parameter prototype should be a non-pointer value of the type to decode into, for example:

data, err := jsonfile.FromFile(MyType{}, "event.data")

func (*Source) Init

func (s *Source) Init(ctx context.Context, checkpoint interface{}) error

Init the source.

func (*Source) Metadata

func (s *Source) Metadata() source.Metadata

Metadata about source.

func (*Source) Stop

func (s *Source) Stop() error

Stop the source.

func (*Source) Take

func (s *Source) Take(ctx context.Context) (*source.Item, error)

Take next value of the source.

Jump to

Keyboard shortcuts

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