Documentation ¶
Index ¶
- func AssertContains(t *testing.T, contains string, msgAndArgs ...string)
- func AssertEqual(t *testing.T, a, b interface{})
- func AssertNil(t *testing.T, object interface{})
- func AssertNotNil(t *testing.T, object interface{})
- func Contains(s []*string, str *string) bool
- func InitLogMsg(fieldMap map[string]string)
- func PublishProgress(listener ProgressListener, event *ProgressEvent)
- func SetLogChannel(channel string)
- type Logger
- func (logger *Logger) CloseLogger()
- func (logger *Logger) GetFormatTemplate() string
- func (logger *Logger) GetIsopen() bool
- func (logger *Logger) GetLastLogMsg() string
- func (logger *Logger) OpenLogger()
- func (logger *Logger) PrintLog(fieldMap map[string]string, err error)
- func (logger *Logger) SetFormatTemplate(template string)
- func (logger *Logger) SetIsopen(isopen bool)
- func (logger *Logger) SetLastLogMsg(lastLogMsg string)
- type ProgressEvent
- type ProgressEventType
- type ProgressListener
- type ReaderTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqual ¶
func AssertNotNil ¶
func InitLogMsg ¶
func PublishProgress ¶
func PublishProgress(listener ProgressListener, event *ProgressEvent)
publishProgress
func SetLogChannel ¶
func SetLogChannel(channel string)
Types ¶
type Logger ¶
func (*Logger) CloseLogger ¶
func (logger *Logger) CloseLogger()
func (*Logger) GetFormatTemplate ¶
func (*Logger) GetLastLogMsg ¶
func (*Logger) OpenLogger ¶
func (logger *Logger) OpenLogger()
func (*Logger) SetFormatTemplate ¶
func (*Logger) SetLastLogMsg ¶
type ProgressEvent ¶
type ProgressEvent struct { ConsumedBytes int64 TotalBytes int64 RwBytes int64 EventType ProgressEventType }
ProgressEvent defines progress event
func NewProgressEvent ¶
func NewProgressEvent(eventType ProgressEventType, consumed, total int64, rwBytes int64) *ProgressEvent
type ProgressEventType ¶
type ProgressEventType int
ProgressEventType defines transfer progress event type
const ( // TransferStartedEvent transfer started, set TotalBytes TransferStartedEvent ProgressEventType = 1 + iota // TransferDataEvent transfer data, set ConsumedBytes anmd TotalBytes TransferDataEvent // TransferCompletedEvent transfer completed TransferCompletedEvent // TransferFailedEvent transfer encounters an error TransferFailedEvent )
type ProgressListener ¶
type ProgressListener interface {
ProgressChanged(event *ProgressEvent)
}
ProgressListener listens progress change
func GetProgressListener ¶
func GetProgressListener(obj interface{}) ProgressListener
type ReaderTracker ¶
type ReaderTracker struct {
CompletedBytes int64
}
Click to show internal directories.
Click to hide internal directories.