Documentation
¶
Overview ¶
* Copyright The Microcks Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- func WithArtifact(artifactFilePath string, main bool) testcontainers.CustomizeRequestOption
- func WithEnv(key, value string) testcontainers.CustomizeRequestOption
- func WithHostAccessPorts(hostAccessPorts []int) testcontainers.CustomizeRequestOption
- func WithMainArtifact(artifactFilePath string) testcontainers.CustomizeRequestOption
- func WithNetwork(networkName string) testcontainers.CustomizeRequestOption
- func WithNetworkAlias(networkName, networkAlias string) testcontainers.CustomizeRequestOption
- func WithSecondaryArtifact(artifactFilePath string) testcontainers.CustomizeRequestOption
- func WithSecret(s client.Secret) testcontainers.CustomizeRequestOption
- type MicrocksContainer
- func (container *MicrocksContainer) EventMessagesForTestCase(ctx context.Context, testResult *client.TestResult, operationName string) (*[]client.UnidirectionalEvent, error)
- func (container *MicrocksContainer) GraphQLMockEndpoint(ctx context.Context, service string, version string) (string, error)
- func (container *MicrocksContainer) GraphQLMockEndpointPath(ctx context.Context, service string, version string) string
- func (container *MicrocksContainer) GrpcMockEndpoint(ctx context.Context) (string, error)
- func (container *MicrocksContainer) HttpEndpoint(ctx context.Context) (string, error)
- func (container *MicrocksContainer) ImportAsMainArtifact(ctx context.Context, artifactFilePath string) (int, error)
- func (container *MicrocksContainer) ImportAsSecondaryArtifact(ctx context.Context, artifactFilePath string) (int, error)
- func (container *MicrocksContainer) MessagesForTestCase(ctx context.Context, testResult *client.TestResult, operationName string) (*[]client.RequestResponsePair, error)
- func (container *MicrocksContainer) RestMockEndpoint(ctx context.Context, service string, version string) (string, error)
- func (container *MicrocksContainer) RestMockEndpointPath(ctx context.Context, service string, version string) string
- func (container *MicrocksContainer) ServiceInvocationsCount(ctx context.Context, serviceName string, serviceVersion string) (int, error)
- func (container *MicrocksContainer) ServiceInvocationsCountAtDate(ctx context.Context, serviceName string, serviceVersion string, date time.Time) (int, error)
- func (container *MicrocksContainer) SoapMockEndpoint(ctx context.Context, service string, version string) (string, error)
- func (container *MicrocksContainer) SoapMockEndpointPath(ctx context.Context, service string, version string) string
- func (container *MicrocksContainer) TestEndpoint(ctx context.Context, testRequest *client.TestRequest) (*client.TestResult, error)
- func (container *MicrocksContainer) TestEndpointAsync(ctx context.Context, testRequest *client.TestRequest, ...) error
- func (container *MicrocksContainer) ValidatingRestMockEndpoint(ctx context.Context, service string, version string) (string, error)
- func (container *MicrocksContainer) ValidatingRestMockEndpointPath(ctx context.Context, service string, version string) string
- func (container *MicrocksContainer) ValidatingSoapMockEndpoint(ctx context.Context, service string, version string) (string, error)
- func (container *MicrocksContainer) ValidatingSoapMockEndpointPath(ctx context.Context, service string, version string) string
- func (container *MicrocksContainer) Verify(ctx context.Context, serviceName string, serviceVersion string) (bool, error)
- func (container *MicrocksContainer) VerifyAtDate(ctx context.Context, serviceName string, serviceVersion string, date time.Time) (bool, error)
Constants ¶
const ( DefaultImage = "quay.io/microcks/microcks-uber:latest" // DefaultHttpPort represents the default Microcks HTTP port. DefaultHttpPort = "8080/tcp" // DefaultGrpcPort represents the default Microcks GRPC port. DefaultGrpcPort = "9090/tcp" // DefaultNetworkAlias represents the default network alias of the the MicrocksContainer. DefaultNetworkAlias = "microcks" )
Variables ¶
This section is empty.
Functions ¶
func WithArtifact ¶ added in v0.2.0
WithArtifact provides paths to artifacts that will be imported within the Microcks container. Once it will be started and healthy.
func WithEnv ¶ added in v0.2.0
func WithEnv(key, value string) testcontainers.CustomizeRequestOption
WithEnv allows to add an environment variable.
func WithHostAccessPorts ¶ added in v0.2.0
func WithHostAccessPorts(hostAccessPorts []int) testcontainers.CustomizeRequestOption
WithHostAccessPorts allows to set the host access ports.
func WithMainArtifact ¶ added in v0.2.0
func WithMainArtifact(artifactFilePath string) testcontainers.CustomizeRequestOption
WithMainArtifact provides paths to artifacts that will be imported as main or main ones within the Microcks container. Once it will be started and healthy.
func WithNetwork ¶ added in v0.2.0
func WithNetwork(networkName string) testcontainers.CustomizeRequestOption
WithNetwork allows to add a custom network. Deprecated: Use network.WithNetwork from testcontainers instead.
func WithNetworkAlias ¶ added in v0.2.0
func WithNetworkAlias(networkName, networkAlias string) testcontainers.CustomizeRequestOption
WithNetworkAlias allows to add a custom network alias for a specific network. Deprecated: Use network.WithNetwork from testcontainers instead.
func WithSecondaryArtifact ¶ added in v0.2.0
func WithSecondaryArtifact(artifactFilePath string) testcontainers.CustomizeRequestOption
WithSecondaryArtifact provides paths to artifacts that will be imported as main or main ones within the Microcks container. Once it will be started and healthy.
func WithSecret ¶ added in v0.2.0
WithSecret allows to add a new secret.
Types ¶
type MicrocksContainer ¶
type MicrocksContainer struct {
testcontainers.Container
}
MicrocksContainer represents the Microcks container type used in the module.
func Run ¶ added in v0.2.0
func Run(ctx context.Context, image string, opts ...testcontainers.ContainerCustomizer) (*MicrocksContainer, error)
Run creates an instance of the MicrocksContainer type.
func RunContainer
deprecated
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*MicrocksContainer, error)
Deprecated: use Run instead RunContainer creates an instance of the MicrocksContainer type.
func (*MicrocksContainer) EventMessagesForTestCase ¶ added in v0.3.0
func (container *MicrocksContainer) EventMessagesForTestCase(ctx context.Context, testResult *client.TestResult, operationName string) (*[]client.UnidirectionalEvent, error)
EventMessagesForTestCase retrieves event messages received during a test on an endpoint.
func (*MicrocksContainer) GraphQLMockEndpoint ¶ added in v0.2.0
func (container *MicrocksContainer) GraphQLMockEndpoint(ctx context.Context, service string, version string) (string, error)
GraphQLMockEndpoint get the exposed mock endpoints for a GraphQL Service.
func (*MicrocksContainer) GraphQLMockEndpointPath ¶ added in v0.3.2
func (container *MicrocksContainer) GraphQLMockEndpointPath(ctx context.Context, service string, version string) string
GraphQLMockEndpointPath get the exposed mock endpoints path for a GraphQL Service.
func (*MicrocksContainer) GrpcMockEndpoint ¶
func (container *MicrocksContainer) GrpcMockEndpoint(ctx context.Context) (string, error)
GrpcMockEndpoint get the exposed mock endpoint for a GRPC Service.
func (*MicrocksContainer) HttpEndpoint ¶
func (container *MicrocksContainer) HttpEndpoint(ctx context.Context) (string, error)
HttpEndpoint allows retrieving the Http endpoint where Microcks can be accessed. (you'd have to append '/api' to access APIs)
func (*MicrocksContainer) ImportAsMainArtifact ¶
func (container *MicrocksContainer) ImportAsMainArtifact(ctx context.Context, artifactFilePath string) (int, error)
ImportAsMainArtifact imports an artifact as a primary or main one within the Microcks container.
func (*MicrocksContainer) ImportAsSecondaryArtifact ¶
func (container *MicrocksContainer) ImportAsSecondaryArtifact(ctx context.Context, artifactFilePath string) (int, error)
ImportAsSecondaryArtifact imports an artifact as a secondary one within the Microcks container.
func (*MicrocksContainer) MessagesForTestCase ¶ added in v0.3.0
func (container *MicrocksContainer) MessagesForTestCase(ctx context.Context, testResult *client.TestResult, operationName string) (*[]client.RequestResponsePair, error)
MessagesForTestCase retrieves messages exchanged during a test on an endpoint.
func (*MicrocksContainer) RestMockEndpoint ¶
func (container *MicrocksContainer) RestMockEndpoint(ctx context.Context, service string, version string) (string, error)
RestMockEndpoint get the exposed mock endpoint for a REST Service.
func (*MicrocksContainer) RestMockEndpointPath ¶ added in v0.3.2
func (container *MicrocksContainer) RestMockEndpointPath(ctx context.Context, service string, version string) string
RestMockEndpointPath get the exposed mock endpoint path for a REST Service.
func (*MicrocksContainer) ServiceInvocationsCount ¶ added in v0.3.0
func (container *MicrocksContainer) ServiceInvocationsCount(ctx context.Context, serviceName string, serviceVersion string) (int, error)
ServiceInvocationsCount gets the invocations' count for a given service, identified by its name and version, for the current date.
func (*MicrocksContainer) ServiceInvocationsCountAtDate ¶ added in v0.3.0
func (container *MicrocksContainer) ServiceInvocationsCountAtDate(ctx context.Context, serviceName string, serviceVersion string, date time.Time) (int, error)
ServiceInvocationsCountAtDate gets the invocations' count for a given service, identified by its name and version, for the given invocations' date.
func (*MicrocksContainer) SoapMockEndpoint ¶
func (container *MicrocksContainer) SoapMockEndpoint(ctx context.Context, service string, version string) (string, error)
SoapMockEndpoint get the exposed mock endpoint for a SOAP Service.
func (*MicrocksContainer) SoapMockEndpointPath ¶ added in v0.3.2
func (container *MicrocksContainer) SoapMockEndpointPath(ctx context.Context, service string, version string) string
SoapMockEndpointPath get the exposed mock endpoint path for a SOAP Service.
func (*MicrocksContainer) TestEndpoint ¶
func (container *MicrocksContainer) TestEndpoint(ctx context.Context, testRequest *client.TestRequest) (*client.TestResult, error)
TestEndpoint launches a conformance test on an endpoint.
func (*MicrocksContainer) TestEndpointAsync ¶ added in v0.2.0
func (container *MicrocksContainer) TestEndpointAsync(ctx context.Context, testRequest *client.TestRequest, testResult chan *client.TestResult) error
TestEndpointAsync launches a conformance test on an endpoint and will provide result via a channel.
func (*MicrocksContainer) ValidatingRestMockEndpoint ¶ added in v0.3.2
func (container *MicrocksContainer) ValidatingRestMockEndpoint(ctx context.Context, service string, version string) (string, error)
ValidatingRestMockEndpoint get the exposed mock endpoint - with request validation enabled - for a REST Service.
func (*MicrocksContainer) ValidatingRestMockEndpointPath ¶ added in v0.3.2
func (container *MicrocksContainer) ValidatingRestMockEndpointPath(ctx context.Context, service string, version string) string
ValidatingRestMockEndpointPath get the exposed mock endpoint path - with request validation enabled - for a REST Service.
func (*MicrocksContainer) ValidatingSoapMockEndpoint ¶ added in v0.3.2
func (container *MicrocksContainer) ValidatingSoapMockEndpoint(ctx context.Context, service string, version string) (string, error)
ValidatingSoapMockEndpoint get the exposed mock endpoint - with request validation enabled - for a SOAP Service.
func (*MicrocksContainer) ValidatingSoapMockEndpointPath ¶ added in v0.3.2
func (container *MicrocksContainer) ValidatingSoapMockEndpointPath(ctx context.Context, service string, version string) string
ValidatingSoapMockEndpointPath get the exposed mock endpoint path - with request validation enabled - for a SOAP Service.
func (*MicrocksContainer) Verify ¶ added in v0.3.0
func (container *MicrocksContainer) Verify(ctx context.Context, serviceName string, serviceVersion string) (bool, error)
Verify checks that given Service has been invoked at least one time, for the current invocations' date.
func (*MicrocksContainer) VerifyAtDate ¶ added in v0.3.0
func (container *MicrocksContainer) VerifyAtDate(ctx context.Context, serviceName string, serviceVersion string, date time.Time) (bool, error)
VerifyAtDate checks that given Service has been invoked at least one time, for the given invocations' date.
Directories
¶
Path | Synopsis |
---|---|
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
async
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
async/connection/amazonservice
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
async/connection/generic
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
async/connection/kafka
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
postman
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
internal
|
|
test
* Copyright The Microcks Authors.
|
* Copyright The Microcks Authors. |
* This is local copy of testcontainers/testcontainers/go/modules/kafka/kafka.go with modified startup script for * the purpose of fully working demonstration.
|
* This is local copy of testcontainers/testcontainers/go/modules/kafka/kafka.go with modified startup script for * the purpose of fully working demonstration. |