common

package
v0.0.0-...-2d5dc59 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Overview

Copyright 2016 The Transicator Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package common is a generated protocol buffer package.

It is generated from these files:

transicator.proto

It has these top-level messages:

ValuePb
ColumnPb
ChangePb
ChangeListPb
SnapshotHeaderPb
TableHeaderPb
RowPb
StreamMessagePb

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeNBPipe

func MakeNBPipe() (io.ReadCloser, io.WriteCloser)

MakeNBPipe returns a paired set of Reader and Writer objects. Anything written to the reader will be available for consumption by the writer. There is no sychronization -- this is designed to be used in a single-threaded context, such as inside a unit test.

func PgTimestampToTime

func PgTimestampToTime(pts int64) time.Time

PgTimestampToTime converts a Postgres timestamp, expressed in microseconds since midnight, January 1, 2000, into a Go Time.

func SendAPIError

func SendAPIError(code, error, description string,
	statusCode int,
	resp http.ResponseWriter, req *http.Request)

SendAPIError sends a standard error response in JSON format.

func TimeToPgTimestamp

func TimeToPgTimestamp(t time.Time) int64

TimeToPgTimestamp converts a Go Time into a Postgres timestamp.

Types

type APIError

type APIError struct {
	// Code is a short description of the error in symbolic form
	Code string `json:"code"`
	// Error is one sentence describing the error
	Error string `json:"error"`
	// Description is longer, if you prefer that
	Description string `json:"description,omitempty"`
}

An APIError is an error returned, usually in JSON, from an API.

type Change

type Change struct {
	// Why the row was changed: insert, update, or delete
	Operation Operation `json:"operation"`
	// The name of the table that was updated
	Table string `json:"table"`
	// A value that indicates when the row is changed. It includes the
	// "commit LSN" and "CommitIndex" from below. This is the value that
	// clients should return to the API when looking for a list of changes.
	Sequence string `json:"sequence,omitempty"`
	// The LSN when the change was committed.
	CommitSequence uint64 `json:"commitSequence"`
	// The Postgres LSN when the row changed. This will be interleaved
	// in the change list because transactions commit at different times.
	ChangeSequence uint64 `json:"changeSequence"`
	// The order in which the change happened within the commit. For a transaction
	// affects multiple rows, changes will be listed in order, and this value
	// will begin at zero and be incremented by one.
	CommitIndex uint32 `json:"commitIndex"`
	// The Postgres Transaction ID when this change committed. This may be used
	// to find a CommitSequence from a particular snapshot. (TXIDs are 32
	// bits inside Postgres. We put the Postgres "epoch" in the high 32 bits
	// so that we deliver a 64-bit value that will not wrap around.)
	TransactionID uint64 `json:"txid"`
	// The time when the record was inserted to the database, in seconds since
	// the Unix epoch.
	Timestamp int64 `json:"timestamp,omitempty"`
	// For an insert operation, the columns that are being inserted. For an update,
	// the new value of the columns
	NewRow Row `json:"newRow,omitempty"`
	// For an update oepration, the old value of the columns. For a delete, the
	// value of the columns that are being deleted
	OldRow Row `json:"oldRow,omitempty"`
	// Sometimes we need to return an error instead of a change. If this is
	// not null, then it means a replication error occurred.
	Error error `json:"-"`
}

A Change is a list of changed rows. Each Change describes how the row changed (due to an insert, delete, or update), when it changed (LSNs and transaction IDs from Postgres), and what changed (the new and/or old rows).

func UnmarshalChange

func UnmarshalChange(data []byte) (*Change, error)

UnmarshalChange just handles a single "Change." This is what we get from the Postgres replication stream.

func UnmarshalChangeProto

func UnmarshalChangeProto(data []byte) (*Change, error)

UnmarshalChangeProto turns a protobuf version of a Change into a Change.

func (*Change) GetSequence

func (c *Change) GetSequence() Sequence

GetSequence returns an object that combines the commit LSN and index.

func (*Change) Marshal

func (c *Change) Marshal() []byte

Marshal turns a Change into JSON.

func (*Change) MarshalProto

func (c *Change) MarshalProto() []byte

MarshalProto turns a Change into a protobuf.

type ChangeList

type ChangeList struct {
	// The highest value for "Sequence" in the whole database. The
	// client may use this to understand when they are at the end of the list
	// of changes.
	LastSequence string `json:"lastSequence"`
	// The lowest value for "Sequence" in the whole database. The client
	// may use this to determine if they are at the beginning of the whole
	// change list and must request a new snapshot to get consistent data.
	FirstSequence string `json:"firstSequence"`
	// All the changes, in order of "commit sequence" and "commit index"
	Changes []Change `json:"changes"`
}

A ChangeList represents a set of changes returned from the change server. It contains a list of rows, and it also contains information about the list.

func UnmarshalChangeList

func UnmarshalChangeList(data []byte) (*ChangeList, error)

UnmarshalChangeList turns a set of JSON into an entire change list.

func UnmarshalChangeListProto

func UnmarshalChangeListProto(data []byte) (*ChangeList, error)

UnmarshalChangeListProto does the same unmarshaling but from a protobuf.

func (*ChangeList) Marshal

func (l *ChangeList) Marshal() []byte

Marshal turns a change list into formatted, indented JSON. It will panic on a marshaling error.

func (*ChangeList) MarshalProto

func (l *ChangeList) MarshalProto() []byte

MarshalProto does the same as Marshal but it makes a protobf.

type ChangeListPb

type ChangeListPb struct {
	LastSequence     *string     `protobuf:"bytes,1,opt,name=lastSequence" json:"lastSequence,omitempty"`
	FirstSequence    *string     `protobuf:"bytes,2,opt,name=firstSequence" json:"firstSequence,omitempty"`
	Changes          []*ChangePb `protobuf:"bytes,3,rep,name=changes" json:"changes,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

func (*ChangeListPb) Descriptor

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

func (*ChangeListPb) GetChanges

func (m *ChangeListPb) GetChanges() []*ChangePb

func (*ChangeListPb) GetFirstSequence

func (m *ChangeListPb) GetFirstSequence() string

func (*ChangeListPb) GetLastSequence

func (m *ChangeListPb) GetLastSequence() string

func (*ChangeListPb) ProtoMessage

func (*ChangeListPb) ProtoMessage()

func (*ChangeListPb) Reset

func (m *ChangeListPb) Reset()

func (*ChangeListPb) String

func (m *ChangeListPb) String() string

type ChangePb

type ChangePb struct {
	// operation -- May be 1, 2, 3 for insert, update, or delete
	Operation *int32 `protobuf:"varint,1,req,name=operation" json:"operation,omitempty"`
	// Table name, in "schema.table" format
	Table *string `protobuf:"bytes,2,req,name=table" json:"table,omitempty"`
	// Sequence number is generated by the change server by combining
	// the commitSequence and commitIndex
	Sequence *string `protobuf:"bytes,3,opt,name=sequence" json:"sequence,omitempty"`
	// LSN when the transaction was committed. Primary sort order.
	CommitSequence *uint64 `protobuf:"varint,4,opt,name=commitSequence" json:"commitSequence,omitempty"`
	// LSN when the change was made. Mostly of academic interest.
	ChangeSequence *uint64 `protobuf:"varint,5,opt,name=changeSequence" json:"changeSequence,omitempty"`
	// Order in which the change was made inside the transaction.
	// Secondary sort order.
	CommitIndex *uint32 `protobuf:"varint,6,opt,name=commitIndex" json:"commitIndex,omitempty"`
	// 32-bit Postgres transaction ID. Not used by newer code.
	// Rolls over.
	TransactionID *uint32 `protobuf:"varint,7,opt,name=transactionID" json:"transactionID,omitempty"`
	// Row added to an insert, or new row for an update.
	NewColumns []*ColumnPb `protobuf:"bytes,8,rep,name=newColumns" json:"newColumns,omitempty"`
	// Row removed on a delete, or old row for an update.
	OldColumns []*ColumnPb `protobuf:"bytes,9,rep,name=oldColumns" json:"oldColumns,omitempty"`
	// Time when the record was inserted, in seconds since the
	// Unix epoch.
	Timestamp *int64 `protobuf:"varint,10,opt,name=timestamp" json:"timestamp,omitempty"`
	// 64-bit Postgres transaction id, including the epoch. Will not
	// roll over.
	TransactionIDEpoch *uint64 `protobuf:"varint,11,opt,name=transactionIDEpoch" json:"transactionIDEpoch,omitempty"`
	XXX_unrecognized   []byte  `json:"-"`
}

func (*ChangePb) Descriptor

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

func (*ChangePb) GetChangeSequence

func (m *ChangePb) GetChangeSequence() uint64

func (*ChangePb) GetCommitIndex

func (m *ChangePb) GetCommitIndex() uint32

func (*ChangePb) GetCommitSequence

func (m *ChangePb) GetCommitSequence() uint64

func (*ChangePb) GetNewColumns

func (m *ChangePb) GetNewColumns() []*ColumnPb

func (*ChangePb) GetOldColumns

func (m *ChangePb) GetOldColumns() []*ColumnPb

func (*ChangePb) GetOperation

func (m *ChangePb) GetOperation() int32

func (*ChangePb) GetSequence

func (m *ChangePb) GetSequence() string

func (*ChangePb) GetTable

func (m *ChangePb) GetTable() string

func (*ChangePb) GetTimestamp

func (m *ChangePb) GetTimestamp() int64

func (*ChangePb) GetTransactionID

func (m *ChangePb) GetTransactionID() uint32

func (*ChangePb) GetTransactionIDEpoch

func (m *ChangePb) GetTransactionIDEpoch() uint64

func (*ChangePb) ProtoMessage

func (*ChangePb) ProtoMessage()

func (*ChangePb) Reset

func (m *ChangePb) Reset()

func (*ChangePb) String

func (m *ChangePb) String() string

type ColumnInfo

type ColumnInfo struct {
	Name string
	Type int32
}

ColumnInfo contains information about a column -- its name and Postgres data type.

type ColumnPb

type ColumnPb struct {
	Name             *string  `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Value            *ValuePb `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	Type             *int32   `protobuf:"varint,3,opt,name=type" json:"type,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*ColumnPb) Descriptor

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

func (*ColumnPb) GetName

func (m *ColumnPb) GetName() string

func (*ColumnPb) GetType

func (m *ColumnPb) GetType() int32

func (*ColumnPb) GetValue

func (m *ColumnPb) GetValue() *ValuePb

func (*ColumnPb) ProtoMessage

func (*ColumnPb) ProtoMessage()

func (*ColumnPb) Reset

func (m *ColumnPb) Reset()

func (*ColumnPb) String

func (m *ColumnPb) String() string

type ColumnVal

type ColumnVal struct {
	// Column value, in the string format that comes straight from Postgres
	Value interface{} `json:"value"`
	// The Postgres type of the column, as defined in the Postgres source
	Type int32 `json:"type"`
}

A ColumnVal is a single column value in a result. It just contains a value and a type.

func (ColumnVal) Get

func (v ColumnVal) Get(d interface{}) error

Get places the value of the column into the specified interface if possible. "d" must be set to one of: * *string * *[]byte * *int16, *int32, *int64, *uint16, *uint32, *uint64 * *float64, *float32 * *bool * * If the conversion is not possible, then an error will be returned.

func (ColumnVal) String

func (v ColumnVal) String() string

String converts the value of the column into a string. Binary data will be encoded using base64.

type Operation

type Operation int

Operation lists the types of operations on each row in a change list.

const (
	Insert Operation = 1
	Update Operation = 2
	Delete Operation = 3
)

Operation constants. (Not using "iota" here because these IDs are persisted.)

func (Operation) String

func (i Operation) String() string

type Row

type Row map[string]*ColumnVal

A Row is a single row in a table. It may be aggregated into an entire set of rows for a snapshot of a table, or into a list of row operations in a change list. The key for each property in the row is the name of the field, and the value is a ColumnVal that includes both the value and type.

func (Row) Get

func (r Row) Get(name string, d interface{}) error

Get retrieves the value of the specified type just like "get", but it sets the target to the empty value if the column is not present.

type RowPb

type RowPb struct {
	Values           []*ValuePb `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

func (*RowPb) Descriptor

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

func (*RowPb) GetValues

func (m *RowPb) GetValues() []*ValuePb

func (*RowPb) ProtoMessage

func (*RowPb) ProtoMessage()

func (*RowPb) Reset

func (m *RowPb) Reset()

func (*RowPb) String

func (m *RowPb) String() string

type Sequence

type Sequence struct {
	LSN   uint64
	Index uint32
}

A Sequence represents a unique position in the list of changes. It consists of a postgres LSN that represents when a transaction was committed, and a index into the list of changes in that transaction.

func MakeSequence

func MakeSequence(lsn uint64, index uint32) Sequence

MakeSequence makes a new sequence from an LSN and an index.

func ParseSequence

func ParseSequence(s string) (Sequence, error)

ParseSequence parses a stringified sequence.

func ParseSequenceBytes

func ParseSequenceBytes(b []byte) (Sequence, error)

ParseSequenceBytes parses bytes written using Bytes(). As a convenience, an empty sequence parses to the default value for the Sequence type.

func (Sequence) Bytes

func (s Sequence) Bytes() []byte

Bytes turns the sequence into an array of 12 bytes, in "network" (aka big-endian) byte order.

func (Sequence) Compare

func (s Sequence) Compare(o Sequence) int

Compare returns if the current sequence is less than, greater to, or equal to the specified sequence.

func (Sequence) String

func (s Sequence) String() string

String turns the sequence into the canonical string form, which looks like this: "XXX.YYY.ZZZ," where each component is a hexadecimal number. This is different from the standard Postgres format, which includes a slash in the first part, in that it doesn't need URL encoding.

type Snapshot

type Snapshot struct {
	// SnapshotInfo represents a Postgres transaction snapshot, in the format
	// "xmin:xmax:xip1,xip2,xip3..."
	SnapshotInfo string `json:"snapshotInfo"`
	// Timestamp is a Postgres timestamp that describes when the snapshot was created
	Timestamp string `json:"timestamp"`
	// The tables in the snapshot
	Tables []Table `json:"tables"`
}

A Snapshot represents a consistent view of a group of tables, all generated at a consistent point.

func UnmarshalSnapshot

func UnmarshalSnapshot(data []byte) (*Snapshot, error)

UnmarshalSnapshot turns a set of JSON into an entire snapshot.

func UnmarshalSnapshotProto

func UnmarshalSnapshotProto(r io.Reader) (*Snapshot, error)

UnmarshalSnapshotProto unmarshals a snapshot that was written using the Streaming snapshot interface in protobuf format into a single object. This method should not be used for a very large snapshot because it will result in the entire snapshot contents being read into memory. For flexibility, this reads from a Reader so that there is no need to make extra copies.

func (*Snapshot) AddTables

func (s *Snapshot) AddTables(tb Table) []Table

AddTables is a helper function that inserts Tables in to a existing Snapshot

func (*Snapshot) Marshal

func (s *Snapshot) Marshal() []byte

Marshal turns a snapshot into formatted, indented JSON. It will panic on a marshaling error.

func (*Snapshot) MarshalProto

func (s *Snapshot) MarshalProto(w io.Writer) error

MarshalProto uses the streaming replication option to write out an existing Snapshot as a protocol buffer. It should not be used for large snapshots because it will result in the entire snapshot being written into memory. It returns an error if there is an error writing to the actual Writer.

type SnapshotHeaderPb

type SnapshotHeaderPb struct {
	Timestamp        *string `protobuf:"bytes,1,req,name=timestamp" json:"timestamp,omitempty"`
	Snapshot         *string `protobuf:"bytes,2,req,name=snapshot" json:"snapshot,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*SnapshotHeaderPb) Descriptor

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

func (*SnapshotHeaderPb) GetSnapshot

func (m *SnapshotHeaderPb) GetSnapshot() string

func (*SnapshotHeaderPb) GetTimestamp

func (m *SnapshotHeaderPb) GetTimestamp() string

func (*SnapshotHeaderPb) ProtoMessage

func (*SnapshotHeaderPb) ProtoMessage()

func (*SnapshotHeaderPb) Reset

func (m *SnapshotHeaderPb) Reset()

func (*SnapshotHeaderPb) String

func (m *SnapshotHeaderPb) String() string

type SnapshotReader

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

A SnapshotReader reads a snapshot produced by a SnapshotWriter. The snapshot is read one table and one row at a time by calling "Next()".

func CreateSnapshotReader

func CreateSnapshotReader(r io.Reader) (*SnapshotReader, error)

CreateSnapshotReader creates a reader.

func (*SnapshotReader) Entry

func (r *SnapshotReader) Entry() interface{}

Entry returns the current entry. It can be one of three things: 1) A TableInfo, which tells us to start writing to a new table, or 2) a Row, which denotes what you think it does. 3) an error, which indicates that we got incomplete data. It is an error to call this function if "Next" was never called. It is also an error to call this function once "Next" returned false. Finally, it is an error to continue processing after this function has returned an error.

func (*SnapshotReader) Next

func (r *SnapshotReader) Next() bool

Next positions the snapshot reader on the next record. To read the snapshot, a reader must first call "Next," then call "Entry" to get the entry for processing. The reader should continue this process until Next returns "false."

func (*SnapshotReader) SnapshotInfo

func (r *SnapshotReader) SnapshotInfo() string

SnapshotInfo returns the information from "txid_current_snapshot()".

func (*SnapshotReader) Timestamp

func (r *SnapshotReader) Timestamp() string

Timestamp returns the time (in postgres "now()") format when the snapshot was created.

type SnapshotWriter

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

A SnapshotWriter allows a snapshot to be constructed by writing to it one row and one table at a time. It contains some sanity checks to make sure that the writer uses it appropriately but in general it's important to be careful.

func CreateSnapshotWriter

func CreateSnapshotWriter(timestamp, snapshotInfo string,
	writer io.Writer) (*SnapshotWriter, error)

CreateSnapshotWriter creates a new SnapshotWriter, with the specified Postgres timestap (from "now()") and snapshot specification (from "txid_current_snapshot()").

func (*SnapshotWriter) EndTable

func (w *SnapshotWriter) EndTable() error

EndTable ends data for the current table. It is an error to end the table when StartTable was not called.

func (*SnapshotWriter) StartTable

func (w *SnapshotWriter) StartTable(tableName string, cols []ColumnInfo) error

StartTable tells the reader that it's time to start work on a new table. It is an error to start a table when a previous table has not been ended.

func (*SnapshotWriter) WriteRow

func (w *SnapshotWriter) WriteRow(columnValues []interface{}) error

WriteRow writes the values of a single column. It is an error to call this if StartTable was not called. It is also an error if the length of "columnValues" does not match the list of names passed to "StartTable." Values must be primitive types: * integer types * float types * bool * string * []byte

type StreamMessagePb

type StreamMessagePb struct {
	// Types that are valid to be assigned to Message:
	//	*StreamMessagePb_Table
	//	*StreamMessagePb_Row
	Message          isStreamMessagePb_Message `protobuf_oneof:"message"`
	XXX_unrecognized []byte                    `json:"-"`
}

func (*StreamMessagePb) Descriptor

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

func (*StreamMessagePb) GetMessage

func (m *StreamMessagePb) GetMessage() isStreamMessagePb_Message

func (*StreamMessagePb) GetRow

func (m *StreamMessagePb) GetRow() *RowPb

func (*StreamMessagePb) GetTable

func (m *StreamMessagePb) GetTable() *TableHeaderPb

func (*StreamMessagePb) ProtoMessage

func (*StreamMessagePb) ProtoMessage()

func (*StreamMessagePb) Reset

func (m *StreamMessagePb) Reset()

func (*StreamMessagePb) String

func (m *StreamMessagePb) String() string

func (*StreamMessagePb) XXX_OneofFuncs

func (*StreamMessagePb) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type StreamMessagePb_Row

type StreamMessagePb_Row struct {
	Row *RowPb `protobuf:"bytes,2,opt,name=row,oneof"`
}

type StreamMessagePb_Table

type StreamMessagePb_Table struct {
	Table *TableHeaderPb `protobuf:"bytes,1,opt,name=table,oneof"`
}

type Table

type Table struct {
	Name string `json:"name"`
	Rows []Row  `json:"rows"`
}

A Table represents a snapshot of a table at a particular point in time.

func (*Table) AddRowstoTable

func (t *Table) AddRowstoTable(rv Row) []Row

AddRowstoTable is a helper function that inserts rows to an existing table

type TableHeaderPb

type TableHeaderPb struct {
	Name             *string     `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Columns          []*ColumnPb `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

func (*TableHeaderPb) Descriptor

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

func (*TableHeaderPb) GetColumns

func (m *TableHeaderPb) GetColumns() []*ColumnPb

func (*TableHeaderPb) GetName

func (m *TableHeaderPb) GetName() string

func (*TableHeaderPb) ProtoMessage

func (*TableHeaderPb) ProtoMessage()

func (*TableHeaderPb) Reset

func (m *TableHeaderPb) Reset()

func (*TableHeaderPb) String

func (m *TableHeaderPb) String() string

type TableInfo

type TableInfo struct {
	Name    string
	Columns []ColumnInfo
}

A TableInfo is returned when we are reading a snapshot stream. It indicates that subsequent Rows returned will affect the specified table.

type ValuePb

type ValuePb struct {
	// Types that are valid to be assigned to Value:
	//	*ValuePb_String_
	//	*ValuePb_Int
	//	*ValuePb_Uint
	//	*ValuePb_Double
	//	*ValuePb_Bytes
	//	*ValuePb_Bool
	//	*ValuePb_Timestamp
	Value            isValuePb_Value `protobuf_oneof:"value"`
	XXX_unrecognized []byte          `json:"-"`
}

func (*ValuePb) Descriptor

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

func (*ValuePb) GetBool

func (m *ValuePb) GetBool() bool

func (*ValuePb) GetBytes

func (m *ValuePb) GetBytes() []byte

func (*ValuePb) GetDouble

func (m *ValuePb) GetDouble() float64

func (*ValuePb) GetInt

func (m *ValuePb) GetInt() int64

func (*ValuePb) GetString_

func (m *ValuePb) GetString_() string

func (*ValuePb) GetTimestamp

func (m *ValuePb) GetTimestamp() int64

func (*ValuePb) GetUint

func (m *ValuePb) GetUint() uint64

func (*ValuePb) GetValue

func (m *ValuePb) GetValue() isValuePb_Value

func (*ValuePb) ProtoMessage

func (*ValuePb) ProtoMessage()

func (*ValuePb) Reset

func (m *ValuePb) Reset()

func (*ValuePb) String

func (m *ValuePb) String() string

func (*ValuePb) XXX_OneofFuncs

func (*ValuePb) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type ValuePb_Bool

type ValuePb_Bool struct {
	Bool bool `protobuf:"varint,6,opt,name=bool,oneof"`
}

type ValuePb_Bytes

type ValuePb_Bytes struct {
	Bytes []byte `protobuf:"bytes,5,opt,name=bytes,oneof"`
}

type ValuePb_Double

type ValuePb_Double struct {
	Double float64 `protobuf:"fixed64,4,opt,name=double,oneof"`
}

type ValuePb_Int

type ValuePb_Int struct {
	Int int64 `protobuf:"varint,2,opt,name=int,oneof"`
}

type ValuePb_String_

type ValuePb_String_ struct {
	String_ string `protobuf:"bytes,1,opt,name=string,oneof"`
}

type ValuePb_Timestamp

type ValuePb_Timestamp struct {
	Timestamp int64 `protobuf:"varint,7,opt,name=timestamp,oneof"`
}

type ValuePb_Uint

type ValuePb_Uint struct {
	Uint uint64 `protobuf:"varint,3,opt,name=uint,oneof"`
}

Jump to

Keyboard shortcuts

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