Documentation
¶
Index ¶
- Variables
- func AreStringSliceElementsEqual(s1 []string, s2 []string) bool
- func AreStringSlicesEqual(s1 []string, s2 []string) bool
- func ChunkSlice(s interface{}, chunkSize int) interface{}
- func HTTPGetJSON(url string, username string, password string, response interface{}) error
- func IsStringInSlice(s string, slice []string) bool
- type BytesBuffer
- type HTTPClient
- type RecurrentTask
- type Registry
- type SynchronizedMap
- type Task
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
var ErrStatusNotFound = errors.New("Not Found")
var ErrTaskAborted = errors.New("Aborted")
ErrTaskAborted error thrown when a taks is aborted
var (
// XAuthTokenHeader is the name of the header supposed to contain the auth token
XAuthTokenHeader = "X-Auth-Token"
)
Functions ¶
func AreStringSliceElementsEqual ¶ added in v0.0.6
AreStringSliceElementsEqual check the same elements are in both slices but they can be in different order
func AreStringSlicesEqual ¶ added in v0.0.6
AreStringSlicesEqual check equality between two slices
func ChunkSlice ¶
func ChunkSlice(s interface{}, chunkSize int) interface{}
ChunkSlice chunk a slice in smaller chunks of size chunkSize
func HTTPGetJSON ¶
func IsStringInSlice ¶
IsStringInSlice check if string is in string slice
Types ¶
type BytesBuffer ¶
type BytesBuffer struct {
// contains filtered or unexported fields
}
BytesBuffer represent bytes buffer as ReadCloser
func NewBytesBuffer ¶
func NewBytesBuffer(p []byte) *BytesBuffer
NewBytesBuffer create a bytes buffer
type HTTPClient ¶
HTTPClient is an http client perofrming caching
type RecurrentTask ¶
type RecurrentTask struct { RunAtStartup bool // contains filtered or unexported fields }
RecurrentTask represent a recurrent task
func NewRecurrentTask ¶
func NewRecurrentTask(interval time.Duration, callback func()) RecurrentTask
NewRecurrentTask create a recurrent task
type Registry ¶ added in v0.0.66
type Registry[T comparable, U any] struct { // contains filtered or unexported fields }
func NewRegistry ¶ added in v0.0.66
func NewRegistry[T comparable, U any]() *Registry[T, U]
type SynchronizedMap ¶
type SynchronizedMap struct {
// contains filtered or unexported fields
}
func NewSynchronizedMap ¶
func NewSynchronizedMap() *SynchronizedMap
func (*SynchronizedMap) Get ¶
func (sm *SynchronizedMap) Get(key string) (interface{}, bool)
func (*SynchronizedMap) Set ¶
func (sm *SynchronizedMap) Set(key string, value interface{})
type Task ¶ added in v0.0.18
type Task struct {
// contains filtered or unexported fields
}
Task is a representation of a task
type WorkerPool ¶ added in v0.0.18
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool a pool of workers able to perform multiple tasks in parallel
func NewWorkerPool ¶ added in v0.0.18
func NewWorkerPool(workers int) *WorkerPool
NewWorkerPool instantiate a new worker pool
func (*WorkerPool) Exec ¶ added in v0.0.18
func (wp *WorkerPool) Exec(f func() error) chan error
Exec enqueues one task into the worker pool