Documentation ¶
Index ¶
- Variables
- func ConsistentHashFilter(name string, workers []string) (gtm.OpFilter, error)
- func ConsistentHashFilterFromDocument(name string, document map[string]interface{}) (gtm.OpFilter, error)
- func ConsistentHashFilterFromFile(name string, configFile string) (gtm.OpFilter, error)
- type ConfigOptions
Constants ¶
This section is empty.
Variables ¶
var EmptyWorkers = errors.New("config not found or workers empty")
var InvalidWorkers = errors.New("workers must be an array of string")
var WorkerMissing = errors.New("the specified worker was not found in the config")
Functions ¶
func ConsistentHashFilter ¶
ConsistentHashFilter returns an operation filter which uses a consistent hash to determine if the operation will be accepted for processing. can be used to distribute work. name: the name of the worker creating this filter. e.g. "Harry" workers: a slice of strings representing the available worker names
func ConsistentHashFilterFromDocument ¶
func ConsistentHashFilterFromDocument(name string, document map[string]interface{}) (gtm.OpFilter, error)
ConsistentHashFilterFromDocument returns an operation filter which uses a consistent hash to determine if the operation will be accepted for processing. can be used to distribute work. name: the name of the worker creating this filter. e.g. "Harry" document: a map with a string key 'workers' which has a corresponding
slice of string representing the available workers
func ConsistentHashFilterFromFile ¶
ConsistentHashFilterFromFile returns an operation filter which uses a consistent hash to determine if the operation will be accepted for processing. can be used to distribute work. name: the name of the worker creating this filter. e.g. "Harry" configFile: a file path to a TOML document. the document should contain a property named 'Workers' which is a list of all the workers participating. e.g. workers = [ "Tom", "Dick", "Harry" ]
Types ¶
type ConfigOptions ¶
type ConfigOptions struct {
Workers []string
}