Documentation ¶
Index ¶
- Constants
- Variables
- func CreateBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse
- func CreatePact(ctx context.Context, pactKey string, pact brokerpb.Pact) (*brokerpb.PublishPactResponse, error)
- func CreatePactVersion(ctx context.Context, pactVersionKey string, pactVersion brokerpb.PactVersion) (*brokerpb.PublishPactResponse, error)
- func CreateParticipant(ctx context.Context, participantKey string, participant brokerpb.Participant) (*brokerpb.PublishPactResponse, error)
- func CreateVerification(ctx context.Context, verificationKey string, ...) (*brokerpb.PublishVerificationResponse, error)
- func CreateVersion(ctx context.Context, versionKey string, version brokerpb.Version) (*brokerpb.PublishPactResponse, error)
- func DeletePactData(ctx context.Context, in *brokerpb.BaseBrokerRequest) (*pb.Response, error)
- func GenerateBrokerAPIPath(scheme string, host string, apiPath string, replacer *strings.Replacer) string
- func GenerateBrokerPactKey(tenant string, consumerParticipantID int32, providerParticipantID int32, ...) string
- func GenerateBrokerPactVersionKey(tenant string, versionID int32, pactID int32) string
- func GenerateBrokerParticipantKey(tenant string, appID string, serviceName string) string
- func GenerateBrokerTagKey(tenant string, versionID int32) string
- func GenerateBrokerVerificationKey(tenant string, pactVersionID int32, number int32) string
- func GenerateBrokerVersionKey(tenant string, number string, participantID int32) string
- func GetBrokerHomeLinksAPIS(scheme string, host string, apiKey string) string
- func GetBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse
- func GetBrokerLatestKey(tenant string) string
- func GetBrokerLatestPactIDKey() string
- func GetBrokerLatestPactVersionIDKey() string
- func GetBrokerLatestParticipantIDKey() string
- func GetBrokerLatestVerificationIDKey() string
- func GetBrokerLatestVersionIDKey() string
- func GetBrokerPactKey(tenant string) string
- func GetBrokerPactVersionKey(tenant string) string
- func GetBrokerParticipantKey(tenant string) string
- func GetBrokerRootKey() string
- func GetBrokerTagKey(tenant string) string
- func GetBrokerVerificationKey(tenant string) string
- func GetBrokerVersionKey(tenant string) string
- func GetData(ctx context.Context, key string) (int, error)
- func GetDefaultTenantProject() string
- func GetLastestVersionNumberForParticipant(ctx context.Context, tenant string, participantID int32) int32
- func GetPact(ctx context.Context, domain string, consumerParticipantID int32, ...) (*brokerpb.Pact, error)
- func GetPactVersion(ctx context.Context, domain string, versionID int32, pactID int32) (*brokerpb.PactVersion, error)
- func GetParticipant(ctx context.Context, domain string, appID string, serviceName string) (*brokerpb.Participant, error)
- func GetVersion(ctx context.Context, domain string, number string, participantID int32) (*brokerpb.Version, error)
- func InvalidInput(in *brokerpb.PublishPactRequest) bool
- func RetrieveProviderConsumerPact(ctx context.Context, in *brokerpb.GetProviderConsumerVersionPactRequest) (*brokerpb.GetProviderConsumerVersionPactResponse, int32, error)
- type BKvStore
- func (s *BKvStore) Pact() discovery.Indexer
- func (s *BKvStore) PactLatest() discovery.Indexer
- func (s *BKvStore) PactTag() discovery.Indexer
- func (s *BKvStore) PactVersion() discovery.Indexer
- func (s *BKvStore) Participant() discovery.Indexer
- func (s *BKvStore) Verification() discovery.Indexer
- func (s *BKvStore) Version() discovery.Indexer
- type Controller
- func (*Controller) DeletePacts(w http.ResponseWriter, r *http.Request)
- func (*Controller) GetAllProviderPacts(w http.ResponseWriter, r *http.Request)
- func (brokerService *Controller) GetHome(w http.ResponseWriter, r *http.Request)
- func (*Controller) GetPactsOfProvider(w http.ResponseWriter, r *http.Request)
- func (*Controller) PublishPact(w http.ResponseWriter, r *http.Request)
- func (*Controller) PublishVerificationResults(w http.ResponseWriter, r *http.Request)
- func (*Controller) RetrieveVerificationResults(w http.ResponseWriter, r *http.Request)
- func (brokerService *Controller) URLPatterns() []rest.Route
- type Service
- func (*Service) DeletePacts(ctx context.Context, in *brokerpb.BaseBrokerRequest) (*pb.Response, error)
- func (*Service) GetAllProviderPacts(ctx context.Context, in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error)
- func (*Service) GetBrokerHome(ctx context.Context, in *brokerpb.BaseBrokerRequest) (*brokerpb.BrokerHomeResponse, error)
- func (*Service) GetPactsOfProvider(ctx context.Context, in *brokerpb.GetProviderConsumerVersionPactRequest) (*brokerpb.GetProviderConsumerVersionPactResponse, error)
- func (*Service) PublishPact(ctx context.Context, in *brokerpb.PublishPactRequest) (*brokerpb.PublishPactResponse, error)
- func (*Service) PublishVerificationResults(ctx context.Context, in *brokerpb.PublishVerificationRequest) (*brokerpb.PublishVerificationResponse, error)
- func (*Service) RetrieveProviderPacts(ctx context.Context, in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error)
- func (*Service) RetrieveVerificationResults(ctx context.Context, in *brokerpb.RetrieveVerificationRequest) (*brokerpb.RetrieveVerificationResponse, error)
Constants ¶
const ( BrokerRootKey = "cse-pact" BrokerParticipantKey = "participant" BrokerVersionKey = "version" BrokerPactKey = "pact" BrokerPactVersionKey = "pact-version" BrokerPactTagKey = "pact-tag" BrokerPactVerificationKey = "verification" BrokerPactLatest = "latest" )
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" )
const DefaultScheme = "http"
Variables ¶
var ( PARTICIPANT discovery.Type VERSION discovery.Type PACT discovery.Type PactVersion discovery.Type PactTag discovery.Type VERIFICATION discovery.Type PactLatest discovery.Type )
var PactLogger *log.Logger
var ServiceAPI = &Service{}
Functions ¶
func CreateBrokerHomeResponse ¶
func CreateBrokerHomeResponse(host string, scheme string) *brokerpb.BrokerHomeResponse
CreateBrokerHomeResponse create the templated broker home response
func CreatePact ¶
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 DeletePactData ¶
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 ¶
GenerateBrokerPactVersionKey returns the pact version root key
func GenerateBrokerParticipantKey ¶
GenerateBrokerParticipantKey returns the participant key
func GenerateBrokerTagKey ¶
GenerateBrokerTagKey returns the broker tag key
func GenerateBrokerVerificationKey ¶
GenerateBrokerVerificationKey returns he verification key
func GenerateBrokerVersionKey ¶
GenerateBrokerVersionKey returns the version key
func GetBrokerHomeLinksAPIS ¶
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 ¶
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 ¶
GetBrokerPactKey returns the pact root key
func GetBrokerPactVersionKey ¶
GetBrokerPactVersionKey returns the pact version root key
func GetBrokerParticipantKey ¶
GetBrokerParticipantKey returns the participant root key
func GetBrokerTagKey ¶
GetBrokerTagKey returns the broker tag root key
func GetBrokerVerificationKey ¶
GetBrokerVerificationKey returns the verification root key
func GetBrokerVersionKey ¶
GetBrokerVersionKey returns th root version key
func GetDefaultTenantProject ¶
func GetDefaultTenantProject() string
func GetPactVersion ¶
func GetParticipant ¶
func GetVersion ¶
func InvalidInput ¶
func InvalidInput(in *brokerpb.PublishPactRequest) bool
func RetrieveProviderConsumerPact ¶
func RetrieveProviderConsumerPact(ctx context.Context, in *brokerpb.GetProviderConsumerVersionPactRequest) (*brokerpb.GetProviderConsumerVersionPactResponse, int32, error)
Types ¶
type BKvStore ¶
type BKvStore struct { }
func (*BKvStore) PactLatest ¶
func (*BKvStore) PactVersion ¶
func (*BKvStore) Participant ¶
func (*BKvStore) Verification ¶
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
type Service ¶
type Service struct { }
func (*Service) DeletePacts ¶
func (*Service) GetAllProviderPacts ¶
func (*Service) GetAllProviderPacts(ctx context.Context, in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error)
func (*Service) GetBrokerHome ¶
func (*Service) GetBrokerHome(ctx context.Context, in *brokerpb.BaseBrokerRequest) (*brokerpb.BrokerHomeResponse, error)
func (*Service) GetPactsOfProvider ¶
func (*Service) GetPactsOfProvider(ctx context.Context, in *brokerpb.GetProviderConsumerVersionPactRequest) (*brokerpb.GetProviderConsumerVersionPactResponse, error)
func (*Service) PublishPact ¶
func (*Service) PublishPact(ctx context.Context, in *brokerpb.PublishPactRequest) (*brokerpb.PublishPactResponse, error)
func (*Service) PublishVerificationResults ¶
func (*Service) PublishVerificationResults(ctx context.Context, in *brokerpb.PublishVerificationRequest) (*brokerpb.PublishVerificationResponse, error)
func (*Service) RetrieveProviderPacts ¶
func (*Service) RetrieveProviderPacts(ctx context.Context, in *brokerpb.GetAllProviderPactsRequest) (*brokerpb.GetAllProviderPactsResponse, error)
func (*Service) RetrieveVerificationResults ¶
func (*Service) RetrieveVerificationResults(ctx context.Context, in *brokerpb.RetrieveVerificationRequest) (*brokerpb.RetrieveVerificationResponse, error)