plumbing

package
v0.0.0-...-2e17403 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DopplerIngestor_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "plumbing.DopplerIngestor",
	HandlerType: (*DopplerIngestorServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Pusher",
			Handler:       _DopplerIngestor_Pusher_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "loggregator-release/src/plumbing/doppler.proto",
}

DopplerIngestor_ServiceDesc is the grpc.ServiceDesc for DopplerIngestor service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Doppler_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "plumbing.Doppler",
	HandlerType: (*DopplerServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Doppler_Subscribe_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "BatchSubscribe",
			Handler:       _Doppler_BatchSubscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "loggregator-release/src/plumbing/doppler.proto",
}

Doppler_ServiceDesc is the grpc.ServiceDesc for Doppler service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_loggregator_release_src_plumbing_doppler_proto protoreflect.FileDescriptor

Functions

func NewClientCredentials

func NewClientCredentials(
	certFile string,
	keyFile string,
	caCertFile string,
	serverName string,
) (credentials.TransportCredentials, error)

NewClientCredentials returns gRPC credentials for dialing.

func NewServerCredentials

func NewServerCredentials(
	certFile string,
	keyFile string,
	caCertFile string,
	opts ...ConfigOption,
) (credentials.TransportCredentials, error)

NewServerCredentials returns gRPC credentials for a server.

func RegisterDopplerIngestorServer

func RegisterDopplerIngestorServer(s grpc.ServiceRegistrar, srv DopplerIngestorServer)

func RegisterDopplerServer

func RegisterDopplerServer(s grpc.ServiceRegistrar, srv DopplerServer)

Types

type BatchResponse

type BatchResponse struct {
	Payload [][]byte `protobuf:"bytes,1,rep,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*BatchResponse) Descriptor deprecated

func (*BatchResponse) Descriptor() ([]byte, []int)

Deprecated: Use BatchResponse.ProtoReflect.Descriptor instead.

func (*BatchResponse) GetPayload

func (x *BatchResponse) GetPayload() [][]byte

func (*BatchResponse) ProtoMessage

func (*BatchResponse) ProtoMessage()

func (*BatchResponse) ProtoReflect

func (x *BatchResponse) ProtoReflect() protoreflect.Message

func (*BatchResponse) Reset

func (x *BatchResponse) Reset()

func (*BatchResponse) String

func (x *BatchResponse) String() string

type ConfigOption

type ConfigOption func(*tls.Config)

ConfigOption is used when configuring a new tls.Config.

func WithCipherSuites

func WithCipherSuites(ciphers []string) ConfigOption

WithCipherSuites is used to override the default cipher suites.

type DopplerClient

type DopplerClient interface {
	Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (Doppler_SubscribeClient, error)
	BatchSubscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (Doppler_BatchSubscribeClient, error)
}

DopplerClient is the client API for Doppler service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewDopplerClient

func NewDopplerClient(cc grpc.ClientConnInterface) DopplerClient

type DopplerIngestorClient

type DopplerIngestorClient interface {
	Pusher(ctx context.Context, opts ...grpc.CallOption) (DopplerIngestor_PusherClient, error)
}

DopplerIngestorClient is the client API for DopplerIngestor service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type DopplerIngestorServer

type DopplerIngestorServer interface {
	Pusher(DopplerIngestor_PusherServer) error
	// contains filtered or unexported methods
}

DopplerIngestorServer is the server API for DopplerIngestor service. All implementations must embed UnimplementedDopplerIngestorServer for forward compatibility

type DopplerIngestor_PusherClient

type DopplerIngestor_PusherClient interface {
	Send(*EnvelopeData) error
	CloseAndRecv() (*PushResponse, error)
	grpc.ClientStream
}

type DopplerIngestor_PusherServer

type DopplerIngestor_PusherServer interface {
	SendAndClose(*PushResponse) error
	Recv() (*EnvelopeData, error)
	grpc.ServerStream
}

type DopplerPool

type DopplerPool interface {
	RegisterDoppler(addr string)
	Subscribe(dopplerAddr string, ctx context.Context, req *SubscriptionRequest) (Doppler_BatchSubscribeClient, error)

	Close(dopplerAddr string)
}

DopplerPool creates a pool of doppler gRPC connections

type DopplerServer

type DopplerServer interface {
	Subscribe(*SubscriptionRequest, Doppler_SubscribeServer) error
	BatchSubscribe(*SubscriptionRequest, Doppler_BatchSubscribeServer) error
	// contains filtered or unexported methods
}

DopplerServer is the server API for Doppler service. All implementations must embed UnimplementedDopplerServer for forward compatibility

type Doppler_BatchSubscribeClient

type Doppler_BatchSubscribeClient interface {
	Recv() (*BatchResponse, error)
	grpc.ClientStream
}

type Doppler_BatchSubscribeServer

type Doppler_BatchSubscribeServer interface {
	Send(*BatchResponse) error
	grpc.ServerStream
}

type Doppler_SubscribeClient

type Doppler_SubscribeClient interface {
	Recv() (*Response, error)
	grpc.ClientStream
}

type Doppler_SubscribeServer

type Doppler_SubscribeServer interface {
	Send(*Response) error
	grpc.ServerStream
}

type EnvelopeAverager

type EnvelopeAverager struct {
	// contains filtered or unexported fields
}

EnvelopeAverager implements google.golang.org/grpc/stats.Handler and keeps track of the average envelope size emitted by a grpc client. It should be constructed with NewEnvelopeAverager.

Note: Track is on a very "hot" path. Care should be taken while altering any algorithms, and performance must be considered.

func NewEnvelopeAverager

func NewEnvelopeAverager() *EnvelopeAverager

NewEnvelopeAverager creates a new EnvelopeAverager.

func (*EnvelopeAverager) Start

func (a *EnvelopeAverager) Start(interval time.Duration, f func(average float64))

Start invokes the given callback with the average envelope size of the past interval.

func (*EnvelopeAverager) Track

func (a *EnvelopeAverager) Track(count, size int)

Track takes the given envelope size (in bytes) to use in the current average calculation. It can be called by several go-routines.

type EnvelopeData

type EnvelopeData struct {
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*EnvelopeData) Descriptor deprecated

func (*EnvelopeData) Descriptor() ([]byte, []int)

Deprecated: Use EnvelopeData.ProtoReflect.Descriptor instead.

func (*EnvelopeData) GetPayload

func (x *EnvelopeData) GetPayload() []byte

func (*EnvelopeData) ProtoMessage

func (*EnvelopeData) ProtoMessage()

func (*EnvelopeData) ProtoReflect

func (x *EnvelopeData) ProtoReflect() protoreflect.Message

func (*EnvelopeData) Reset

func (x *EnvelopeData) Reset()

func (*EnvelopeData) String

func (x *EnvelopeData) String() string

type Event

type Event struct {
	GRPCDopplers []string
}

type Filter

type Filter struct {
	AppID string `protobuf:"bytes,1,opt,name=appID,proto3" json:"appID,omitempty"`
	// Types that are assignable to Message:
	//	*Filter_Log
	//	*Filter_Metric
	Message isFilter_Message `protobuf_oneof:"Message"`
	// contains filtered or unexported fields
}

func (*Filter) Descriptor deprecated

func (*Filter) Descriptor() ([]byte, []int)

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetAppID

func (x *Filter) GetAppID() string

func (*Filter) GetLog

func (x *Filter) GetLog() *LogFilter

func (*Filter) GetMessage

func (m *Filter) GetMessage() isFilter_Message

func (*Filter) GetMetric

func (x *Filter) GetMetric() *MetricFilter

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect

func (x *Filter) ProtoReflect() protoreflect.Message

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

type Filter_Log

type Filter_Log struct {
	Log *LogFilter `protobuf:"bytes,2,opt,name=log,proto3,oneof"`
}

type Filter_Metric

type Filter_Metric struct {
	Metric *MetricFilter `protobuf:"bytes,3,opt,name=metric,proto3,oneof"`
}

type Finder

type Finder interface {
	Next() Event
}

Finder yields events that tell us what dopplers are available.

type GRPCConnector

type GRPCConnector struct {
	// contains filtered or unexported fields
}

GRPCConnector establishes GRPC connections to dopplers and allows calls to Firehose, Stream, etc to be reduced down to a single Receiver.

func NewGRPCConnector

func NewGRPCConnector(
	bufferSize int,
	pool DopplerPool,
	f Finder,
	m MetricClient,
) *GRPCConnector

NewGRPCConnector creates a new GRPCConnector.

func (*GRPCConnector) Subscribe

func (c *GRPCConnector) Subscribe(ctx context.Context, req *SubscriptionRequest) (recv func() ([]byte, error), err error)

Subscribe returns a Receiver that yields all corresponding messages from Doppler

type LogFilter

type LogFilter struct {
	// contains filtered or unexported fields
}

func (*LogFilter) Descriptor deprecated

func (*LogFilter) Descriptor() ([]byte, []int)

Deprecated: Use LogFilter.ProtoReflect.Descriptor instead.

func (*LogFilter) ProtoMessage

func (*LogFilter) ProtoMessage()

func (*LogFilter) ProtoReflect

func (x *LogFilter) ProtoReflect() protoreflect.Message

func (*LogFilter) Reset

func (x *LogFilter) Reset()

func (*LogFilter) String

func (x *LogFilter) String() string

type LogWriter

type LogWriter struct {
}

func (LogWriter) Write

func (writer LogWriter) Write(bytes []byte) (int, error)

type MetricClient

type MetricClient interface {
	NewCounter(name string, opts ...metricemitter.MetricOption) *metricemitter.Counter
}

MetricClient creates new CounterMetrics to be emitted periodically.

type MetricFilter

type MetricFilter struct {
	// contains filtered or unexported fields
}

func (*MetricFilter) Descriptor deprecated

func (*MetricFilter) Descriptor() ([]byte, []int)

Deprecated: Use MetricFilter.ProtoReflect.Descriptor instead.

func (*MetricFilter) ProtoMessage

func (*MetricFilter) ProtoMessage()

func (*MetricFilter) ProtoReflect

func (x *MetricFilter) ProtoReflect() protoreflect.Message

func (*MetricFilter) Reset

func (x *MetricFilter) Reset()

func (*MetricFilter) String

func (x *MetricFilter) String() string

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(opts ...grpc.DialOption) *Pool

func (*Pool) Close

func (p *Pool) Close(dopplerAddr string)

func (*Pool) RegisterDoppler

func (p *Pool) RegisterDoppler(addr string)

func (*Pool) Size

func (p *Pool) Size() int

func (*Pool) Subscribe

func (p *Pool) Subscribe(dopplerAddr string, ctx context.Context, req *SubscriptionRequest) (Doppler_BatchSubscribeClient, error)

type PushResponse

type PushResponse struct {
	// contains filtered or unexported fields
}

func (*PushResponse) Descriptor deprecated

func (*PushResponse) Descriptor() ([]byte, []int)

Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.

func (*PushResponse) ProtoMessage

func (*PushResponse) ProtoMessage()

func (*PushResponse) ProtoReflect

func (x *PushResponse) ProtoReflect() protoreflect.Message

func (*PushResponse) Reset

func (x *PushResponse) Reset()

func (*PushResponse) String

func (x *PushResponse) String() string

type Response

type Response struct {
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Note: Ideally this would be EnvelopeData but for the time being we do not want to pay the cost of planning an upgrade path for this to be renamed.

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetPayload

func (x *Response) GetPayload() []byte

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type StaticFinder

type StaticFinder struct {
	// contains filtered or unexported fields
}

func NewStaticFinder

func NewStaticFinder(addrs []string) *StaticFinder

func (*StaticFinder) Next

func (f *StaticFinder) Next() Event

func (*StaticFinder) Start

func (f *StaticFinder) Start()

func (*StaticFinder) Stop

func (f *StaticFinder) Stop()

type SubscriptionRequest

type SubscriptionRequest struct {
	ShardID string  `protobuf:"bytes,1,opt,name=shardID,proto3" json:"shardID,omitempty"`
	Filter  *Filter `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriptionRequest) Descriptor deprecated

func (*SubscriptionRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubscriptionRequest.ProtoReflect.Descriptor instead.

func (*SubscriptionRequest) GetFilter

func (x *SubscriptionRequest) GetFilter() *Filter

func (*SubscriptionRequest) GetShardID

func (x *SubscriptionRequest) GetShardID() string

func (*SubscriptionRequest) ProtoMessage

func (*SubscriptionRequest) ProtoMessage()

func (*SubscriptionRequest) ProtoReflect

func (x *SubscriptionRequest) ProtoReflect() protoreflect.Message

func (*SubscriptionRequest) Reset

func (x *SubscriptionRequest) Reset()

func (*SubscriptionRequest) String

func (x *SubscriptionRequest) String() string

type UnimplementedDopplerIngestorServer

type UnimplementedDopplerIngestorServer struct {
}

UnimplementedDopplerIngestorServer must be embedded to have forward compatible implementations.

func (UnimplementedDopplerIngestorServer) Pusher

type UnimplementedDopplerServer

type UnimplementedDopplerServer struct {
}

UnimplementedDopplerServer must be embedded to have forward compatible implementations.

func (UnimplementedDopplerServer) BatchSubscribe

func (UnimplementedDopplerServer) Subscribe

type UnsafeDopplerIngestorServer

type UnsafeDopplerIngestorServer interface {
	// contains filtered or unexported methods
}

UnsafeDopplerIngestorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DopplerIngestorServer will result in compilation errors.

type UnsafeDopplerServer

type UnsafeDopplerServer interface {
	// contains filtered or unexported methods
}

UnsafeDopplerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DopplerServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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