Documentation ¶
Index ¶
- Constants
- func NewFactoryRegistry() (factory *factoryRegistry)
- type BaseProxy
- func (b BaseProxy) CollectAndSubscribe(topic string, from string, handler DataHandler) (CancelSubs, error)
- func (b BaseProxy) DeleteData(topic string, rowID string) error
- func (b BaseProxy) GetCheckpoint(checkpoint interface{}) error
- func (b BaseProxy) GetData(topic string, rowID string) (data []byte, err error)
- func (b BaseProxy) GetDataList(topic string, handler DataHandler) error
- func (b BaseProxy) GetDataListRange(topic string, from string, end string, handler DataHandler) error
- func (b BaseProxy) GetJob() job.Job
- func (b BaseProxy) GetObject(topic string, rowID string, ptr interface{}) error
- func (b BaseProxy) SubscribeTx(topic string, from string, handler DataHandler) (CancelSubs, error)
- type CancelSubs
- type CancelTxSubs
- type DataHandler
- type DataPath
- type Factory
- type Helper
- func (helper *Helper) Config() common.DaemonConfig
- func (helper *Helper) Debug(msg string, keyvals ...interface{})
- func (helper *Helper) DeleteData(topic string, rowID string) error
- func (helper *Helper) Error(msg string, keyvals ...interface{})
- func (helper *Helper) GetCheckpoint(checkpoint interface{}) error
- func (helper *Helper) GetData(topic string, rowID string) (data []byte, err error)
- func (helper *Helper) GetDataList(topic string, handler DataHandler) error
- func (helper *Helper) GetDataListRange(topic string, from string, end string, handler DataHandler) error
- func (helper *Helper) GetObject(topic string, rowID string, ptr interface{}) error
- func (helper *Helper) GetRepository() Repository
- func (helper *Helper) ID() string
- func (helper *Helper) Info(msg string, keyvals ...interface{})
- func (helper *Helper) Job() job.Job
- func (helper *Helper) NewWorkerProxy(jobID string) (Proxy, error)
- func (helper *Helper) PutCheckpoint(checkpoint interface{}) error
- func (helper *Helper) PutData(topic string, rowID string, data []byte) error
- func (helper *Helper) PutDataFullPath(fullPath string, data []byte) error
- func (helper *Helper) PutObject(topic string, rowID string, data interface{}) error
- func (helper *Helper) Space() string
- func (helper *Helper) SubscribeTx(topic string, from string, handler DataHandler) (CancelSubs, error)
- type Manager
- func (manager *Manager) ContainsWorker(id string) bool
- func (manager *Manager) GetRepository() Repository
- func (manager *Manager) GetWorker(id string) Worker
- func (manager *Manager) GetWorkerNames() []string
- func (manager *Manager) GetWorkers() []Worker
- func (manager *Manager) NewWorkerProxy(job job.Job) (proxy Proxy, err error)
- func (manager *Manager) RegisterWorkerFactory(factory Factory) error
- func (manager *Manager) SetJobs(jobs []job.Job)
- func (manager *Manager) Start()
- type Proxy
- type ProxyProvider
- type Repository
- type Worker
Constants ¶
View Source
const ( PathCheckpoint = "chkpnt" // PatternPathData : data/{jobID}/{topic} PatternPathJobTopicData = "%s/%s" )
View Source
const (
SpaceDefaultWorker = "daemon-data"
)
Variables ¶
This section is empty.
Functions ¶
func NewFactoryRegistry ¶
func NewFactoryRegistry() (factory *factoryRegistry)
NewAbstractWorkerFactory create AbstractWorkerFactory
Types ¶
type BaseProxy ¶ added in v0.0.2
type BaseProxy struct {
// contains filtered or unexported fields
}
func (BaseProxy) CollectAndSubscribe ¶ added in v0.0.2
func (b BaseProxy) CollectAndSubscribe(topic string, from string, handler DataHandler) (CancelSubs, error)
func (BaseProxy) DeleteData ¶ added in v0.0.2
func (BaseProxy) GetCheckpoint ¶ added in v0.0.2
func (BaseProxy) GetDataList ¶ added in v0.0.2
func (b BaseProxy) GetDataList(topic string, handler DataHandler) error
func (BaseProxy) GetDataListRange ¶ added in v0.0.2
func (BaseProxy) SubscribeTx ¶ added in v0.0.2
func (b BaseProxy) SubscribeTx(topic string, from string, handler DataHandler) (CancelSubs, error)
type CancelSubs ¶ added in v0.0.2
type CancelSubs func()
type CancelTxSubs ¶ added in v0.0.2
type CancelTxSubs struct {
// contains filtered or unexported fields
}
type DataHandler ¶
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper ..
func NewHelper ¶
func NewHelper(space string, config common.DaemonConfig, logger log.Logger, job job.Job, dao Repository, proxyProvider ProxyProvider) *Helper
NewHelper ..
func (*Helper) DeleteData ¶
DeleteData ..
func (*Helper) GetCheckpoint ¶
GetCheckpoint ..
func (*Helper) GetDataList ¶
func (helper *Helper) GetDataList(topic string, handler DataHandler) error
GetDataList ..
func (*Helper) GetDataListRange ¶ added in v0.0.2
func (helper *Helper) GetDataListRange(topic string, from string, end string, handler DataHandler) error
GetDataList ..
func (*Helper) GetRepository ¶
func (helper *Helper) GetRepository() Repository
Config get worker's Repository
func (*Helper) NewWorkerProxy ¶ added in v0.0.2
NewWorkerProxy ..
func (*Helper) PutCheckpoint ¶
PutCheckpoint ..
func (*Helper) PutDataFullPath ¶
PutDataFullPath ..
func (*Helper) SubscribeTx ¶ added in v0.0.2
func (helper *Helper) SubscribeTx(topic string, from string, handler DataHandler) (CancelSubs, error)
type Manager ¶
Manager manager for jobs
func NewManager ¶
func NewManager(context common.Context, spaceRegistry types.SpaceRegistry, proxyProvider ProxyProvider) *Manager
NewManager ..
func (*Manager) ContainsWorker ¶
ContainsWorker if worker id is registered.
func (*Manager) GetRepository ¶
func (manager *Manager) GetRepository() Repository
func (*Manager) GetWorkerNames ¶ added in v0.0.2
func (*Manager) GetWorkers ¶ added in v0.0.2
func (*Manager) NewWorkerProxy ¶ added in v0.0.2
func (*Manager) RegisterWorkerFactory ¶
type Proxy ¶ added in v0.0.2
type Proxy interface { GetJob() job.Job GetCheckpoint(checkpoint interface{}) error GetData(topic string, rowID string) (data []byte, err error) GetObject(topic string, rowID string, data interface{}) error GetDataList(topic string, handler DataHandler) error GetDataListRange(topic string, from string, end string, handler DataHandler) error DeleteData(topic string, rowID string) error SubscribeTx(topic string, from string, handler DataHandler) (CancelSubs, error) CollectAndSubscribe(topic string, from string, handler DataHandler) (CancelSubs, error) }
Proxy for worker
type ProxyProvider ¶ added in v0.0.2
type Repository ¶
type Repository interface { PutCheckpoint(jobID string, checkpoint interface{}) error GetCheckpoint(jobID string, checkpoint interface{}) error //CurrentBlockNumber() (block int64) PutData(space string, jobID string, topic string, rowID string, data []byte) error PutObject(space string, jobID string, topic string, rowID string, data interface{}) error PutDataSync(space string, jobID string, topic string, rowID string, data []byte) error PutObjectSync(space string, jobID string, topic string, rowID string, data interface{}) error GetData(space string, jobID string, topic string, rowID string) (data []byte, err error) GetObject(space string, jobID string, topic string, rowID string, data interface{}) error DeleteData(space string, jobID string, topic string, rowID string) error GetDataWithTopic(space string, jobID string, topic string, handler DataHandler) error GetDataWithTopicRange(space string, jobID string, topic string, from string, end string, handler DataHandler) error // SubscribeTx async subscription SubscribeTx(space string, jobID string, topic string, from string, handler DataHandler) (CancelSubs, error) PutDataFullPath(space string, path string, data []byte) error PutObjectFullPath(space string, path string, data interface{}) error GetDataFullPath(space string, path string) (data []byte, err error) GetObjectFullPath(space string, path string, data interface{}) (err error) DeleteDataFullPath(space string, path string) error }
func NewRepository ¶
func NewRepository(config common.DaemonConfig, logger log.Logger, client types.Client) Repository
Click to show internal directories.
Click to hide internal directories.