broker

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrokerRootKey             = "cse-pact"
	BrokerParticipantKey      = "participant"
	BrokerVersionKey          = "version"
	BrokerPactKey             = "pact"
	BrokerPactVersionKey      = "pact-version"
	BrokerPactTagKey          = "pact-tag"
	BrokerPactVerificationKey = "verification"
	BrokerPactLatest          = "latest"
)
View Source
const (
	HomeURL                   = "/"
	ParticipantsURL           = "/participants"
	ProviderLatestPactsURL    = "/pacts/provider/:providerId/latest"
	ProviderLatestPactsTagURL = "/pacts/provider/:providerId/latest/:tag"
	PactsLatestURL            = "/pacts/latest"

	PublishURL             = "/pacts/provider/:providerId/consumer/:consumerId/version/:number"
	PublishVerificationURL = "/pacts/provider/:providerId/consumer/:consumerId/pact-version/:pact/verification-results"
	WebhooksURL            = "/webhooks"

	CuriesURL = "/doc/:rel"
)
View Source
const DefaultScheme = "http"

Variables

View Source
var (
	PARTICIPANT  discovery.Type
	VERSION      discovery.Type
	PACT         discovery.Type
	PactVersion  discovery.Type
	PactTag      discovery.Type
	VERIFICATION discovery.Type
	PactLatest   discovery.Type
)
View Source
var PactLogger *log.Logger
View Source
var ServiceAPI = &Service{}

Functions

func CreateBrokerHomeResponse

func CreateBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse

CreateBrokerHomeResponse create the templated broker home response

func CreatePact

func CreatePact(ctx context.Context,
	pactKey string, pact brokerpb.Pact) (*brokerpb.PublishPactResponse, error)

func CreatePactVersion

func CreatePactVersion(ctx context.Context, pactVersionKey string, pactVersion brokerpb.PactVersion) (*brokerpb.PublishPactResponse, error)

func CreateParticipant

func CreateParticipant(ctx context.Context, participantKey string, participant brokerpb.Participant) (*brokerpb.PublishPactResponse, error)

func CreateVerification

func CreateVerification(ctx context.Context,
	verificationKey string, verification brokerpb.Verification) (*brokerpb.PublishVerificationResponse, error)

func CreateVersion

func CreateVersion(ctx context.Context, versionKey string,
	version brokerpb.Version) (*brokerpb.PublishPactResponse, error)

func DeletePactData

func DeletePactData(ctx context.Context,
	in *brokerpb.BaseBrokerRequest) (*pb.Response, error)

func GenerateBrokerAPIPath

func GenerateBrokerAPIPath(scheme string, host string, apiPath string,
	replacer *strings.Replacer) string

GenerateBrokerAPIPath creates the API link from the constant template

func GenerateBrokerPactKey

func GenerateBrokerPactKey(tenant string, consumerParticipantID int32,
	providerParticipantID int32, sha []byte) string

GenerateBrokerPactKey returns the pact key

func GenerateBrokerPactVersionKey

func GenerateBrokerPactVersionKey(tenant string, versionID int32, pactID int32) string

GenerateBrokerPactVersionKey returns the pact version root key

func GenerateBrokerParticipantKey

func GenerateBrokerParticipantKey(tenant string, appID string, serviceName string) string

GenerateBrokerParticipantKey returns the participant key

func GenerateBrokerTagKey

func GenerateBrokerTagKey(tenant string, versionID int32) string

GenerateBrokerTagKey returns the broker tag key

func GenerateBrokerVerificationKey

func GenerateBrokerVerificationKey(tenant string, pactVersionID int32, number int32) string

GenerateBrokerVerificationKey returns he verification key

func GenerateBrokerVersionKey

func GenerateBrokerVersionKey(tenant string, number string, participantID int32) string

GenerateBrokerVersionKey returns the version key

func GetBrokerHomeLinksAPIS

func GetBrokerHomeLinksAPIS(scheme string, host string, apiKey string) string

GetBrokerHomeLinksAPIS return the generated Home links

func GetBrokerHomeResponse

func GetBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse

GetBrokerHomeResponse gets the homeResponse from cache if it exists

func GetBrokerLatestKey

func GetBrokerLatestKey(tenant string) string

GetBrokerLatestKey returns pact related keys

func GetBrokerLatestPactIDKey

func GetBrokerLatestPactIDKey() string

GetBrokerLatestPactIDKey returns latest pact ID

func GetBrokerLatestPactVersionIDKey

func GetBrokerLatestPactVersionIDKey() string

GetBrokerLatestPactVersionIDKey returns lated pact version ID

func GetBrokerLatestParticipantIDKey

func GetBrokerLatestParticipantIDKey() string

GetBrokerLatestParticipantIDKey returns the latest participant ID

func GetBrokerLatestVerificationIDKey

func GetBrokerLatestVerificationIDKey() string

GetBrokerLatestVerificationIDKey returns the lastest verification ID

func GetBrokerLatestVersionIDKey

func GetBrokerLatestVersionIDKey() string

GetBrokerLatestVersionIDKey returns latest version ID

func GetBrokerPactKey

func GetBrokerPactKey(tenant string) string

GetBrokerPactKey returns the pact root key

func GetBrokerPactVersionKey

func GetBrokerPactVersionKey(tenant string) string

GetBrokerPactVersionKey returns the pact version root key

func GetBrokerParticipantKey

func GetBrokerParticipantKey(tenant string) string

GetBrokerParticipantKey returns the participant root key

func GetBrokerRootKey

func GetBrokerRootKey() string

GetBrokerRootKey returns url (/cse-pact)

func GetBrokerTagKey

func GetBrokerTagKey(tenant string) string

GetBrokerTagKey returns the broker tag root key

func GetBrokerVerificationKey

func GetBrokerVerificationKey(tenant string) string

GetBrokerVerificationKey returns the verification root key

func GetBrokerVersionKey

func GetBrokerVersionKey(tenant string) string

GetBrokerVersionKey returns th root version key

func GetData

func GetData(ctx context.Context, key string) (int, error)

func GetDefaultTenantProject

func GetDefaultTenantProject() string

func GetLastestVersionNumberForParticipant

func GetLastestVersionNumberForParticipant(ctx context.Context,
	tenant string, participantID int32) int32

func GetPact

func GetPact(ctx context.Context, domain string, consumerParticipantID int32, producerParticipantID int32, sha []byte) (*brokerpb.Pact, error)

func GetPactVersion

func GetPactVersion(ctx context.Context, domain string, versionID int32,
	pactID int32) (*brokerpb.PactVersion, error)

func GetParticipant

func GetParticipant(ctx context.Context, domain string, appID string,
	serviceName string) (*brokerpb.Participant, error)

func GetVersion

func GetVersion(ctx context.Context, domain string, number string,
	participantID int32) (*brokerpb.Version, error)

func InvalidInput

func InvalidInput(in *brokerpb.PublishPactRequest) bool

Types

type BKvStore

type BKvStore struct {
}

func Store

func Store() *BKvStore

func (*BKvStore) Pact

func (s *BKvStore) Pact() discovery.Indexer

func (*BKvStore) PactLatest

func (s *BKvStore) PactLatest() discovery.Indexer

func (*BKvStore) PactTag

func (s *BKvStore) PactTag() discovery.Indexer

func (*BKvStore) PactVersion

func (s *BKvStore) PactVersion() discovery.Indexer

func (*BKvStore) Participant

func (s *BKvStore) Participant() discovery.Indexer

func (*BKvStore) Verification

func (s *BKvStore) Verification() discovery.Indexer

func (*BKvStore) Version

func (s *BKvStore) Version() discovery.Indexer

type Controller

type Controller struct {
}

func (*Controller) DeletePacts

func (*Controller) DeletePacts(w http.ResponseWriter, r *http.Request)

func (*Controller) GetAllProviderPacts

func (*Controller) GetAllProviderPacts(w http.ResponseWriter, r *http.Request)

func (*Controller) GetHome

func (brokerService *Controller) GetHome(w http.ResponseWriter, r *http.Request)

func (*Controller) GetPactsOfProvider

func (*Controller) GetPactsOfProvider(w http.ResponseWriter, r *http.Request)

func (*Controller) PublishPact

func (*Controller) PublishPact(w http.ResponseWriter, r *http.Request)

func (*Controller) PublishVerificationResults

func (*Controller) PublishVerificationResults(w http.ResponseWriter, r *http.Request)

func (*Controller) RetrieveVerificationResults

func (*Controller) RetrieveVerificationResults(w http.ResponseWriter, r *http.Request)

func (*Controller) URLPatterns

func (brokerService *Controller) URLPatterns() []rest.Route

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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