pub

package
v1.1.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Count_Kind_name = map[int32]string{
	0: "UNAVAILABLE",
	1: "ESTIMATE",
	2: "EXACT",
}
View Source
var Count_Kind_value = map[string]int32{
	"UNAVAILABLE": 0,
	"ESTIMATE":    1,
	"EXACT":       2,
}
View Source
var DiscoverShapesRequest_Mode_name = map[int32]string{
	0: "ALL",
	1: "REFRESH",
}
View Source
var DiscoverShapesRequest_Mode_value = map[string]int32{
	"ALL":     0,
	"REFRESH": 1,
}
View Source
var PropertyType_name = map[int32]string{
	0:  "STRING",
	2:  "BOOL",
	3:  "INTEGER",
	4:  "FLOAT",
	5:  "DECIMAL",
	6:  "DATE",
	7:  "TIME",
	8:  "DATETIME",
	9:  "TEXT",
	10: "BLOB",
	11: "JSON",
	12: "XML",
}
View Source
var PropertyType_value = map[string]int32{
	"STRING":   0,
	"BOOL":     2,
	"INTEGER":  3,
	"FLOAT":    4,
	"DECIMAL":  5,
	"DATE":     6,
	"TIME":     7,
	"DATETIME": 8,
	"TEXT":     9,
	"BLOB":     10,
	"JSON":     11,
	"XML":      12,
}
View Source
var PublishFilter_Kind_name = map[int32]string{
	0: "EQUALS",
	1: "LESS_THAN",
	2: "GREATER_THAN",
}
View Source
var PublishFilter_Kind_value = map[string]int32{
	"EQUALS":       0,
	"LESS_THAN":    1,
	"GREATER_THAN": 2,
}
View Source
var Record_Action_name = map[int32]string{
	0: "UPSERT",
	1: "INSERT",
	2: "UPDATE",
	3: "DELETE",
}
View Source
var Record_Action_value = map[string]int32{
	"UPSERT": 0,
	"INSERT": 1,
	"UPDATE": 2,
	"DELETE": 3,
}

Functions

func AdaptHCLog

func AdaptHCLog(log *logrus.Entry) hclog.Logger

func NewClientPlugin

func NewClientPlugin(log *logrus.Entry) plugin.Plugin

NewClientPlugin returns a plugin.Plugin for use as a client. This is the method to call from the host when creating a new plugin.ClientConfig.

func NewServerPlugin

func NewServerPlugin(handler PublisherServer) plugin.Plugin

NewServerPlugin returns a plugin.Plugin for use as a server. This is the method to call from the plugin implementation when creating a new plugin.ServeConfig.

func RegisterPublisherServer

func RegisterPublisherServer(s *grpc.Server, srv PublisherServer)

Types

type ConnectRequest

type ConnectRequest struct {
	// The settings the publisher should use to connect, as a JSON string.
	// The JSON will be based on the JSONSchema defined in the publisher's package.json.
	SettingsJson         string   `protobuf:"bytes,2,opt,name=settings_json,json=settingsJson,proto3" json:"settings_json,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewConnectRequest

func NewConnectRequest(settings interface{}) *ConnectRequest

func (*ConnectRequest) Descriptor

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

func (*ConnectRequest) GetSettingsJson

func (m *ConnectRequest) GetSettingsJson() string

func (*ConnectRequest) ProtoMessage

func (*ConnectRequest) ProtoMessage()

func (*ConnectRequest) Reset

func (m *ConnectRequest) Reset()

func (*ConnectRequest) String

func (m *ConnectRequest) String() string

func (*ConnectRequest) XXX_DiscardUnknown

func (m *ConnectRequest) XXX_DiscardUnknown()

func (*ConnectRequest) XXX_Marshal

func (m *ConnectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConnectRequest) XXX_Merge

func (dst *ConnectRequest) XXX_Merge(src proto.Message)

func (*ConnectRequest) XXX_Size

func (m *ConnectRequest) XXX_Size() int

func (*ConnectRequest) XXX_Unmarshal

func (m *ConnectRequest) XXX_Unmarshal(b []byte) error

type ConnectResponse

type ConnectResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ConnectResponse has no data; if the connect fails, the plugin should return an error.

func (*ConnectResponse) Descriptor

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

func (*ConnectResponse) ProtoMessage

func (*ConnectResponse) ProtoMessage()

func (*ConnectResponse) Reset

func (m *ConnectResponse) Reset()

func (*ConnectResponse) String

func (m *ConnectResponse) String() string

func (*ConnectResponse) XXX_DiscardUnknown

func (m *ConnectResponse) XXX_DiscardUnknown()

func (*ConnectResponse) XXX_Marshal

func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConnectResponse) XXX_Merge

func (dst *ConnectResponse) XXX_Merge(src proto.Message)

func (*ConnectResponse) XXX_Size

func (m *ConnectResponse) XXX_Size() int

func (*ConnectResponse) XXX_Unmarshal

func (m *ConnectResponse) XXX_Unmarshal(b []byte) error

type Count

type Count struct {
	Kind                 Count_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=pub.Count_Kind" json:"kind,omitempty"`
	Value                int32      `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Count) Descriptor

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

func (*Count) Format

func (c *Count) Format() string

func (*Count) GetKind

func (m *Count) GetKind() Count_Kind

func (*Count) GetValue

func (m *Count) GetValue() int32

func (*Count) ProtoMessage

func (*Count) ProtoMessage()

func (*Count) Reset

func (m *Count) Reset()

func (*Count) String

func (m *Count) String() string

func (*Count) XXX_DiscardUnknown

func (m *Count) XXX_DiscardUnknown()

func (*Count) XXX_Marshal

func (m *Count) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Count) XXX_Merge

func (dst *Count) XXX_Merge(src proto.Message)

func (*Count) XXX_Size

func (m *Count) XXX_Size() int

func (*Count) XXX_Unmarshal

func (m *Count) XXX_Unmarshal(b []byte) error

type Count_Kind

type Count_Kind int32
const (
	Count_UNAVAILABLE Count_Kind = 0
	Count_ESTIMATE    Count_Kind = 1
	Count_EXACT       Count_Kind = 2
)

func (Count_Kind) EnumDescriptor

func (Count_Kind) EnumDescriptor() ([]byte, []int)

func (Count_Kind) String

func (x Count_Kind) String() string

type DisconnectRequest

type DisconnectRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DisconnectRequest) Descriptor

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

func (*DisconnectRequest) ProtoMessage

func (*DisconnectRequest) ProtoMessage()

func (*DisconnectRequest) Reset

func (m *DisconnectRequest) Reset()

func (*DisconnectRequest) String

func (m *DisconnectRequest) String() string

func (*DisconnectRequest) XXX_DiscardUnknown

func (m *DisconnectRequest) XXX_DiscardUnknown()

func (*DisconnectRequest) XXX_Marshal

func (m *DisconnectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DisconnectRequest) XXX_Merge

func (dst *DisconnectRequest) XXX_Merge(src proto.Message)

func (*DisconnectRequest) XXX_Size

func (m *DisconnectRequest) XXX_Size() int

func (*DisconnectRequest) XXX_Unmarshal

func (m *DisconnectRequest) XXX_Unmarshal(b []byte) error

type DisconnectResponse

type DisconnectResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DisconnectResponse) Descriptor

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

func (*DisconnectResponse) ProtoMessage

func (*DisconnectResponse) ProtoMessage()

func (*DisconnectResponse) Reset

func (m *DisconnectResponse) Reset()

func (*DisconnectResponse) String

func (m *DisconnectResponse) String() string

func (*DisconnectResponse) XXX_DiscardUnknown

func (m *DisconnectResponse) XXX_DiscardUnknown()

func (*DisconnectResponse) XXX_Marshal

func (m *DisconnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DisconnectResponse) XXX_Merge

func (dst *DisconnectResponse) XXX_Merge(src proto.Message)

func (*DisconnectResponse) XXX_Size

func (m *DisconnectResponse) XXX_Size() int

func (*DisconnectResponse) XXX_Unmarshal

func (m *DisconnectResponse) XXX_Unmarshal(b []byte) error

type DiscoverShapesRequest

type DiscoverShapesRequest struct {
	// Mode is the discovery mode.
	Mode DiscoverShapesRequest_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=pub.DiscoverShapesRequest_Mode" json:"mode,omitempty"`
	// The shapes to refresh if mode == 1.
	ToRefresh []*Shape `protobuf:"bytes,2,rep,name=to_refresh,json=toRefresh,proto3" json:"to_refresh,omitempty"`
	// Size of the sample of records to include in the returned shapes.
	SampleSize           uint32   `protobuf:"varint,4,opt,name=sample_size,json=sampleSize,proto3" json:"sample_size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DiscoverShapesRequest) Descriptor

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

func (*DiscoverShapesRequest) GetMode

func (*DiscoverShapesRequest) GetSampleSize

func (m *DiscoverShapesRequest) GetSampleSize() uint32

func (*DiscoverShapesRequest) GetToRefresh

func (m *DiscoverShapesRequest) GetToRefresh() []*Shape

func (*DiscoverShapesRequest) ProtoMessage

func (*DiscoverShapesRequest) ProtoMessage()

func (*DiscoverShapesRequest) Reset

func (m *DiscoverShapesRequest) Reset()

func (*DiscoverShapesRequest) String

func (m *DiscoverShapesRequest) String() string

func (*DiscoverShapesRequest) XXX_DiscardUnknown

func (m *DiscoverShapesRequest) XXX_DiscardUnknown()

func (*DiscoverShapesRequest) XXX_Marshal

func (m *DiscoverShapesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DiscoverShapesRequest) XXX_Merge

func (dst *DiscoverShapesRequest) XXX_Merge(src proto.Message)

func (*DiscoverShapesRequest) XXX_Size

func (m *DiscoverShapesRequest) XXX_Size() int

func (*DiscoverShapesRequest) XXX_Unmarshal

func (m *DiscoverShapesRequest) XXX_Unmarshal(b []byte) error

type DiscoverShapesRequest_Mode

type DiscoverShapesRequest_Mode int32
const (
	// ALL means all shapes the publisher can publish should be returned.
	DiscoverShapesRequest_ALL DiscoverShapesRequest_Mode = 0
	// REFRESH means the publisher return (updated) shapes identified by the partial shapes included in to_refresh.
	DiscoverShapesRequest_REFRESH DiscoverShapesRequest_Mode = 1
)

func (DiscoverShapesRequest_Mode) EnumDescriptor

func (DiscoverShapesRequest_Mode) EnumDescriptor() ([]byte, []int)

func (DiscoverShapesRequest_Mode) String

type DiscoverShapesResponse

type DiscoverShapesResponse struct {
	// Shapes discovered by the publisher.
	Shapes               []*Shape `protobuf:"bytes,1,rep,name=shapes,proto3" json:"shapes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DiscoverShapesResponse) Descriptor

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

func (*DiscoverShapesResponse) GetShapes

func (m *DiscoverShapesResponse) GetShapes() []*Shape

func (*DiscoverShapesResponse) ProtoMessage

func (*DiscoverShapesResponse) ProtoMessage()

func (*DiscoverShapesResponse) Reset

func (m *DiscoverShapesResponse) Reset()

func (*DiscoverShapesResponse) String

func (m *DiscoverShapesResponse) String() string

func (*DiscoverShapesResponse) XXX_DiscardUnknown

func (m *DiscoverShapesResponse) XXX_DiscardUnknown()

func (*DiscoverShapesResponse) XXX_Marshal

func (m *DiscoverShapesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DiscoverShapesResponse) XXX_Merge

func (dst *DiscoverShapesResponse) XXX_Merge(src proto.Message)

func (*DiscoverShapesResponse) XXX_Size

func (m *DiscoverShapesResponse) XXX_Size() int

func (*DiscoverShapesResponse) XXX_Unmarshal

func (m *DiscoverShapesResponse) XXX_Unmarshal(b []byte) error

type Property

type Property struct {
	// ID is the permanent, unique identifier for this property.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name is an optional display name for the property.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description of this property, if available.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Type of the property. Use STRING if no other type matches.
	Type PropertyType `protobuf:"varint,4,opt,name=type,proto3,enum=pub.PropertyType" json:"type,omitempty"`
	// Set to true if this property is part of the primary key for this shape.
	IsKey bool `protobuf:"varint,5,opt,name=is_key,json=isKey,proto3" json:"is_key,omitempty"`
	// Set to true if this property is an orderable value which can be used
	// to determine if one record was created more recently than another record.
	// For example, a CreatedAt datetime column or an auto-incrementing integer primary key.
	IsCreateCounter bool `protobuf:"varint,6,opt,name=is_create_counter,json=isCreateCounter,proto3" json:"is_create_counter,omitempty"`
	// Set to true if this property is an orderable value which can be used
	// to determine if one record was updated more recently than another record.
	// For example, an UpdatedAt datetime column.
	IsUpdateCounter bool `protobuf:"varint,7,opt,name=is_update_counter,json=isUpdateCounter,proto3" json:"is_update_counter,omitempty"`
	// Arbitrary JSON blob containing information the publisher uses for things like change detection.
	PublisherMetaJson string `protobuf:"bytes,8,opt,name=publisher_meta_json,json=publisherMetaJson,proto3" json:"publisher_meta_json,omitempty"`
	// The type of the property as defined in the source system. Used to provide
	// human-readable hints when building mappings.
	TypeAtSource string `protobuf:"bytes,9,opt,name=type_at_source,json=typeAtSource,proto3" json:"type_at_source,omitempty"`
	// Indicates that this property is nullable.
	IsNullable           bool     `protobuf:"varint,10,opt,name=is_nullable,json=isNullable,proto3" json:"is_nullable,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Property) Descriptor

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

func (*Property) GetDescription

func (m *Property) GetDescription() string

func (*Property) GetId

func (m *Property) GetId() string

func (*Property) GetIsCreateCounter

func (m *Property) GetIsCreateCounter() bool

func (*Property) GetIsKey

func (m *Property) GetIsKey() bool

func (*Property) GetIsNullable

func (m *Property) GetIsNullable() bool

func (*Property) GetIsUpdateCounter

func (m *Property) GetIsUpdateCounter() bool

func (*Property) GetName

func (m *Property) GetName() string

func (*Property) GetPublisherMetaJson

func (m *Property) GetPublisherMetaJson() string

func (*Property) GetType

func (m *Property) GetType() PropertyType

func (*Property) GetTypeAtSource

func (m *Property) GetTypeAtSource() string

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) Reset

func (m *Property) Reset()

func (*Property) String

func (m *Property) String() string

func (*Property) XXX_DiscardUnknown

func (m *Property) XXX_DiscardUnknown()

func (*Property) XXX_Marshal

func (m *Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Property) XXX_Merge

func (dst *Property) XXX_Merge(src proto.Message)

func (*Property) XXX_Size

func (m *Property) XXX_Size() int

func (*Property) XXX_Unmarshal

func (m *Property) XXX_Unmarshal(b []byte) error

type PropertyMetadata

type PropertyMetadata struct {
}

type PropertyType

type PropertyType int32
const (
	// Unicode string, less than 1024 characters.
	PropertyType_STRING PropertyType = 0
	// true/false.
	PropertyType_BOOL PropertyType = 2
	// 64-bit integer.
	PropertyType_INTEGER PropertyType = 3
	// 64-bit floating point number.
	PropertyType_FLOAT PropertyType = 4
	// Absolute precision number of any size.
	PropertyType_DECIMAL PropertyType = 5
	// Date (no time).
	PropertyType_DATE PropertyType = 6
	// Time (no date).
	PropertyType_TIME PropertyType = 7
	// Datetime (date and time).
	PropertyType_DATETIME PropertyType = 8
	// Unicode string, more than 1024 characters.
	PropertyType_TEXT PropertyType = 9
	// Binary data as a base-64 encoded string.
	PropertyType_BLOB PropertyType = 10
	// A JSON object as a string.
	PropertyType_JSON PropertyType = 11
	// An XML object as a string.
	PropertyType_XML PropertyType = 12
)

func (PropertyType) EnumDescriptor

func (PropertyType) EnumDescriptor() ([]byte, []int)

func (PropertyType) String

func (x PropertyType) String() string

type PublishFilter

type PublishFilter struct {
	// Kind of the match.
	Kind PublishFilter_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=pub.PublishFilter_Kind" json:"kind,omitempty"`
	// The id of the property on each record which should be matched against the value.
	PropertyId string `protobuf:"bytes,2,opt,name=property_id,json=propertyId,proto3" json:"property_id,omitempty"`
	// The value of the which should be matched against the named property for each record, as a string.
	// The publisher is responsible for converting the value to the correct type.
	Value                string   `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PublishFilter) Descriptor

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

func (*PublishFilter) GetKind

func (m *PublishFilter) GetKind() PublishFilter_Kind

func (*PublishFilter) GetPropertyId

func (m *PublishFilter) GetPropertyId() string

func (*PublishFilter) GetValue

func (m *PublishFilter) GetValue() string

func (*PublishFilter) ProtoMessage

func (*PublishFilter) ProtoMessage()

func (*PublishFilter) Reset

func (m *PublishFilter) Reset()

func (*PublishFilter) String

func (m *PublishFilter) String() string

func (*PublishFilter) XXX_DiscardUnknown

func (m *PublishFilter) XXX_DiscardUnknown()

func (*PublishFilter) XXX_Marshal

func (m *PublishFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishFilter) XXX_Merge

func (dst *PublishFilter) XXX_Merge(src proto.Message)

func (*PublishFilter) XXX_Size

func (m *PublishFilter) XXX_Size() int

func (*PublishFilter) XXX_Unmarshal

func (m *PublishFilter) XXX_Unmarshal(b []byte) error

type PublishFilter_Kind

type PublishFilter_Kind int32
const (
	// The property on the record must equal the filter value.
	PublishFilter_EQUALS PublishFilter_Kind = 0
	// The property on the record must be less than the filter value.
	PublishFilter_LESS_THAN PublishFilter_Kind = 1
	// The property on the record must be greater than the filter value.
	PublishFilter_GREATER_THAN PublishFilter_Kind = 2
)

func (PublishFilter_Kind) EnumDescriptor

func (PublishFilter_Kind) EnumDescriptor() ([]byte, []int)

func (PublishFilter_Kind) String

func (x PublishFilter_Kind) String() string

type PublishRequest

type PublishRequest struct {
	// The shape of the records to publish.
	Shape *Shape `protobuf:"bytes,1,opt,name=shape,proto3" json:"shape,omitempty"`
	// Limit of number of records to return.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// Zero or more filters which should be applied to the returned records.
	Filters              []*PublishFilter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*PublishRequest) Descriptor

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

func (*PublishRequest) GetFilters

func (m *PublishRequest) GetFilters() []*PublishFilter

func (*PublishRequest) GetLimit

func (m *PublishRequest) GetLimit() uint32

func (*PublishRequest) GetShape

func (m *PublishRequest) GetShape() *Shape

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) Reset

func (m *PublishRequest) Reset()

func (*PublishRequest) String

func (m *PublishRequest) String() string

func (*PublishRequest) XXX_DiscardUnknown

func (m *PublishRequest) XXX_DiscardUnknown()

func (*PublishRequest) XXX_Marshal

func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PublishRequest) XXX_Merge

func (dst *PublishRequest) XXX_Merge(src proto.Message)

func (*PublishRequest) XXX_Size

func (m *PublishRequest) XXX_Size() int

func (*PublishRequest) XXX_Unmarshal

func (m *PublishRequest) XXX_Unmarshal(b []byte) error

type PublisherClient

type PublisherClient interface {
	// Instructs the publisher to connect to its data source.
	Connect(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (*ConnectResponse, error)
	// Requests a listing of shapes this publisher can provide records for.
	DiscoverShapes(ctx context.Context, in *DiscoverShapesRequest, opts ...grpc.CallOption) (*DiscoverShapesResponse, error)
	// PublishString begins streaming records to the client from the plugin.
	PublishStream(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (Publisher_PublishStreamClient, error)
	// Tells the publisher to disconnect from its data source, stop any running publishes,
	// and gracefully prepare to be shut down.
	Disconnect(ctx context.Context, in *DisconnectRequest, opts ...grpc.CallOption) (*DisconnectResponse, error)
}

PublisherClient is the client API for Publisher service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPublisherClient

func NewPublisherClient(cc *grpc.ClientConn) PublisherClient

type PublisherServer

type PublisherServer interface {
	// Instructs the publisher to connect to its data source.
	Connect(context.Context, *ConnectRequest) (*ConnectResponse, error)
	// Requests a listing of shapes this publisher can provide records for.
	DiscoverShapes(context.Context, *DiscoverShapesRequest) (*DiscoverShapesResponse, error)
	// PublishString begins streaming records to the client from the plugin.
	PublishStream(*PublishRequest, Publisher_PublishStreamServer) error
	// Tells the publisher to disconnect from its data source, stop any running publishes,
	// and gracefully prepare to be shut down.
	Disconnect(context.Context, *DisconnectRequest) (*DisconnectResponse, error)
}

PublisherServer is the server API for Publisher service.

type Publisher_PublishStreamClient

type Publisher_PublishStreamClient interface {
	Recv() (*Record, error)
	grpc.ClientStream
}

type Publisher_PublishStreamServer

type Publisher_PublishStreamServer interface {
	Send(*Record) error
	grpc.ServerStream
}

type Record

type Record struct {
	// Action for this record. Default value is UPSERT if the plugin
	// cannot determine what the action should be relative to data alreay acquired.
	Action Record_Action `protobuf:"varint,1,opt,name=action,proto3,enum=pub.Record_Action" json:"action,omitempty"`
	// Data for this record, as a JSON string.
	DataJson             string   `protobuf:"bytes,2,opt,name=data_json,json=dataJson,proto3" json:"data_json,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewRecord

func NewRecord(action Record_Action, data interface{}) (*Record, error)

func (*Record) Descriptor

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

func (*Record) GetAction

func (m *Record) GetAction() Record_Action

func (*Record) GetDataJson

func (m *Record) GetDataJson() string

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) String

func (m *Record) String() string

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Record) XXX_Merge

func (dst *Record) XXX_Merge(src proto.Message)

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

func (m *Record) XXX_Unmarshal(b []byte) error

type Record_Action

type Record_Action int32
const (
	Record_UPSERT Record_Action = 0
	Record_INSERT Record_Action = 1
	Record_UPDATE Record_Action = 2
	Record_DELETE Record_Action = 3
)

func (Record_Action) EnumDescriptor

func (Record_Action) EnumDescriptor() ([]byte, []int)

func (Record_Action) String

func (x Record_Action) String() string

type Shape

type Shape struct {
	// ID that the plugin uses to uniquely identify this shape.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name of this shape (must be a permanant identifier which is unique in this source).
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Description of this shape, if available.
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// Properties of this shape.
	Properties []*Property `protobuf:"bytes,4,rep,name=properties,proto3" json:"properties,omitempty"`
	// Count of records available in this shape.
	Count *Count `protobuf:"bytes,5,opt,name=count,proto3" json:"count,omitempty"`
	// Sample containing zero or more records representative of the data in this shape.
	Sample []*Record `protobuf:"bytes,6,rep,name=sample,proto3" json:"sample,omitempty"`
	// When returned from a publisher, the optional query which can be passed to the publisher to publish records from this shape.
	// When passed to the publisher, the query which should be used to publish records from this shape.
	Query string `protobuf:"bytes,7,opt,name=query,proto3" json:"query,omitempty"`
	// Arbitrary JSON blob containing information the publisher uses for things like change detection.
	PublisherMetaJson string `protobuf:"bytes,8,opt,name=publisher_meta_json,json=publisherMetaJson,proto3" json:"publisher_meta_json,omitempty"`
	// Errors that occurred while discovering this shape.
	Errors               []string `protobuf:"bytes,9,rep,name=errors,proto3" json:"errors,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Shape) Descriptor

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

func (*Shape) GetCount

func (m *Shape) GetCount() *Count

func (*Shape) GetDescription

func (m *Shape) GetDescription() string

func (*Shape) GetErrors

func (m *Shape) GetErrors() []string

func (*Shape) GetId

func (m *Shape) GetId() string

func (*Shape) GetName

func (m *Shape) GetName() string

func (*Shape) GetProperties

func (m *Shape) GetProperties() []*Property

func (*Shape) GetPublisherMetaJson

func (m *Shape) GetPublisherMetaJson() string

func (*Shape) GetQuery

func (m *Shape) GetQuery() string

func (*Shape) GetSample

func (m *Shape) GetSample() []*Record

func (*Shape) ProtoMessage

func (*Shape) ProtoMessage()

func (*Shape) Reset

func (m *Shape) Reset()

func (*Shape) String

func (m *Shape) String() string

func (*Shape) XXX_DiscardUnknown

func (m *Shape) XXX_DiscardUnknown()

func (*Shape) XXX_Marshal

func (m *Shape) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Shape) XXX_Merge

func (dst *Shape) XXX_Merge(src proto.Message)

func (*Shape) XXX_Size

func (m *Shape) XXX_Size() int

func (*Shape) XXX_Unmarshal

func (m *Shape) XXX_Unmarshal(b []byte) error

type ShapeMetadata

type ShapeMetadata struct {
}

type SortableProperties

type SortableProperties []*Property

func (SortableProperties) Len

func (s SortableProperties) Len() int

func (SortableProperties) Less

func (s SortableProperties) Less(i, j int) bool

func (SortableProperties) Swap

func (s SortableProperties) Swap(i, j int)

type SortableShapes

type SortableShapes []*Shape

func (SortableShapes) Len

func (s SortableShapes) Len() int

func (SortableShapes) Less

func (s SortableShapes) Less(i, j int) bool

func (SortableShapes) Swap

func (s SortableShapes) Swap(i, j int)

Jump to

Keyboard shortcuts

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