test

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTwoZeroes is an arbitrary business rule for the Add method.
	ErrTwoZeroes = errors.New("can't sum two zeroes")

	// ErrIntOverflow protects the Add method. We've decided that this error
	// indicates a misbehaving service and should count against e.g. circuit
	// breakers. So, we return it directly in endpoints, to illustrate the
	// difference. In a real service, this probably wouldn't be the case.
	ErrIntOverflow = errors.New("integer overflow")

	// ErrMaxSizeExceeded protects the Concat method.
	ErrMaxSizeExceeded = errors.New("result exceeds maximum size")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	Sum(ctx context.Context, a, b int) (int, error)
	Concat(ctx context.Context, a, b string) (string, error)
}

Service describes a service that adds things together.

func New

func New(logger log.Logger, ints, chars metrics.Counter) Service

New returns a basic Service with all the expected middlewares wired in.

func NewBasicService

func NewBasicService() Service

NewBasicService returns a naïve, stateless implementation of Service.

type Simple

type Simple interface {
	Get(i int) (err error)
	Get2(int) error
	Get3(i int) error
	Get4(int) (err error)
	Get5([]int) (err error)
	Method(method types.Method) error
	MethodP(method *types.Method) error
	MethodAP(method []*types.Method) error
	EP(end endpoint.Endpoint) error
}

func NewSimple

func NewSimple() Simple

Jump to

Keyboard shortcuts

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