Documentation
¶
Index ¶
- Variables
- func BackoffRetry(ctx context.Context, maxAttempts int, f func() error) error
- func CheckHTTP(ctx context.Context, ID string, backends []string, code int, ...) bool
- func CheckTCP(ctx context.Context, ID string, backends []string, timeout time.Duration) bool
- func GetAppInfo(containerName string) (name, entrypoint, ident string, err error)
- func GetDevicePath(major, minor uint64) (devPath string, err error)
- func GetIP(daemonHost string) string
- func GetMaxAttemptsByTTL(ttl int64) int
- func IsDockerized() bool
- func MakeDockerClient(config *types.Config) (*engineapi.Client, error)
- func MakeYavirtClient(config *types.Config) (yavirtclient.Client, error)
- func NewBufPipe(bufCap int64) (*PipeReader, *PipeWriter)
- func ReplaceNonUtf8(str string) string
- func UseLabelAsFilter() bool
- func WithTimeout(ctx context.Context, timeout time.Duration, f func(ctx2 context.Context))
- func WritePid(path string)
- type GroupCAS
- type HashBackends
- type PipeReader
- type PipeWriter
- type RetryTask
Constants ¶
This section is empty.
Variables ¶
var Pool *ants.Pool
Pool .
Functions ¶
func BackoffRetry ¶
BackoffRetry retries up to `maxAttempts` times, and the interval will grow exponentially
func CheckHTTP ¶
func CheckHTTP(ctx context.Context, ID string, backends []string, code int, timeout time.Duration) bool
CheckHTTP 检查一个workload的所有URL CheckHTTP 事实上一般也就一个
func GetAppInfo ¶
GetAppInfo return app info
func GetDevicePath ¶
func MakeDockerClient ¶
MakeDockerClient make a docker client
func MakeYavirtClient ¶
func MakeYavirtClient(config *types.Config) (yavirtclient.Client, error)
MakeYavirtClient make a yavirt client
func NewBufPipe ¶
func NewBufPipe(bufCap int64) (*PipeReader, *PipeWriter)
NewBufPipe creates a synchronous pipe with capacity
func ReplaceNonUtf8 ¶
ReplaceNonUtf8 replaces non-utf8 characters in \x format.
func WithTimeout ¶
WithTimeout runs a function with given timeout
Types ¶
type HashBackends ¶
type HashBackends struct {
// contains filtered or unexported fields
}
HashBackends is a simple hash backend
func NewHashBackends ¶
func NewHashBackends(data []string) *HashBackends
NewHashBackends new a hash backends
type PipeReader ¶
type PipeReader struct {
// contains filtered or unexported fields
}
A PipeReader is the read half of a pipe.
func (*PipeReader) CloseWithError ¶
func (r *PipeReader) CloseWithError(err error) error
CloseWithError closes the reader; subsequent writes to the write half of the pipe will return the error err.
type PipeWriter ¶
type PipeWriter struct {
// contains filtered or unexported fields
}
A PipeWriter is the write half of a pipe.
func (*PipeWriter) CloseWithError ¶
func (w *PipeWriter) CloseWithError(err error) error
CloseWithError closes the writer