grpc

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Broker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "kubefox.proto.v1.Broker",
	HandlerType: (*BrokerServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Broker_Subscribe_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "broker_svc.proto",
}

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

Functions

func RegisterBrokerServer

func RegisterBrokerServer(s grpc.ServiceRegistrar, srv BrokerServer)

Types

type ActiveReq

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

type Broker added in v0.6.0

type BrokerClient

type BrokerClient interface {
	Subscribe(ctx context.Context, opts ...grpc.CallOption) (Broker_SubscribeClient, error)
}

BrokerClient is the client API for Broker 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 NewBrokerClient

func NewBrokerClient(cc grpc.ClientConnInterface) BrokerClient

type BrokerServer

type BrokerServer interface {
	Subscribe(Broker_SubscribeServer) error
	// contains filtered or unexported methods
}

BrokerServer is the server API for Broker service. All implementations must embed UnimplementedBrokerServer for forward compatibility

type Broker_SubscribeClient

type Broker_SubscribeClient interface {
	Send(*core.Event) error
	Recv() (*core.MatchedEvent, error)
	grpc.ClientStream
}

type Broker_SubscribeServer

type Broker_SubscribeServer interface {
	Send(*core.MatchedEvent) error
	Recv() (*core.Event, error)
	grpc.ServerStream
}

type Client

type Client struct {
	ClientOpts
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ClientOpts) *Client

func (*Client) Err

func (c *Client) Err() chan error

func (*Client) GetRequestMetadata

func (c *Client) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (*Client) Req

func (c *Client) Req() chan *ComponentEvent

func (*Client) RequireTransportSecurity

func (c *Client) RequireTransportSecurity() bool

func (*Client) SendReq

func (c *Client) SendReq(ctx context.Context, req *core.Event, start time.Time) (*core.Event, error)

func (*Client) SendReqChan

func (c *Client) SendReqChan(req *core.Event, start time.Time) (chan *core.Event, error)

func (*Client) SendResp

func (c *Client) SendResp(resp *core.Event, start time.Time) error

func (*Client) SendTelemetry added in v0.7.0

func (c *Client) SendTelemetry(spans []*telemetry.Span, logRecords []*logsv1.LogRecord)

func (*Client) ServeHTTP

func (c *Client) ServeHTTP(resp http.ResponseWriter, req *http.Request)

func (*Client) Start

func (c *Client) Start(def *api.ComponentDefinition, maxAttempts int)

Start connects to the broker and begins sending and receiving messages. It is a blocking call.

func (*Client) StartHealthSrv

func (c *Client) StartHealthSrv() error

type ClientOpts

type ClientOpts struct {
	Platform      string
	Component     *core.Component
	Pod           string
	BrokerAddr    string
	HealthSrvAddr string
	TokenPath     string
}

type ComponentEvent

type ComponentEvent struct {
	*core.MatchedEvent

	ReceivedAt time.Time
}

type UnimplementedBrokerServer

type UnimplementedBrokerServer struct {
}

UnimplementedBrokerServer must be embedded to have forward compatible implementations.

func (UnimplementedBrokerServer) Subscribe

type UnsafeBrokerServer

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

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

Jump to

Keyboard shortcuts

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