mockgcpregistry

package
v0.0.0-...-ddc6f60 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(factory FactoryFunc)

Types

type FactoryFunc

type FactoryFunc func(env *common.MockEnvironment, storage storage.Storage) MockService

type MockService

type MockService interface {
	// Register initializes the service, normally registering the GRPC service.
	Register(grpcServer *grpc.Server)

	// NewHTTPMux creates an HTTP mux for serving http traffic
	NewHTTPMux(ctx context.Context, conn *grpc.ClientConn) (http.Handler, error)

	// ExpectedHosts is the hostname(s) we serve on e.g. foo.googleapis.com
	// We also support patterns like `{region}-foo.googleapis.com`
	ExpectedHosts() []string
}

MockService is the interface implemented by all services

type Normalizer

type Normalizer interface {
	ConfigureVisitor(url string, replacements NormalizingVisitor)
}

type NormalizingVisitor

type NormalizingVisitor interface {
	ReplacePath(path string, newValue any)
}

type Services

type Services struct {
	Services []MockService
}

func BuildAllServices

func BuildAllServices(env *common.MockEnvironment, storage storage.Storage) (*Services, error)

func (*Services) ConfigureVisitor

func (s *Services) ConfigureVisitor(url string, visitor NormalizingVisitor)

type SupportsNormalization

type SupportsNormalization interface {
	ConfigureVisitor(url string, replacements NormalizingVisitor)
}

SupportsNormalization can be implemented to support normalization

Jump to

Keyboard shortcuts

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