client

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 6 Imported by: 3

Documentation

Overview

Package client is an internal package, implementing the raw interface to the Pact CLI tools: The Pact Mock Service and Provider Verification "binaries."

See https://github.com/pact-foundation/pact-provider-verifier and https://github.com/bethesque/pact-mock_service for more on the Ruby "binaries".

NOTE: The ultimate goal here is to replace the Ruby dependencies with a shared library (Pact Reference - (https://github.com/pact-foundation/pact-reference/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageService

type MessageService struct {
	ServiceManager
}

MessageService is a wrapper for the Pact Message service.

func (*MessageService) NewService

func (v *MessageService) NewService(args []string) Service

NewService creates a new MessageService with default settings. Named Arguments allowed:

		--consumer
		--provider
   --pact-dir

type MockService

type MockService struct {
	ServiceManager
}

MockService is a wrapper for the Pact Mock Service.

func (*MockService) NewService

func (m *MockService) NewService(args []string) Service

NewService creates a new MockService with default settings.

type PublishService

type PublishService struct {
	ServiceManager
}

PublishService is a wrapper for the Pact Provider Verifier Service.

func (*PublishService) NewService

func (v *PublishService) NewService(args []string) Service

NewService creates a new PublishService with default settings. Arguments allowed:

		--provider-base-url
		--pact-urls
		--provider-states-url
		--provider-states-setup-url
		--broker-username
		--broker-password
   --publish-verification-results
   --provider-app-version
   --custom-provider-headers

type Service

type Service interface {
	Setup()
	Stop(pid int) (bool, error)
	List() map[int]*exec.Cmd
	Command() *exec.Cmd
	Start() *exec.Cmd
	NewService(args []string) Service
}

Service is a process wrapper for 3rd party binaries. It will spawn an instance of the binary and manage the life-cycle and IO of the process.

type ServiceManager

type ServiceManager struct {
	Cmd string

	Args []string
	Env  []string
	// contains filtered or unexported fields
}

ServiceManager is the default implementation of the Service interface.

func (*ServiceManager) Command

func (s *ServiceManager) Command() *exec.Cmd

Command creates an os command to be run

func (*ServiceManager) List

func (s *ServiceManager) List() map[int]*exec.Cmd

List all Service PIDs.

func (*ServiceManager) Setup

func (s *ServiceManager) Setup()

Setup the Management services.

func (*ServiceManager) Start

func (s *ServiceManager) Start() *exec.Cmd

Start a Service and log its output.

func (*ServiceManager) Stop

func (s *ServiceManager) Stop(pid int) (bool, error)

Stop a Service and returns the exit status.

type VerificationService

type VerificationService struct {
	ServiceManager
}

VerificationService is a wrapper for the Pact Provider Verifier Service.

func (*VerificationService) NewService

func (v *VerificationService) NewService(args []string) Service

NewService creates a new VerificationService with default settings. Arguments allowed:

		--provider-base-url
		--pact-urls
		--provider-states-url
		--provider-states-setup-url
		--broker-username
		--broker-password
   --publish-verification-results
   --provider-app-version
   --custom-provider-headers

Jump to

Keyboard shortcuts

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