scribe

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

Package scribe is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Scribe_WriteBatch_FullMethodName = "/aserto.scribe.v2.Scribe/WriteBatch"
)

Variables

View Source
var File_aserto_scribe_v2_scribe_proto protoreflect.FileDescriptor
View Source
var Scribe_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.scribe.v2.Scribe",
	HandlerType: (*ScribeServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "WriteBatch",
			Handler:       _Scribe_WriteBatch_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "aserto/scribe/v2/scribe.proto",
}

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

Functions

func RegisterScribeHandler

func RegisterScribeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterScribeHandler registers the http handlers for service Scribe to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterScribeHandlerClient

func RegisterScribeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ScribeClient) error

RegisterScribeHandlerClient registers the http handlers for service Scribe to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ScribeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ScribeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ScribeClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterScribeHandlerFromEndpoint

func RegisterScribeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterScribeHandlerFromEndpoint is same as RegisterScribeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterScribeHandlerServer

func RegisterScribeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ScribeServer) error

RegisterScribeHandlerServer registers the http handlers for service Scribe to "mux". UnaryRPC :call ScribeServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterScribeHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterScribeServer

func RegisterScribeServer(s grpc.ServiceRegistrar, srv ScribeServer)

Types

type ScribeClient

type ScribeClient interface {
	WriteBatch(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[WriteBatchRequest, WriteBatchResponse], error)
}

ScribeClient is the client API for Scribe 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 NewScribeClient

func NewScribeClient(cc grpc.ClientConnInterface) ScribeClient

type ScribeServer

type ScribeServer interface {
	WriteBatch(grpc.BidiStreamingServer[WriteBatchRequest, WriteBatchResponse]) error
}

ScribeServer is the server API for Scribe service. All implementations should embed UnimplementedScribeServer for forward compatibility.

type Scribe_WriteBatchClient

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Scribe_WriteBatchServer

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type UnimplementedScribeServer

type UnimplementedScribeServer struct{}

UnimplementedScribeServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

type UnsafeScribeServer

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

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

type WriteBatchRequest

type WriteBatchRequest struct {
	Id    string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Batch []*anypb.Any `protobuf:"bytes,2,rep,name=batch,proto3" json:"batch,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteBatchRequest) Descriptor deprecated

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

Deprecated: Use WriteBatchRequest.ProtoReflect.Descriptor instead.

func (*WriteBatchRequest) GetBatch

func (x *WriteBatchRequest) GetBatch() []*anypb.Any

func (*WriteBatchRequest) GetId

func (x *WriteBatchRequest) GetId() string

func (*WriteBatchRequest) ProtoMessage

func (*WriteBatchRequest) ProtoMessage()

func (*WriteBatchRequest) ProtoReflect

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

func (*WriteBatchRequest) Reset

func (x *WriteBatchRequest) Reset()

func (*WriteBatchRequest) String

func (x *WriteBatchRequest) String() string

type WriteBatchResponse

type WriteBatchResponse struct {
	Id  string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Ack bool   `protobuf:"varint,2,opt,name=ack,proto3" json:"ack,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteBatchResponse) Descriptor deprecated

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

Deprecated: Use WriteBatchResponse.ProtoReflect.Descriptor instead.

func (*WriteBatchResponse) GetAck

func (x *WriteBatchResponse) GetAck() bool

func (*WriteBatchResponse) GetId

func (x *WriteBatchResponse) GetId() string

func (*WriteBatchResponse) ProtoMessage

func (*WriteBatchResponse) ProtoMessage()

func (*WriteBatchResponse) ProtoReflect

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

func (*WriteBatchResponse) Reset

func (x *WriteBatchResponse) Reset()

func (*WriteBatchResponse) String

func (x *WriteBatchResponse) String() string

Jump to

Keyboard shortcuts

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