Documentation ¶
Index ¶
- func CloneProto[T proto.Message](t *testing.T, in T) T
- func EqualProto(t *testing.T, expected, actual interface{})
- func NewMockRing(ingesters []ring.InstanceDesc, replicationFactor uint32) ring.ReadRing
- type FakePoolClient
- func (f FakePoolClient) Check(ctx context.Context, in *grpc_health_v1.HealthCheckRequest, ...) (*grpc_health_v1.HealthCheckResponse, error)
- func (f FakePoolClient) Close() error
- func (f FakePoolClient) Watch(ctx context.Context, in *grpc_health_v1.HealthCheckRequest, ...) (grpc_health_v1.Health_WatchClient, error)
- type InMemoryServer
- type MockRing
- func (r MockRing) CleanupShuffleShardCache(identifier string)
- func (r MockRing) Get(key uint32, op ring.Operation, buf []ring.InstanceDesc, _ []string, _ []string) (ring.ReplicationSet, error)
- func (r MockRing) GetAllHealthy(op ring.Operation) (ring.ReplicationSet, error)
- func (r MockRing) GetInstanceState(instanceID string) (ring.InstanceState, error)
- func (r MockRing) GetReplicationSetForOperation(op ring.Operation) (ring.ReplicationSet, error)
- func (r MockRing) HasInstance(instanceID string) bool
- func (r MockRing) InstancesCount() int
- func (r MockRing) ReplicationFactor() int
- func (r MockRing) ShuffleShard(identifier string, size int) ring.ReadRing
- func (r MockRing) ShuffleShardWithLookback(identifier string, size int, lookbackPeriod time.Duration, now time.Time) ring.ReadRing
- func (r MockRing) Subring(key uint32, n int) ring.ReadRing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneProto ¶
CloneProto clones a protobuf message.
func EqualProto ¶
Equal compares two protobuf messages ignoring extra generated proto fields.
func NewMockRing ¶
func NewMockRing(ingesters []ring.InstanceDesc, replicationFactor uint32) ring.ReadRing
Types ¶
type FakePoolClient ¶
type FakePoolClient struct{}
func (FakePoolClient) Check ¶
func (f FakePoolClient) Check(ctx context.Context, in *grpc_health_v1.HealthCheckRequest, opts ...grpc.CallOption) (*grpc_health_v1.HealthCheckResponse, error)
func (FakePoolClient) Close ¶
func (f FakePoolClient) Close() error
func (FakePoolClient) Watch ¶
func (f FakePoolClient) Watch(ctx context.Context, in *grpc_health_v1.HealthCheckRequest, opts ...grpc.CallOption) (grpc_health_v1.Health_WatchClient, error)
type InMemoryServer ¶
type InMemoryServer struct {
// contains filtered or unexported fields
}
InMemoryServer is an HTTP server that uses in-memory pipes instead of TCP. It supports HTTP/2 and has TLS enabled.
The Go Playground panics if we try to start a TCP-backed server. If you're not familiar with the Playground's behavior, it looks like our examples are broken. This server lets us write examples that work in the playground without abstracting over HTTP.
func NewInMemoryServer ¶
func NewInMemoryServer(handler http.Handler) *InMemoryServer
NewInMemoryServer constructs and starts an inMemoryServer.
func (*InMemoryServer) Client ¶
func (s *InMemoryServer) Client() *http.Client
Client returns an HTTP client configured to trust the server's TLS certificate and use HTTP/2 over an in-memory pipe. Automatic HTTP-level gzip compression is disabled. It closes its idle connections when the server is closed.
func (*InMemoryServer) Close ¶
func (s *InMemoryServer) Close()
Close shuts down the server, blocking until all outstanding requests have completed.
type MockRing ¶
type MockRing struct {
// contains filtered or unexported fields
}
func (MockRing) CleanupShuffleShardCache ¶
func (MockRing) GetAllHealthy ¶
func (MockRing) GetInstanceState ¶
func (r MockRing) GetInstanceState(instanceID string) (ring.InstanceState, error)