logstreamv1grpc

package
v1.6.1-20230602030542-... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogStreamService_CreateLogStream_FullMethodName = "/build.bazel.remote.logstream.v1.LogStreamService/CreateLogStream"
)

Variables

View Source
var LogStreamService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "build.bazel.remote.logstream.v1.LogStreamService",
	HandlerType: (*LogStreamServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLogStream",
			Handler:    _LogStreamService_CreateLogStream_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "build/bazel/remote/logstream/v1/remote_logstream.proto",
}

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

Functions

func RegisterLogStreamServiceServer

func RegisterLogStreamServiceServer(s grpc.ServiceRegistrar, srv LogStreamServiceServer)

Types

type LogStreamServiceClient

type LogStreamServiceClient interface {
	// Create a LogStream which may be written to.
	//
	// The returned LogStream resource name will include a `write_resource_name`
	// which is the resource to use when writing to the LogStream.
	// Callers of CreateLogStream are expected to NOT publish the
	// `write_resource_name`.
	CreateLogStream(ctx context.Context, in *v1.CreateLogStreamRequest, opts ...grpc.CallOption) (*v1.LogStream, error)
}

LogStreamServiceClient is the client API for LogStreamService 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.

#### Introduction

The Log Stream API manages LogStream resources which are used to stream writes and reads of an ordered sequence of bytes of unknown eventual length.

Note that this is an API Interface and not an API Service, per the definitons at: https://cloud.google.com/apis/design/glossary

Log Stream API supports the reading of unfinalized LogStreams either by seeking or in "tail" mode, for example by end-users browsing to a build result UI interested in seeing logs from a build action as soon as they are (or as they become) available.

Reads and Writes of LogStreams are done via the Byte Stream API: https://cloud.google.com/dataproc/docs/reference/rpc/google.bytestream https://github.com/googleapis/googleapis/blob/master/google/bytestream/bytestream.proto

#### Writing LogStreams

LogStreams are written to via the Byte Stream API's `Write` RPC. Bytes written to LogStreams are expected to be committed and available for reading within a reasonable period of time (implementation-defined). Committed bytes to a LogStream cannot be overwritten, and finalized LogStreams - indicated by setting `finish_write` field in the final WriteRequest - also cannot be appended to.

When calling the Byte Stream API's `Write` RPC to write LogStreams, writers must pass the `write_resource_name` of a LogStream as `ByteStream.WriteRequest.resource_name` rather than the LogStream's `name`. Separate resource names for reading and writing allows for broadcasting the read resource name widely while simultaneously ensuring that only writer(s) with knowledge of the write resource name may have written bytes to the LogStream.

#### Reading LogStreams

Use the Byte Stream API's `Read` RPC to read LogStreams. When reading finalized LogStreams the server will stream all contents of the LogStream starting at `ByteStream.ReadRequest.read_offset`.

When reading unfinalized LogStreams the server must keep the streaming `ByteStream.Read` RPC open and send `ByteStream.ReadResponse` messages as more bytes become available or the LogStream is finalized.

#### Example Multi-Party Read/Write Flow

  1. LogStream Writer calls `CreateLogStream`
  2. LogStream Writer publishes `LogStream.name`
  3. LogStream Writer calls `ByteStream.Write` with `LogStream.write_resource_name` as `ByteStream.WriteRequest.resource_name`, `ByteStream.WriteRequest.finish_write`=false.
  4. LogStream Reader(s) call `ByteStream.Read` with the published `LogStream.name` as `ByteStream.ReadRequest.resource_name`.
  5. LogStream Service streams all committed bytes to LogStream Reader(s), leave the stream open.
  6. LogStream Writer calls `ByteStream.Write` with `LogStream.write_resource_name` as `ByteStream.WriteRequest.resource_name`, `ByteStream.WriteRequest.finish_write`=true.
  7. LogStream Service streams all remaining bytes to LogStream Reader(s), terminates the stream.

func NewLogStreamServiceClient

func NewLogStreamServiceClient(cc grpc.ClientConnInterface) LogStreamServiceClient

type LogStreamServiceServer

type LogStreamServiceServer interface {
	// Create a LogStream which may be written to.
	//
	// The returned LogStream resource name will include a `write_resource_name`
	// which is the resource to use when writing to the LogStream.
	// Callers of CreateLogStream are expected to NOT publish the
	// `write_resource_name`.
	CreateLogStream(context.Context, *v1.CreateLogStreamRequest) (*v1.LogStream, error)
}

LogStreamServiceServer is the server API for LogStreamService service. All implementations should embed UnimplementedLogStreamServiceServer for forward compatibility.

#### Introduction

The Log Stream API manages LogStream resources which are used to stream writes and reads of an ordered sequence of bytes of unknown eventual length.

Note that this is an API Interface and not an API Service, per the definitons at: https://cloud.google.com/apis/design/glossary

Log Stream API supports the reading of unfinalized LogStreams either by seeking or in "tail" mode, for example by end-users browsing to a build result UI interested in seeing logs from a build action as soon as they are (or as they become) available.

Reads and Writes of LogStreams are done via the Byte Stream API: https://cloud.google.com/dataproc/docs/reference/rpc/google.bytestream https://github.com/googleapis/googleapis/blob/master/google/bytestream/bytestream.proto

#### Writing LogStreams

LogStreams are written to via the Byte Stream API's `Write` RPC. Bytes written to LogStreams are expected to be committed and available for reading within a reasonable period of time (implementation-defined). Committed bytes to a LogStream cannot be overwritten, and finalized LogStreams - indicated by setting `finish_write` field in the final WriteRequest - also cannot be appended to.

When calling the Byte Stream API's `Write` RPC to write LogStreams, writers must pass the `write_resource_name` of a LogStream as `ByteStream.WriteRequest.resource_name` rather than the LogStream's `name`. Separate resource names for reading and writing allows for broadcasting the read resource name widely while simultaneously ensuring that only writer(s) with knowledge of the write resource name may have written bytes to the LogStream.

#### Reading LogStreams

Use the Byte Stream API's `Read` RPC to read LogStreams. When reading finalized LogStreams the server will stream all contents of the LogStream starting at `ByteStream.ReadRequest.read_offset`.

When reading unfinalized LogStreams the server must keep the streaming `ByteStream.Read` RPC open and send `ByteStream.ReadResponse` messages as more bytes become available or the LogStream is finalized.

#### Example Multi-Party Read/Write Flow

  1. LogStream Writer calls `CreateLogStream`
  2. LogStream Writer publishes `LogStream.name`
  3. LogStream Writer calls `ByteStream.Write` with `LogStream.write_resource_name` as `ByteStream.WriteRequest.resource_name`, `ByteStream.WriteRequest.finish_write`=false.
  4. LogStream Reader(s) call `ByteStream.Read` with the published `LogStream.name` as `ByteStream.ReadRequest.resource_name`.
  5. LogStream Service streams all committed bytes to LogStream Reader(s), leave the stream open.
  6. LogStream Writer calls `ByteStream.Write` with `LogStream.write_resource_name` as `ByteStream.WriteRequest.resource_name`, `ByteStream.WriteRequest.finish_write`=true.
  7. LogStream Service streams all remaining bytes to LogStream Reader(s), terminates the stream.

type UnimplementedLogStreamServiceServer

type UnimplementedLogStreamServiceServer struct{}

UnimplementedLogStreamServiceServer 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.

func (UnimplementedLogStreamServiceServer) CreateLogStream

type UnsafeLogStreamServiceServer

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

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

Source Files

  • remote_logstream_grpc.pb.go

Jump to

Keyboard shortcuts

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