orbital

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultService = New()

Functions

func Register

func Register(tc TestCase)

func WithStats

func WithStats(s *stats.Engine) func(*Service)

func WithTimeout

func WithTimeout(d time.Duration) func(*Service)

Types

type O

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

O is the base construct for orbital. It should be used for logging, metrics access and most importantly, signaling if a test has failed.

func (*O) Error

func (o *O) Error(args ...interface{})

Error is equivalent to Log followed by Fail

func (*O) Errorf

func (o *O) Errorf(fstr string, args ...interface{})

Errorf is equivalent to Logf followed by Fail

func (*O) Fail

func (o *O) Fail()

func (*O) Log

func (o *O) Log(args ...interface{})

func (*O) Logf

func (o *O) Logf(fstr string, args ...interface{})

func (*O) Stats

func (o *O) Stats() *stats.Engine

type Service

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

Service runs all registered TestCases on the schedule specified during registration.

func New

func New(opts ...func(*Service)) *Service

func (*Service) Close

func (s *Service) Close() error

func (*Service) Register

func (s *Service) Register(tc TestCase)

Register a test case to be run.

func (*Service) Run

func (s *Service) Run()

type TestCase

type TestCase struct {
	Period  time.Duration
	Name    string
	Func    TestFunc
	Timeout time.Duration
	Tags    []stats.Tag
}

TestCase represents an individual test to be run on a schedule given by Period. If Timeout is not specified, Service will provide a default timeout. Name should be metrics-compatible, for now.

type TestFunc

type TestFunc func(ctx context.Context, o *O)

TestFunc represents a function to be run under test Should block until complete Responsible for cleaning up any allocated resources or spawned goroutines before returning Should select on ctx.Done for long running operations

Jump to

Keyboard shortcuts

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