Documentation ¶
Index ¶
- Variables
- func New(vp *viper.Viper) *cobra.Command
- type IOReaderObserver
- func (o *IOReaderObserver) GetAgentEvents(_ context.Context, _ *observerpb.GetAgentEventsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetAgentEventsClient, error)
- func (o *IOReaderObserver) GetDebugEvents(_ context.Context, _ *observerpb.GetDebugEventsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetDebugEventsClient, error)
- func (o *IOReaderObserver) GetFlows(ctx context.Context, in *observerpb.GetFlowsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetFlowsClient, error)
- func (o *IOReaderObserver) GetNamespaces(_ context.Context, _ *observerpb.GetNamespacesRequest, _ ...grpc.CallOption) (*observerpb.GetNamespacesResponse, error)
- func (o *IOReaderObserver) GetNodes(_ context.Context, _ *observerpb.GetNodesRequest, _ ...grpc.CallOption) (*observerpb.GetNodesResponse, error)
- func (o *IOReaderObserver) ServerStatus(_ context.Context, _ *observerpb.ServerStatusRequest, _ ...grpc.CallOption) (*observerpb.ServerStatusResponse, error)
Constants ¶
This section is empty.
Variables ¶
var GetHubbleClientFunc = func(ctx context.Context, vp *viper.Viper) (client observerpb.ObserverClient, cleanup func() error, err error) { if otherOpts.inputFile != "" { if vp.GetBool(config.KeyPortForward) { return nil, nil, fmt.Errorf("cannot use --input-file and --auto-port-forward together") } var f *os.File if otherOpts.inputFile == "-" { f = os.Stdin cleanup = func() error { return nil } } else { f, err = os.Open(otherOpts.inputFile) if err != nil { return nil, nil, err } cleanup = f.Close } client = NewIOReaderObserver(f) return client, cleanup, nil } hubbleConn, err := conn.NewWithFlags(ctx, vp) if err != nil { return nil, nil, err } logger.Logger.Debug("connected to Hubble API", "server", config.KeyServer) cleanup = hubbleConn.Close client = observerpb.NewObserverClient(hubbleConn) return client, cleanup, nil }
GetHubbleClientFunc is primarily used to mock out the hubble client in some unit tests.
Functions ¶
Types ¶
type IOReaderObserver ¶
type IOReaderObserver struct {
// contains filtered or unexported fields
}
IOReaderObserver implements ObserverClient interface. It reads flows in jsonpb format from an io.Reader.
func NewIOReaderObserver ¶
func NewIOReaderObserver(reader io.Reader) *IOReaderObserver
NewIOReaderObserver reads flows in jsonpb format from an io.Reader and returns a IOReaderObserver that implements the ObserverClient interface.
func (*IOReaderObserver) GetAgentEvents ¶
func (o *IOReaderObserver) GetAgentEvents(_ context.Context, _ *observerpb.GetAgentEventsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetAgentEventsClient, error)
GetAgentEvents is not implemented, and will throw an error if used.
func (*IOReaderObserver) GetDebugEvents ¶
func (o *IOReaderObserver) GetDebugEvents(_ context.Context, _ *observerpb.GetDebugEventsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetDebugEventsClient, error)
GetDebugEvents is not implemented, and will throw an error if used.
func (*IOReaderObserver) GetFlows ¶
func (o *IOReaderObserver) GetFlows(ctx context.Context, in *observerpb.GetFlowsRequest, _ ...grpc.CallOption) (observerpb.Observer_GetFlowsClient, error)
GetFlows returns flows
func (*IOReaderObserver) GetNamespaces ¶
func (o *IOReaderObserver) GetNamespaces(_ context.Context, _ *observerpb.GetNamespacesRequest, _ ...grpc.CallOption) (*observerpb.GetNamespacesResponse, error)
GetNamespaces is not implemented, and will throw an error if used.
func (*IOReaderObserver) GetNodes ¶
func (o *IOReaderObserver) GetNodes(_ context.Context, _ *observerpb.GetNodesRequest, _ ...grpc.CallOption) (*observerpb.GetNodesResponse, error)
GetNodes is not implemented, and will throw an error if used.
func (*IOReaderObserver) ServerStatus ¶
func (o *IOReaderObserver) ServerStatus(_ context.Context, _ *observerpb.ServerStatusRequest, _ ...grpc.CallOption) (*observerpb.ServerStatusResponse, error)
ServerStatus is not implemented, and will throw an error if used.