v0.0.5 Latest Latest

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

Go to latest
Published: Feb 19, 2018 License: Apache-2.0 Imports: 14 Imported by: 0




This section is empty.


This section is empty.


func NewListener

func NewListener(consumer, provider string) recorder.Listener


type FileSystem

type FileSystem interface {
	PathExists(path string) (bool, error)
	CreatePath(path string) error
	OpenWriteStream(fileName string) (io.WriteCloser, error)

type Generator

type Generator struct {
	// contains filtered or unexported fields

func NewGenerator

func NewGenerator(consumer, provider string, options ...Option) *Generator

func (*Generator) ProcessInteraction

func (generator *Generator) ProcessInteraction(request recorder.Request, response recorder.Response) error

type IDGenerator

type IDGenerator interface {
	Generate() string

type Interaction

type Interaction struct {
	Request     Request  `json:"request"`
	Response    Response `json:"response"`
	Description string   `json:"description"`

type Listener

type Listener struct {
	// contains filtered or unexported fields

func (Listener) GetPactLocation

func (listener Listener) GetPactLocation() string

func (Listener) RequestReceived

func (listener Listener) RequestReceived(request recorder.Request, response recorder.Response)

type LocalFileSystem

type LocalFileSystem struct{}

func (*LocalFileSystem) CreatePath

func (fileSystem *LocalFileSystem) CreatePath(path string) error

func (*LocalFileSystem) OpenWriteStream

func (fileSystem *LocalFileSystem) OpenWriteStream(fileName string) (io.WriteCloser, error)

func (*LocalFileSystem) PathExists

func (fileSystem *LocalFileSystem) PathExists(path string) (bool, error)

type Option

type Option func(config *config)

func WithFileSystem

func WithFileSystem(fileSystem FileSystem) Option

func WithIDGenerator

func WithIDGenerator(idGenerator IDGenerator) Option

type Pact

type Pact struct {
	Consumer     Participant   `json:"consumer"`
	Provider     Participant   `json:"provider"`
	Interactions []Interaction `json:"interactions"`

func (*Pact) AddInteraction

func (pact *Pact) AddInteraction(interaction Interaction)

type Participant added in v0.0.5

type Participant struct {
	Name string `json:"name"`

type Request

type Request struct {
	Method  string            `json:"method"`
	Path    string            `json:"path"`
	Query   string            `json:"query,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    json.RawMessage   `json:"body,omitempty"`

type Response

type Response struct {
	Status  int               `json:"status"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    json.RawMessage   `json:"body,omitempty"`

Jump to

Keyboard shortcuts

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