Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Feature ¶
type Feature int
Feature represent a process feature
const ( // EventFeature is the feature to plug the process to the event server EventFeature Feature = iota // ConfigFeature is the feature to plug the process to the ConfigAPI framework ConfigFeature // CacheFeature is the feature to plug the process to the cache server CacheFeature // CrawlingFeature is the feature to plug the process with a tor-compatible HTTP client CrawlingFeature // EventPrefetchFlag is the prefetch count for the event subscriber EventPrefetchFlag = "event-prefetch" )
type Process ¶
type Process interface {
Name() string
Description() string
Features() []Feature
CustomFlags() []cli.Flag
Initialize(provider Provider) error
Subscribers() []SubscriberDef
HTTPHandler() http.Handler
}
Process is a component of Bathyscaphe
type Provider ¶
type Provider interface {
// Clock return a clock implementation
Clock() (clock.Clock, error)
// ConfigClient return a new configured configapi.Client
ConfigClient(keys []string) (configapi.Client, error)
// Subscriber return a new configured subscriber
Subscriber() (event.Subscriber, error)
// Publisher return a new configured publisher
Publisher() (event.Publisher, error)
// Cache return a new configured cache
Cache(keyPrefix string) (cache.Cache, error)
// HTTPClient return a new configured http client
HTTPClient() (chttp.Client, error)
// GetStrValue return string value for given key
GetStrValue(key string) string
// GetStrValues return string slice for given key
GetStrValues(key string) []string
// GetIntValue return int value for given key
GetIntValue(key string) int
}
Provider is the implementation provider
func NewDefaultProvider ¶
NewDefaultProvider create a brand new default provider using given cli.Context
Click to show internal directories.
Click to hide internal directories.