Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJobsFromStrings ¶ added in v1.8.0
func CreateJobsFromStrings(values []string) []interface{}
CreateJobsFromStrings is a utility to create jobs from an slice of strings.
func ForEach ¶ added in v1.8.0
func ForEach(ctx context.Context, jobs []interface{}, concurrency int, jobFunc func(ctx context.Context, job interface{}) error) error
ForEach runs the provided jobFunc for each job up to concurrency concurrent workers. The execution breaks on first error encountered.
func ForEachUser ¶
func ForEachUser(ctx context.Context, userIDs []string, concurrency int, userFunc func(ctx context.Context, userID string) error) error
ForEachUser runs the provided userFunc for each userIDs up to concurrency concurrent workers. In case userFunc returns error, it will continue to process remaining users but returns an error with all errors userFunc has returned.
Types ¶
type SyncBuffer ¶
type SyncBuffer struct {
// contains filtered or unexported fields
}
SyncBuffer is a io.writer implementation with atomic writes. It only keeps data in memory.
func (*SyncBuffer) String ¶
func (sb *SyncBuffer) String() string
Click to show internal directories.
Click to hide internal directories.