adapter

package
v0.0.0-...-3cc9250 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdapterManager = &adapterManager{
		adapters: make(map[string]func() Adapter),
	}
	ConnectionManager = &connectionManager{
		connections: make(map[string]*ConnectionInfo),
	}
)

Functions

func RegisterAdapter

func RegisterAdapter(name string, fn func() Adapter)

Types

type Adapter

type Adapter interface {
	LoadConfiguration(config map[string]string)
	GetSplits(connectionId string, query AdapterQuery) ([]Split, error)
	ReadSplit(Split, io.Writer) error
}

Adater implenets input and output to external systems

type AdapterFileSource

type AdapterFileSource interface {
	AdapterQuery
	AdapterName() string
}

type AdapterQuery

type AdapterQuery interface {
	GetParallelLimit() int
}

AdapterQuery is any object that can be serialized by gob

type ConnectionInfo

type ConnectionInfo struct {
	sync.RWMutex
	AdapterName string
	// contains filtered or unexported fields
}

func RegisterConnection

func RegisterConnection(id string, adapterName string) *ConnectionInfo

func (*ConnectionInfo) GetAdapter

func (ci *ConnectionInfo) GetAdapter() (Adapter, bool)

func (*ConnectionInfo) GetConfig

func (ci *ConnectionInfo) GetConfig() map[string]string

func (*ConnectionInfo) Set

func (ci *ConnectionInfo) Set(name, value string) *ConnectionInfo

type Split

type Split interface {
	GetConfiguration() map[string]string
}

ConnectorSplit should be serialized by gob

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳