progx

package
v0.0.0-...-11273d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ProgressActive    = "active"
	ProgressException = "exception"
	ProgressSuccess   = "success"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoProgress

type AutoProgress struct {
	// contains filtered or unexported fields
}

Struct AutoProgress

func (*AutoProgress) Start

func (ap *AutoProgress) Start()

func (*AutoProgress) Stop

func (ap *AutoProgress) Stop()

type Progress

type Progress struct {
	Code    string
	Message interface{}
	Percent int
	Status  string
	// contains filtered or unexported fields
}

Core Struct : Progress

func NewProgress

func NewProgress(handler ProgressHandler, code string) *Progress

func (*Progress) Active

func (p *Progress) Active(percent int, message ...interface{})

func (*Progress) AutoProgress

func (p *Progress) AutoProgress(stepValue int, duration time.Duration, maxValue int, message ...interface{})

func (*Progress) Done

func (p *Progress) Done(status string, message ...interface{})

func (*Progress) Exception

func (p *Progress) Exception(percent int, message ...interface{})

func (*Progress) GetMessage

func (p *Progress) GetMessage() interface{}

func (*Progress) GetPercent

func (p *Progress) GetPercent() int

func (*Progress) GetStatus

func (p *Progress) GetStatus() string

func (*Progress) NewSubProgress

func (p *Progress) NewSubProgress(proportion int) *SubProgress

func (*Progress) ProgressChanged

func (p *Progress) ProgressChanged(subProgress *SubProgress)

nolint[:gocyclo,dupl]

func (*Progress) Send

func (p *Progress) Send(percent int, status string, message interface{})

func (*Progress) SendMsg

func (p *Progress) SendMsg()

func (*Progress) Set

func (p *Progress) Set(percent int, status string, message ...interface{})

func (*Progress) SetStatus

func (p *Progress) SetStatus(status string, message ...interface{})

func (*Progress) Step

func (p *Progress) Step(stepValue int, message ...interface{})

func (*Progress) Success

func (p *Progress) Success(message ...interface{})

type ProgressDispatcher

type ProgressDispatcher struct {
	Code        string
	Subscribers []ProgressSubscriber
	// contains filtered or unexported fields
}

Progress Dispatcher

func NewProgressDispatcher

func NewProgressDispatcher(code string, subscriber ...ProgressSubscriber) *ProgressDispatcher

export

func (*ProgressDispatcher) Active

func (pd *ProgressDispatcher) Active(percent int, message ...interface{})

func (*ProgressDispatcher) AutoProgress

func (pd *ProgressDispatcher) AutoProgress(stepValue int, duration time.Duration, maxValue int, message ...interface{})

func (*ProgressDispatcher) Done

func (pd *ProgressDispatcher) Done(status string, message ...interface{})

func (*ProgressDispatcher) Exception

func (pd *ProgressDispatcher) Exception(percent int, message ...interface{})

func (*ProgressDispatcher) GetMessage

func (pd *ProgressDispatcher) GetMessage() interface{}

func (*ProgressDispatcher) GetPercent

func (pd *ProgressDispatcher) GetPercent() int

func (*ProgressDispatcher) GetStatus

func (pd *ProgressDispatcher) GetStatus() string

func (*ProgressDispatcher) NewSubProgress

func (pd *ProgressDispatcher) NewSubProgress(proportion int) *SubProgress

func (*ProgressDispatcher) ProgressChanged

func (pd *ProgressDispatcher) ProgressChanged(subProgress *SubProgress)

nolint[:gocyclo,dupl]

func (*ProgressDispatcher) Set

func (pd *ProgressDispatcher) Set(percent int, status string, message ...interface{})

func (*ProgressDispatcher) SetStatus

func (pd *ProgressDispatcher) SetStatus(status string, message ...interface{})

func (*ProgressDispatcher) Step

func (pd *ProgressDispatcher) Step(stepValue int, message ...interface{})

func (*ProgressDispatcher) Success

func (pd *ProgressDispatcher) Success(message ...interface{})

type ProgressGetter

type ProgressGetter interface {
	GetPercent() int
	GetStatus() string
	GetMessage() interface{}
}

type ProgressHandler

type ProgressHandler interface {
	SendData(msg interface{}) error
}

type ProgressSetter

type ProgressSetter interface {
	ProgressGetter
	Set(percent int, status string, message ...interface{})
	// contains filtered or unexported methods
}

type ProgressSubscriber

type ProgressSubscriber interface {
	ProgressSet(percent int, status string, messages ...interface{})
}

type ProgressSuperior

type ProgressSuperior interface {
	ProgressChanged(subProgress *SubProgress)
}

type SubProgress

type SubProgress struct {
	Proportion  int
	Code        string
	Message     interface{}
	Percent     int
	Status      string
	Propagation bool
	// contains filtered or unexported fields
}

func (*SubProgress) IsDone

func (sp *SubProgress) IsDone() bool

func (*SubProgress) ProgressSet

func (sp *SubProgress) ProgressSet(percent int, status string, message ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL