io_pact_plugin

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CatalogueEntry_EntryType_name = map[int32]string{
		0: "CONTENT_MATCHER",
		1: "CONTENT_GENERATOR",
		2: "MOCK_SERVER",
		3: "MATCHER",
		4: "INTERACTION",
	}
	CatalogueEntry_EntryType_value = map[string]int32{
		"CONTENT_MATCHER":   0,
		"CONTENT_GENERATOR": 1,
		"MOCK_SERVER":       2,
		"MATCHER":           3,
		"INTERACTION":       4,
	}
)

Enum value maps for CatalogueEntry_EntryType.

View Source
var (
	Body_ContentTypeHint_name = map[int32]string{
		0: "DEFAULT",
		1: "TEXT",
		2: "BINARY",
	}
	Body_ContentTypeHint_value = map[string]int32{
		"DEFAULT": 0,
		"TEXT":    1,
		"BINARY":  2,
	}
)

Enum value maps for Body_ContentTypeHint.

View Source
var (
	InteractionResponse_MarkupType_name = map[int32]string{
		0: "COMMON_MARK",
		1: "HTML",
	}
	InteractionResponse_MarkupType_value = map[string]int32{
		"COMMON_MARK": 0,
		"HTML":        1,
	}
)

Enum value maps for InteractionResponse_MarkupType.

View Source
var File_plugin_proto protoreflect.FileDescriptor
View Source
var PactPlugin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "io.pact.plugin.PactPlugin",
	HandlerType: (*PactPluginServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "InitPlugin",
			Handler:    _PactPlugin_InitPlugin_Handler,
		},
		{
			MethodName: "UpdateCatalogue",
			Handler:    _PactPlugin_UpdateCatalogue_Handler,
		},
		{
			MethodName: "CompareContents",
			Handler:    _PactPlugin_CompareContents_Handler,
		},
		{
			MethodName: "ConfigureInteraction",
			Handler:    _PactPlugin_ConfigureInteraction_Handler,
		},
		{
			MethodName: "GenerateContent",
			Handler:    _PactPlugin_GenerateContent_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pact_plugin.proto",
}

PactPlugin_ServiceDesc is the grpc.ServiceDesc for PactPlugin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPactPluginServer

func RegisterPactPluginServer(s grpc.ServiceRegistrar, srv PactPluginServer)

Types

type Body

type Body struct {

	// The content type of the body in MIME format (i.e. application/json)
	ContentType string `protobuf:"bytes,1,opt,name=contentType,proto3" json:"contentType,omitempty"`
	// Bytes of the actual content
	Content *wrapperspb.BytesValue `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// Content type override to apply (if required). If omitted, the default rules of the Pact implementation
	// will be used
	ContentTypeHint Body_ContentTypeHint `protobuf:"varint,3,opt,name=contentTypeHint,proto3,enum=io.pact.plugin.Body_ContentTypeHint" json:"contentTypeHint,omitempty"`
	// contains filtered or unexported fields
}

Message representing a request, response or message body

func (*Body) Descriptor deprecated

func (*Body) Descriptor() ([]byte, []int)

Deprecated: Use Body.ProtoReflect.Descriptor instead.

func (*Body) GetContent

func (x *Body) GetContent() *wrapperspb.BytesValue

func (*Body) GetContentType

func (x *Body) GetContentType() string

func (*Body) GetContentTypeHint

func (x *Body) GetContentTypeHint() Body_ContentTypeHint

func (*Body) ProtoMessage

func (*Body) ProtoMessage()

func (*Body) ProtoReflect

func (x *Body) ProtoReflect() protoreflect.Message

func (*Body) Reset

func (x *Body) Reset()

func (*Body) String

func (x *Body) String() string

type Body_ContentTypeHint

type Body_ContentTypeHint int32

Enum of content type override. This is a hint on how the content type should be treated.

const (
	// Determine the form of the content using the default rules of the Pact implementation
	Body_DEFAULT Body_ContentTypeHint = 0
	// Contents must always be treated as a text form
	Body_TEXT Body_ContentTypeHint = 1
	// Contents must always be treated as a binary form
	Body_BINARY Body_ContentTypeHint = 2
)

func (Body_ContentTypeHint) Descriptor

func (Body_ContentTypeHint) Enum

func (Body_ContentTypeHint) EnumDescriptor deprecated

func (Body_ContentTypeHint) EnumDescriptor() ([]byte, []int)

Deprecated: Use Body_ContentTypeHint.Descriptor instead.

func (Body_ContentTypeHint) Number

func (Body_ContentTypeHint) String

func (x Body_ContentTypeHint) String() string

func (Body_ContentTypeHint) Type

type Catalogue

type Catalogue struct {

	// List of entries from the core catalogue
	Catalogue []*CatalogueEntry `protobuf:"bytes,1,rep,name=catalogue,proto3" json:"catalogue,omitempty"`
	// contains filtered or unexported fields
}

Catalogue of Core Pact + Plugin features

func (*Catalogue) Descriptor deprecated

func (*Catalogue) Descriptor() ([]byte, []int)

Deprecated: Use Catalogue.ProtoReflect.Descriptor instead.

func (*Catalogue) GetCatalogue

func (x *Catalogue) GetCatalogue() []*CatalogueEntry

func (*Catalogue) ProtoMessage

func (*Catalogue) ProtoMessage()

func (*Catalogue) ProtoReflect

func (x *Catalogue) ProtoReflect() protoreflect.Message

func (*Catalogue) Reset

func (x *Catalogue) Reset()

func (*Catalogue) String

func (x *Catalogue) String() string

type CatalogueEntry

type CatalogueEntry struct {

	// Entry type
	Type CatalogueEntry_EntryType `protobuf:"varint,1,opt,name=type,proto3,enum=io.pact.plugin.CatalogueEntry_EntryType" json:"type,omitempty"`
	// Entry key
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// Associated data required for the entry. For CONTENT_MATCHER and CONTENT_GENERATOR types, a "content-types"
	// value (separated by semi-colons) is required for all the content types the plugin supports.
	Values map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

Entry to be added to the core catalogue. Each entry describes one of the features the plugin provides. Entries will be stored in the catalogue under the key "plugin/$name/$type/$key".

func (*CatalogueEntry) Descriptor deprecated

func (*CatalogueEntry) Descriptor() ([]byte, []int)

Deprecated: Use CatalogueEntry.ProtoReflect.Descriptor instead.

func (*CatalogueEntry) GetKey

func (x *CatalogueEntry) GetKey() string

func (*CatalogueEntry) GetType

func (*CatalogueEntry) GetValues

func (x *CatalogueEntry) GetValues() map[string]string

func (*CatalogueEntry) ProtoMessage

func (*CatalogueEntry) ProtoMessage()

func (*CatalogueEntry) ProtoReflect

func (x *CatalogueEntry) ProtoReflect() protoreflect.Message

func (*CatalogueEntry) Reset

func (x *CatalogueEntry) Reset()

func (*CatalogueEntry) String

func (x *CatalogueEntry) String() string

type CatalogueEntry_EntryType

type CatalogueEntry_EntryType int32
const (
	// Matcher for contents of messages, requests or response bodies
	CatalogueEntry_CONTENT_MATCHER CatalogueEntry_EntryType = 0
	// Generator for contents of messages, requests or response bodies
	CatalogueEntry_CONTENT_GENERATOR CatalogueEntry_EntryType = 1
	// Mock server for a network protocol
	CatalogueEntry_MOCK_SERVER CatalogueEntry_EntryType = 2
	// Matching rule for content field/values
	CatalogueEntry_MATCHER CatalogueEntry_EntryType = 3
	// Type of interaction
	CatalogueEntry_INTERACTION CatalogueEntry_EntryType = 4
)

func (CatalogueEntry_EntryType) Descriptor

func (CatalogueEntry_EntryType) Enum

func (CatalogueEntry_EntryType) EnumDescriptor deprecated

func (CatalogueEntry_EntryType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CatalogueEntry_EntryType.Descriptor instead.

func (CatalogueEntry_EntryType) Number

func (CatalogueEntry_EntryType) String

func (x CatalogueEntry_EntryType) String() string

func (CatalogueEntry_EntryType) Type

type CompareContentsRequest

type CompareContentsRequest struct {

	// Expected body from the Pact interaction
	Expected *Body `protobuf:"bytes,1,opt,name=expected,proto3" json:"expected,omitempty"`
	// Actual received body
	Actual *Body `protobuf:"bytes,2,opt,name=actual,proto3" json:"actual,omitempty"`
	// If unexpected keys or attributes should be allowed. Setting this to false results in additional keys or fields
	// will cause a mismatch
	AllowUnexpectedKeys bool `protobuf:"varint,3,opt,name=allow_unexpected_keys,json=allowUnexpectedKeys,proto3" json:"allow_unexpected_keys,omitempty"`
	// Map of expressions to matching rules. The expressions follow the documented Pact matching rule expressions
	Rules map[string]*MatchingRules `` /* 151-byte string literal not displayed */
	// Additional data added to the Pact/Interaction by the plugin
	PluginConfiguration *PluginConfiguration `protobuf:"bytes,5,opt,name=pluginConfiguration,proto3" json:"pluginConfiguration,omitempty"`
	// contains filtered or unexported fields
}

Request to preform a comparison on an actual body given the expected one

func (*CompareContentsRequest) Descriptor deprecated

func (*CompareContentsRequest) Descriptor() ([]byte, []int)

Deprecated: Use CompareContentsRequest.ProtoReflect.Descriptor instead.

func (*CompareContentsRequest) GetActual

func (x *CompareContentsRequest) GetActual() *Body

func (*CompareContentsRequest) GetAllowUnexpectedKeys

func (x *CompareContentsRequest) GetAllowUnexpectedKeys() bool

func (*CompareContentsRequest) GetExpected

func (x *CompareContentsRequest) GetExpected() *Body

func (*CompareContentsRequest) GetPluginConfiguration

func (x *CompareContentsRequest) GetPluginConfiguration() *PluginConfiguration

func (*CompareContentsRequest) GetRules

func (x *CompareContentsRequest) GetRules() map[string]*MatchingRules

func (*CompareContentsRequest) ProtoMessage

func (*CompareContentsRequest) ProtoMessage()

func (*CompareContentsRequest) ProtoReflect

func (x *CompareContentsRequest) ProtoReflect() protoreflect.Message

func (*CompareContentsRequest) Reset

func (x *CompareContentsRequest) Reset()

func (*CompareContentsRequest) String

func (x *CompareContentsRequest) String() string

type CompareContentsResponse

type CompareContentsResponse struct {

	// Error message if an error occurred. If this field is set, the remaining fields will be ignored and the
	// verification marked as failed
	Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// There was a mismatch with the types of content. If this is set, the results may not be set.
	TypeMismatch *ContentTypeMismatch `protobuf:"bytes,2,opt,name=typeMismatch,proto3" json:"typeMismatch,omitempty"`
	// Results of the match, keyed by matching rule expression
	Results map[string]*ContentMismatches `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

Response to the CompareContentsRequest with the results of the comparison

func (*CompareContentsResponse) Descriptor deprecated

func (*CompareContentsResponse) Descriptor() ([]byte, []int)

Deprecated: Use CompareContentsResponse.ProtoReflect.Descriptor instead.

func (*CompareContentsResponse) GetError

func (x *CompareContentsResponse) GetError() string

func (*CompareContentsResponse) GetResults

func (x *CompareContentsResponse) GetResults() map[string]*ContentMismatches

func (*CompareContentsResponse) GetTypeMismatch

func (x *CompareContentsResponse) GetTypeMismatch() *ContentTypeMismatch

func (*CompareContentsResponse) ProtoMessage

func (*CompareContentsResponse) ProtoMessage()

func (*CompareContentsResponse) ProtoReflect

func (x *CompareContentsResponse) ProtoReflect() protoreflect.Message

func (*CompareContentsResponse) Reset

func (x *CompareContentsResponse) Reset()

func (*CompareContentsResponse) String

func (x *CompareContentsResponse) String() string

type ConfigureInteractionRequest

type ConfigureInteractionRequest struct {

	// Content type of the interaction (MIME format)
	ContentType string `protobuf:"bytes,1,opt,name=contentType,proto3" json:"contentType,omitempty"`
	// This is data specified by the user in the consumer test
	ContentsConfig *structpb.Struct `protobuf:"bytes,2,opt,name=contentsConfig,proto3" json:"contentsConfig,omitempty"`
	// contains filtered or unexported fields
}

Request to configure/setup an interaction so that it can be verified later

func (*ConfigureInteractionRequest) Descriptor deprecated

func (*ConfigureInteractionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfigureInteractionRequest.ProtoReflect.Descriptor instead.

func (*ConfigureInteractionRequest) GetContentType

func (x *ConfigureInteractionRequest) GetContentType() string

func (*ConfigureInteractionRequest) GetContentsConfig

func (x *ConfigureInteractionRequest) GetContentsConfig() *structpb.Struct

func (*ConfigureInteractionRequest) ProtoMessage

func (*ConfigureInteractionRequest) ProtoMessage()

func (*ConfigureInteractionRequest) ProtoReflect

func (*ConfigureInteractionRequest) Reset

func (x *ConfigureInteractionRequest) Reset()

func (*ConfigureInteractionRequest) String

func (x *ConfigureInteractionRequest) String() string

type ConfigureInteractionResponse

type ConfigureInteractionResponse struct {

	// If an error occurred. In this case, the other fields will be ignored/not set
	Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// The actual response if no error occurred.
	Interaction []*InteractionResponse `protobuf:"bytes,2,rep,name=interaction,proto3" json:"interaction,omitempty"`
	// Plugin specific data to be persisted in the pact file
	PluginConfiguration *PluginConfiguration `protobuf:"bytes,3,opt,name=pluginConfiguration,proto3" json:"pluginConfiguration,omitempty"`
	// contains filtered or unexported fields
}

Response to the configure/setup an interaction request

func (*ConfigureInteractionResponse) Descriptor deprecated

func (*ConfigureInteractionResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConfigureInteractionResponse.ProtoReflect.Descriptor instead.

func (*ConfigureInteractionResponse) GetError

func (x *ConfigureInteractionResponse) GetError() string

func (*ConfigureInteractionResponse) GetInteraction

func (x *ConfigureInteractionResponse) GetInteraction() []*InteractionResponse

func (*ConfigureInteractionResponse) GetPluginConfiguration

func (x *ConfigureInteractionResponse) GetPluginConfiguration() *PluginConfiguration

func (*ConfigureInteractionResponse) ProtoMessage

func (*ConfigureInteractionResponse) ProtoMessage()

func (*ConfigureInteractionResponse) ProtoReflect

func (*ConfigureInteractionResponse) Reset

func (x *ConfigureInteractionResponse) Reset()

func (*ConfigureInteractionResponse) String

type ContentMismatch

type ContentMismatch struct {

	// Expected data bytes
	Expected *wrapperspb.BytesValue `protobuf:"bytes,1,opt,name=expected,proto3" json:"expected,omitempty"`
	// Actual data bytes
	Actual *wrapperspb.BytesValue `protobuf:"bytes,2,opt,name=actual,proto3" json:"actual,omitempty"`
	// Description of the mismatch
	Mismatch string `protobuf:"bytes,3,opt,name=mismatch,proto3" json:"mismatch,omitempty"`
	// Path to the item that was matched. This is the value as per the documented Pact matching rule expressions.
	Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
	// Optional diff of the contents
	Diff string `protobuf:"bytes,5,opt,name=diff,proto3" json:"diff,omitempty"`
	// contains filtered or unexported fields
}

A mismatch for an particular item of content

func (*ContentMismatch) Descriptor deprecated

func (*ContentMismatch) Descriptor() ([]byte, []int)

Deprecated: Use ContentMismatch.ProtoReflect.Descriptor instead.

func (*ContentMismatch) GetActual

func (x *ContentMismatch) GetActual() *wrapperspb.BytesValue

func (*ContentMismatch) GetDiff

func (x *ContentMismatch) GetDiff() string

func (*ContentMismatch) GetExpected

func (x *ContentMismatch) GetExpected() *wrapperspb.BytesValue

func (*ContentMismatch) GetMismatch

func (x *ContentMismatch) GetMismatch() string

func (*ContentMismatch) GetPath

func (x *ContentMismatch) GetPath() string

func (*ContentMismatch) ProtoMessage

func (*ContentMismatch) ProtoMessage()

func (*ContentMismatch) ProtoReflect

func (x *ContentMismatch) ProtoReflect() protoreflect.Message

func (*ContentMismatch) Reset

func (x *ContentMismatch) Reset()

func (*ContentMismatch) String

func (x *ContentMismatch) String() string

type ContentMismatches

type ContentMismatches struct {
	Mismatches []*ContentMismatch `protobuf:"bytes,1,rep,name=mismatches,proto3" json:"mismatches,omitempty"`
	// contains filtered or unexported fields
}

List of content mismatches

func (*ContentMismatches) Descriptor deprecated

func (*ContentMismatches) Descriptor() ([]byte, []int)

Deprecated: Use ContentMismatches.ProtoReflect.Descriptor instead.

func (*ContentMismatches) GetMismatches

func (x *ContentMismatches) GetMismatches() []*ContentMismatch

func (*ContentMismatches) ProtoMessage

func (*ContentMismatches) ProtoMessage()

func (*ContentMismatches) ProtoReflect

func (x *ContentMismatches) ProtoReflect() protoreflect.Message

func (*ContentMismatches) Reset

func (x *ContentMismatches) Reset()

func (*ContentMismatches) String

func (x *ContentMismatches) String() string

type ContentTypeMismatch

type ContentTypeMismatch struct {

	// Expected content type (MIME format)
	Expected string `protobuf:"bytes,1,opt,name=expected,proto3" json:"expected,omitempty"`
	// Actual content type received (MIME format)
	Actual string `protobuf:"bytes,2,opt,name=actual,proto3" json:"actual,omitempty"`
	// contains filtered or unexported fields
}

Indicates that there was a mismatch with the content type

func (*ContentTypeMismatch) Descriptor deprecated

func (*ContentTypeMismatch) Descriptor() ([]byte, []int)

Deprecated: Use ContentTypeMismatch.ProtoReflect.Descriptor instead.

func (*ContentTypeMismatch) GetActual

func (x *ContentTypeMismatch) GetActual() string

func (*ContentTypeMismatch) GetExpected

func (x *ContentTypeMismatch) GetExpected() string

func (*ContentTypeMismatch) ProtoMessage

func (*ContentTypeMismatch) ProtoMessage()

func (*ContentTypeMismatch) ProtoReflect

func (x *ContentTypeMismatch) ProtoReflect() protoreflect.Message

func (*ContentTypeMismatch) Reset

func (x *ContentTypeMismatch) Reset()

func (*ContentTypeMismatch) String

func (x *ContentTypeMismatch) String() string

type GenerateContentRequest

type GenerateContentRequest struct {

	// Original contents
	Contents *Body `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"`
	// Generators to apply
	Generators map[string]*Generator `` /* 161-byte string literal not displayed */
	// Additional data added to the Pact/Interaction by the plugin
	PluginConfiguration *PluginConfiguration `protobuf:"bytes,3,opt,name=pluginConfiguration,proto3" json:"pluginConfiguration,omitempty"`
	// contains filtered or unexported fields
}

Request to generate the contents using any defined generators

func (*GenerateContentRequest) Descriptor deprecated

func (*GenerateContentRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenerateContentRequest.ProtoReflect.Descriptor instead.

func (*GenerateContentRequest) GetContents

func (x *GenerateContentRequest) GetContents() *Body

func (*GenerateContentRequest) GetGenerators

func (x *GenerateContentRequest) GetGenerators() map[string]*Generator

func (*GenerateContentRequest) GetPluginConfiguration

func (x *GenerateContentRequest) GetPluginConfiguration() *PluginConfiguration

func (*GenerateContentRequest) ProtoMessage

func (*GenerateContentRequest) ProtoMessage()

func (*GenerateContentRequest) ProtoReflect

func (x *GenerateContentRequest) ProtoReflect() protoreflect.Message

func (*GenerateContentRequest) Reset

func (x *GenerateContentRequest) Reset()

func (*GenerateContentRequest) String

func (x *GenerateContentRequest) String() string

type GenerateContentResponse

type GenerateContentResponse struct {
	Contents *Body `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"`
	// contains filtered or unexported fields
}

Generated body/message response

func (*GenerateContentResponse) Descriptor deprecated

func (*GenerateContentResponse) Descriptor() ([]byte, []int)

Deprecated: Use GenerateContentResponse.ProtoReflect.Descriptor instead.

func (*GenerateContentResponse) GetContents

func (x *GenerateContentResponse) GetContents() *Body

func (*GenerateContentResponse) ProtoMessage

func (*GenerateContentResponse) ProtoMessage()

func (*GenerateContentResponse) ProtoReflect

func (x *GenerateContentResponse) ProtoReflect() protoreflect.Message

func (*GenerateContentResponse) Reset

func (x *GenerateContentResponse) Reset()

func (*GenerateContentResponse) String

func (x *GenerateContentResponse) String() string

type Generator

type Generator struct {

	// Type of generator
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// Associated data for the generator
	Values *structpb.Struct `protobuf:"bytes,2,opt,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Example generator

func (*Generator) Descriptor deprecated

func (*Generator) Descriptor() ([]byte, []int)

Deprecated: Use Generator.ProtoReflect.Descriptor instead.

func (*Generator) GetType

func (x *Generator) GetType() string

func (*Generator) GetValues

func (x *Generator) GetValues() *structpb.Struct

func (*Generator) ProtoMessage

func (*Generator) ProtoMessage()

func (*Generator) ProtoReflect

func (x *Generator) ProtoReflect() protoreflect.Message

func (*Generator) Reset

func (x *Generator) Reset()

func (*Generator) String

func (x *Generator) String() string

type InitPluginRequest

type InitPluginRequest struct {

	// Implementation calling the plugin
	Implementation string `protobuf:"bytes,1,opt,name=implementation,proto3" json:"implementation,omitempty"`
	// Version of the implementation
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

Request to verify the plugin has loaded OK

func (*InitPluginRequest) Descriptor deprecated

func (*InitPluginRequest) Descriptor() ([]byte, []int)

Deprecated: Use InitPluginRequest.ProtoReflect.Descriptor instead.

func (*InitPluginRequest) GetImplementation

func (x *InitPluginRequest) GetImplementation() string

func (*InitPluginRequest) GetVersion

func (x *InitPluginRequest) GetVersion() string

func (*InitPluginRequest) ProtoMessage

func (*InitPluginRequest) ProtoMessage()

func (*InitPluginRequest) ProtoReflect

func (x *InitPluginRequest) ProtoReflect() protoreflect.Message

func (*InitPluginRequest) Reset

func (x *InitPluginRequest) Reset()

func (*InitPluginRequest) String

func (x *InitPluginRequest) String() string

type InitPluginResponse

type InitPluginResponse struct {

	// List of entries the plugin supports
	Catalogue []*CatalogueEntry `protobuf:"bytes,1,rep,name=catalogue,proto3" json:"catalogue,omitempty"`
	// contains filtered or unexported fields
}

Response to init plugin, providing the catalogue entries the plugin provides

func (*InitPluginResponse) Descriptor deprecated

func (*InitPluginResponse) Descriptor() ([]byte, []int)

Deprecated: Use InitPluginResponse.ProtoReflect.Descriptor instead.

func (*InitPluginResponse) GetCatalogue

func (x *InitPluginResponse) GetCatalogue() []*CatalogueEntry

func (*InitPluginResponse) ProtoMessage

func (*InitPluginResponse) ProtoMessage()

func (*InitPluginResponse) ProtoReflect

func (x *InitPluginResponse) ProtoReflect() protoreflect.Message

func (*InitPluginResponse) Reset

func (x *InitPluginResponse) Reset()

func (*InitPluginResponse) String

func (x *InitPluginResponse) String() string

type InteractionResponse

type InteractionResponse struct {

	// Contents for the interaction
	Contents *Body `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"`
	// All matching rules to apply
	Rules map[string]*MatchingRules `` /* 151-byte string literal not displayed */
	// Generators to apply
	Generators map[string]*Generator `` /* 161-byte string literal not displayed */
	// For message interactions, any metadata to be applied
	MessageMetadata *structpb.Struct `protobuf:"bytes,4,opt,name=messageMetadata,proto3" json:"messageMetadata,omitempty"`
	// Plugin specific data to be persisted in the pact file
	PluginConfiguration *PluginConfiguration `protobuf:"bytes,5,opt,name=pluginConfiguration,proto3" json:"pluginConfiguration,omitempty"`
	// Markdown/HTML formatted text representation of the interaction
	InteractionMarkup     string                         `protobuf:"bytes,6,opt,name=interactionMarkup,proto3" json:"interactionMarkup,omitempty"`
	InteractionMarkupType InteractionResponse_MarkupType `` /* 147-byte string literal not displayed */
	// Description of what part this interaction belongs to (in the case of there being more than one, for instance,
	// request/response messages)
	PartName string `protobuf:"bytes,8,opt,name=partName,proto3" json:"partName,omitempty"`
	// contains filtered or unexported fields
}

Response to the configure/setup an interaction request

func (*InteractionResponse) Descriptor deprecated

func (*InteractionResponse) Descriptor() ([]byte, []int)

Deprecated: Use InteractionResponse.ProtoReflect.Descriptor instead.

func (*InteractionResponse) GetContents

func (x *InteractionResponse) GetContents() *Body

func (*InteractionResponse) GetGenerators

func (x *InteractionResponse) GetGenerators() map[string]*Generator

func (*InteractionResponse) GetInteractionMarkup

func (x *InteractionResponse) GetInteractionMarkup() string

func (*InteractionResponse) GetInteractionMarkupType

func (x *InteractionResponse) GetInteractionMarkupType() InteractionResponse_MarkupType

func (*InteractionResponse) GetMessageMetadata

func (x *InteractionResponse) GetMessageMetadata() *structpb.Struct

func (*InteractionResponse) GetPartName

func (x *InteractionResponse) GetPartName() string

func (*InteractionResponse) GetPluginConfiguration

func (x *InteractionResponse) GetPluginConfiguration() *PluginConfiguration

func (*InteractionResponse) GetRules

func (x *InteractionResponse) GetRules() map[string]*MatchingRules

func (*InteractionResponse) ProtoMessage

func (*InteractionResponse) ProtoMessage()

func (*InteractionResponse) ProtoReflect

func (x *InteractionResponse) ProtoReflect() protoreflect.Message

func (*InteractionResponse) Reset

func (x *InteractionResponse) Reset()

func (*InteractionResponse) String

func (x *InteractionResponse) String() string

type InteractionResponse_MarkupType

type InteractionResponse_MarkupType int32

Type of markup used

const (
	// CommonMark format
	InteractionResponse_COMMON_MARK InteractionResponse_MarkupType = 0
	// HTML format
	InteractionResponse_HTML InteractionResponse_MarkupType = 1
)

func (InteractionResponse_MarkupType) Descriptor

func (InteractionResponse_MarkupType) Enum

func (InteractionResponse_MarkupType) EnumDescriptor deprecated

func (InteractionResponse_MarkupType) EnumDescriptor() ([]byte, []int)

Deprecated: Use InteractionResponse_MarkupType.Descriptor instead.

func (InteractionResponse_MarkupType) Number

func (InteractionResponse_MarkupType) String

func (InteractionResponse_MarkupType) Type

type MatchingRule

type MatchingRule struct {

	// Type of the matching rule
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// Associated data for the matching rule
	Values *structpb.Struct `protobuf:"bytes,2,opt,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Represents a matching rule

func (*MatchingRule) Descriptor deprecated

func (*MatchingRule) Descriptor() ([]byte, []int)

Deprecated: Use MatchingRule.ProtoReflect.Descriptor instead.

func (*MatchingRule) GetType

func (x *MatchingRule) GetType() string

func (*MatchingRule) GetValues

func (x *MatchingRule) GetValues() *structpb.Struct

func (*MatchingRule) ProtoMessage

func (*MatchingRule) ProtoMessage()

func (*MatchingRule) ProtoReflect

func (x *MatchingRule) ProtoReflect() protoreflect.Message

func (*MatchingRule) Reset

func (x *MatchingRule) Reset()

func (*MatchingRule) String

func (x *MatchingRule) String() string

type MatchingRules

type MatchingRules struct {
	Rule []*MatchingRule `protobuf:"bytes,1,rep,name=rule,proto3" json:"rule,omitempty"`
	// contains filtered or unexported fields
}

List of matching rules

func (*MatchingRules) Descriptor deprecated

func (*MatchingRules) Descriptor() ([]byte, []int)

Deprecated: Use MatchingRules.ProtoReflect.Descriptor instead.

func (*MatchingRules) GetRule

func (x *MatchingRules) GetRule() []*MatchingRule

func (*MatchingRules) ProtoMessage

func (*MatchingRules) ProtoMessage()

func (*MatchingRules) ProtoReflect

func (x *MatchingRules) ProtoReflect() protoreflect.Message

func (*MatchingRules) Reset

func (x *MatchingRules) Reset()

func (*MatchingRules) String

func (x *MatchingRules) String() string

type PactPluginClient

type PactPluginClient interface {
	// Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides
	InitPlugin(ctx context.Context, in *InitPluginRequest, opts ...grpc.CallOption) (*InitPluginResponse, error)
	// Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading).
	UpdateCatalogue(ctx context.Context, in *Catalogue, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Request to perform a comparison of some contents (matching request)
	CompareContents(ctx context.Context, in *CompareContentsRequest, opts ...grpc.CallOption) (*CompareContentsResponse, error)
	// Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file.
	ConfigureInteraction(ctx context.Context, in *ConfigureInteractionRequest, opts ...grpc.CallOption) (*ConfigureInteractionResponse, error)
	// Request to generate the content using any defined generators
	GenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (*GenerateContentResponse, error)
}

PactPluginClient is the client API for PactPlugin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewPactPluginClient

func NewPactPluginClient(cc grpc.ClientConnInterface) PactPluginClient

type PactPluginServer

type PactPluginServer interface {
	// Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides
	InitPlugin(context.Context, *InitPluginRequest) (*InitPluginResponse, error)
	// Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading).
	UpdateCatalogue(context.Context, *Catalogue) (*emptypb.Empty, error)
	// Request to perform a comparison of some contents (matching request)
	CompareContents(context.Context, *CompareContentsRequest) (*CompareContentsResponse, error)
	// Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file.
	ConfigureInteraction(context.Context, *ConfigureInteractionRequest) (*ConfigureInteractionResponse, error)
	// Request to generate the content using any defined generators
	GenerateContent(context.Context, *GenerateContentRequest) (*GenerateContentResponse, error)
	// contains filtered or unexported methods
}

PactPluginServer is the server API for PactPlugin service. All implementations must embed UnimplementedPactPluginServer for forward compatibility

type PluginConfiguration

type PluginConfiguration struct {

	// Data to be persisted against the interaction
	InteractionConfiguration *structpb.Struct `protobuf:"bytes,1,opt,name=interactionConfiguration,proto3" json:"interactionConfiguration,omitempty"`
	// Data to be persisted in the Pact file metadata (Global data)
	PactConfiguration *structpb.Struct `protobuf:"bytes,2,opt,name=pactConfiguration,proto3" json:"pactConfiguration,omitempty"`
	// contains filtered or unexported fields
}

Plugin configuration added to the pact file by the ConfigureInteraction step

func (*PluginConfiguration) Descriptor deprecated

func (*PluginConfiguration) Descriptor() ([]byte, []int)

Deprecated: Use PluginConfiguration.ProtoReflect.Descriptor instead.

func (*PluginConfiguration) GetInteractionConfiguration

func (x *PluginConfiguration) GetInteractionConfiguration() *structpb.Struct

func (*PluginConfiguration) GetPactConfiguration

func (x *PluginConfiguration) GetPactConfiguration() *structpb.Struct

func (*PluginConfiguration) ProtoMessage

func (*PluginConfiguration) ProtoMessage()

func (*PluginConfiguration) ProtoReflect

func (x *PluginConfiguration) ProtoReflect() protoreflect.Message

func (*PluginConfiguration) Reset

func (x *PluginConfiguration) Reset()

func (*PluginConfiguration) String

func (x *PluginConfiguration) String() string

type UnimplementedPactPluginServer

type UnimplementedPactPluginServer struct {
}

UnimplementedPactPluginServer must be embedded to have forward compatible implementations.

func (UnimplementedPactPluginServer) CompareContents

func (UnimplementedPactPluginServer) GenerateContent

func (UnimplementedPactPluginServer) InitPlugin

func (UnimplementedPactPluginServer) UpdateCatalogue

type UnsafePactPluginServer

type UnsafePactPluginServer interface {
	// contains filtered or unexported methods
}

UnsafePactPluginServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PactPluginServer will result in compilation errors.

Jump to

Keyboard shortcuts

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