Documentation ¶
Index ¶
Constants ¶
const NoSuitableAddrStr string = "no suitable address found"
NoSuitableAddrStr - the string to be used for checking the error message Since the golang net package does not export this, we have to define it here again
Variables ¶
This section is empty.
Functions ¶
func IsNoSuitableAddrErr ¶
IsNoSuitableAddrErr - the function to check 'no suitable address' for http mainly
Types ¶
type ErrTimeout ¶
type ErrTimeout struct {
// contains filtered or unexported fields
}
ErrTimeout is the error returned when a timeout occurs. The error message will be the timeout duration that was exceeded.
func (*ErrTimeout) Error ¶
func (e *ErrTimeout) Error() string
func (*ErrTimeout) Is ¶
func (e *ErrTimeout) Is(err error) bool
Is the other error the same type? We do not really care about the properties
type Resp ¶
type Resp struct { List []string //list of images at given path BodyLength int // Body length in http response ContentLength int64 // Content length in http response }
Resp response data from executing commands
func ExecCmd ¶
func ExecCmd(ctx context.Context, cmd, host, remoteFile, localFile string, objSize int64, prgNotify types.StatsNotifChan, client *http.Client, inactivityTimeout time.Duration) (types.UpdateStats, Resp)
ExecCmd performs various commands such as "ls", "get", etc. Note that "host" needs to contain the URL in the case of a get
type TimeoutReader ¶
type TimeoutReader struct {
// contains filtered or unexported fields
}
TimeoutReader reads until a preset timeout, then returns a timeout error. The timeout is for each read.
func NewTimeoutReader ¶
func NewTimeoutReader(timeout time.Duration, r io.Reader) *TimeoutReader
NewTimeoutReader creates a new TimeoutReader.