testresource

package
v0.0.0-...-da8642b Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testresource contains utilities for testing with resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteOutput

type ByteOutput struct {
	Bytes *bytes.Buffer
}

ByteOutput is a resource output that writes to a byte buffer.

func (*ByteOutput) New

func (o *ByteOutput) New(p *ir.PatientInfo) (io.WriteCloser, error)

New returns the ByteWriteCloser.

type Writer

type Writer struct {
	Resources []*ir.PatientInfo
	// contains filtered or unexported fields
}

Writer is a resource writer that exposes the resources it has written to be retrieved by tests.

func NewWriter

func NewWriter() *Writer

NewWriter initialises gob encoders and returns a new TestWriter.

func (*Writer) Close

func (w *Writer) Close() error

Close exists to implement the hospital.ResourceWriter interface and is a no-op.

func (*Writer) Generate

func (w *Writer) Generate(p *ir.PatientInfo) error

Generate appends a copy of `p` to `Resources`.

Jump to

Keyboard shortcuts

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