reporter

package
v0.0.0-...-ee6dd69 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRunning    = errors.New("cannot do this if the reporter is not running")
	ErrIsRunning     = errors.New("cannot do this if the reporter is running")
	ErrRepeatedStart = errors.New("cannot repeated start the reporter")
)

Functions

This section is empty.

Types

type DuplicateError

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

func (DuplicateError) Error

func (d DuplicateError) Error() string

type HTMLGennerate

type HTMLGennerate interface {
	HTitle() string
	HSummary() string
	HGroupDetail() []string
}

HTMLGennerate a html gennerate inferface. reporter service need implement if can provide html report

type JunitFormater

type JunitFormater interface {
	ToJunit() (formater.JUnitTestSuites, error)
}

type ReportActionError

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

func (ReportActionError) Error

func (r ReportActionError) Error() string

type Reporter

type Reporter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Reporter is a report service manager. responsible for the operation of the register service.

func New

func New(ctx *ServiceContext) (*Reporter, error)

New return a new report manager

func (*Reporter) OutputHTML

func (r *Reporter) OutputHTML(writer io.Writer) error

func (*Reporter) OutputJunit

func (r *Reporter) OutputJunit(noXMLHeader bool, w io.Writer) error

func (*Reporter) Register

func (r *Reporter) Register(constructor ServiceConstructor) error

Register is add a server constructor to reporter

func (*Reporter) RegisterNumber

func (r *Reporter) RegisterNumber() int

func (*Reporter) Start

func (r *Reporter) Start() error

Start reporter and service. disable start the report without service or is running,otherwise return error.

func (*Reporter) Stop

func (r *Reporter) Stop() error

Stop the reporter and each of running service. disable stop the not running reporter,otherwise return error. return the stop error if one service stop failed. Note: this stop action will wait for all service stop done.

func (*Reporter) Wait

func (r *Reporter) Wait()

Wait blocks the thread until the each of services is stopped.

type Service

type Service interface {
	Run() error
	Stop() error
	Wait() error
}

Service a report service interface

type ServiceConstructor

type ServiceConstructor func(ctx *ServiceContext) (Service, error)

An service constructor

type ServiceContext

type ServiceContext struct {
	// Global context contains os info
	GlobalCxt *context.Context

	// list of program run arg
	Flagset *pflag.FlagSet

	ErrH func(fm string, args ...interface{})
}

ServiceContext is a context for report work

type TextPlainGenerate

type TextPlainGenerate interface {
	TOutput(writer io.Writer) error
}

TextPlainGenerate a text plain generate interface. reporter service need implement to print text plain report

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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