Back to godoc.org

Package logdog

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package logdog contains Version 1 of the LogDog Coordinator stream registration interface.

The package name here must match the protobuf package name, as the generated files will reside in the same directory.

Index

Variables

var File_go_chromium_org_luci_logdog_api_endpoints_coordinator_registration_v1_service_proto protoreflect.FileDescriptor

func FileDescriptorSet

func FileDescriptorSet() *descriptor.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterRegistrationServer

func RegisterRegistrationServer(s prpc.Registrar, srv RegistrationServer)

type DecoratedRegistration

type DecoratedRegistration struct {
	// Service is the service to decorate.
	Service RegistrationServer
	// Prelude is called for each method before forwarding the call to Service.
	// If Prelude returns an error, then the call is skipped and the error is
	// processed via the Postlude (if one is defined), or it is returned directly.
	Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error)
	// Postlude is called for each method after Service has processed the call, or
	// after the Prelude has returned an error. This takes the the Service's
	// response proto (which may be nil) and/or any error. The decorated
	// service will return the response (possibly mutated) and error that Postlude
	// returns.
	Postlude func(ctx context.Context, methodName string, rsp proto.Message, err error) error
}

func (*DecoratedRegistration) RegisterPrefix

func (s *DecoratedRegistration) RegisterPrefix(ctx context.Context, req *RegisterPrefixRequest) (rsp *RegisterPrefixResponse, err error)

type RegisterPrefixRequest

type RegisterPrefixRequest struct {

	// The log stream's project.
	Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	// The log stream prefix to register.
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// Optional information about the registering agent.
	SourceInfo []string `protobuf:"bytes,3,rep,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"`
	// Optional nonce to allow retries of this RPC. ALL CLIENTS SHOULD PROVIDE
	// THIS. The client should generate the nonce once while preparing the request
	// message, and then re-use the same nonce for retries of the request.
	//
	// The nonce should be 32 bytes of random data.
	// The nonce must not be reused between different requests (only for retries
	//   of the same request).
	//
	// NOTE: This is currently optional, but once all clients have upgraded to
	// this scheme, it will become mandatory. During the transition if this is
	// omitted, then NO RETRIES will be allowed for this request, if the server
	// processes it correctly but the client fails to get the response from the
	// server.
	OpNonce []byte `protobuf:"bytes,4,opt,name=op_nonce,json=opNonce,proto3" json:"op_nonce,omitempty"`
	// The prefix expiration time. If <= 0, the project's default prefix
	// expiration period will be applied.
	//
	// The prefix will be closed by the Coordinator after its expiration period.
	// Once closed, new stream registration requests will no longer be accepted.
	//
	// If supplied, this value should exceed the timeout of the local task, else
	// some of the task's streams may be dropped due to failing registration.
	Expiration *duration.Duration `protobuf:"bytes,10,opt,name=expiration,proto3" json:"expiration,omitempty"`
	// contains filtered or unexported fields
}

RegisterPrefixRequest registers a new Prefix with the Coordinator.

func (*RegisterPrefixRequest) Descriptor

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

Deprecated: Use RegisterPrefixRequest.ProtoReflect.Descriptor instead.

func (*RegisterPrefixRequest) GetExpiration

func (x *RegisterPrefixRequest) GetExpiration() *duration.Duration

func (*RegisterPrefixRequest) GetMessageProject

func (req *RegisterPrefixRequest) GetMessageProject() string

GetMessageProject implements ProjectBoundMessage.

func (*RegisterPrefixRequest) GetOpNonce

func (x *RegisterPrefixRequest) GetOpNonce() []byte

func (*RegisterPrefixRequest) GetPrefix

func (x *RegisterPrefixRequest) GetPrefix() string

func (*RegisterPrefixRequest) GetProject

func (x *RegisterPrefixRequest) GetProject() string

func (*RegisterPrefixRequest) GetSourceInfo

func (x *RegisterPrefixRequest) GetSourceInfo() []string

func (*RegisterPrefixRequest) ProtoMessage

func (*RegisterPrefixRequest) ProtoMessage()

func (*RegisterPrefixRequest) ProtoReflect

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

func (*RegisterPrefixRequest) Reset

func (x *RegisterPrefixRequest) Reset()

func (*RegisterPrefixRequest) String

func (x *RegisterPrefixRequest) String() string

type RegisterPrefixResponse

type RegisterPrefixResponse struct {

	// Secret is the prefix's secret. This must be included verbatim in Butler
	// bundles to assert ownership of this prefix.
	Secret []byte `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	// The name of the Pub/Sub topic to publish butlerproto-formatted Butler log
	// bundles to.
	LogBundleTopic string `protobuf:"bytes,2,opt,name=log_bundle_topic,json=logBundleTopic,proto3" json:"log_bundle_topic,omitempty"`
	// contains filtered or unexported fields
}

The response message for the RegisterPrefix RPC.

func (*RegisterPrefixResponse) Descriptor

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

Deprecated: Use RegisterPrefixResponse.ProtoReflect.Descriptor instead.

func (*RegisterPrefixResponse) GetLogBundleTopic

func (x *RegisterPrefixResponse) GetLogBundleTopic() string

func (*RegisterPrefixResponse) GetSecret

func (x *RegisterPrefixResponse) GetSecret() []byte

func (*RegisterPrefixResponse) ProtoMessage

func (*RegisterPrefixResponse) ProtoMessage()

func (*RegisterPrefixResponse) ProtoReflect

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

func (*RegisterPrefixResponse) Reset

func (x *RegisterPrefixResponse) Reset()

func (*RegisterPrefixResponse) String

func (x *RegisterPrefixResponse) String() string

type RegistrationClient

type RegistrationClient interface {
	// RegisterStream allows a Butler instance to register a log stream with the
	// Coordinator. Upon success, the Coordinator will return registration
	// information and streaming parameters to the Butler.
	//
	// This should be called by a Butler instance to gain the ability to publish
	// to a prefix space. The caller must have WRITE access to its project's
	// stream space. If WRITE access is not present, this will fail with the
	// "PermissionDenied" gRPC code.
	//
	// A stream prefix may be registered at most once. Additional registration
	// requests will fail with the "AlreadyExists" gRPC code.
	RegisterPrefix(ctx context.Context, in *RegisterPrefixRequest, opts ...grpc.CallOption) (*RegisterPrefixResponse, error)
}

RegistrationClient is the client API for Registration service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRegistrationPRPCClient

func NewRegistrationPRPCClient(client *prpc.Client) RegistrationClient

type RegistrationServer

type RegistrationServer interface {
	// RegisterStream allows a Butler instance to register a log stream with the
	// Coordinator. Upon success, the Coordinator will return registration
	// information and streaming parameters to the Butler.
	//
	// This should be called by a Butler instance to gain the ability to publish
	// to a prefix space. The caller must have WRITE access to its project's
	// stream space. If WRITE access is not present, this will fail with the
	// "PermissionDenied" gRPC code.
	//
	// A stream prefix may be registered at most once. Additional registration
	// requests will fail with the "AlreadyExists" gRPC code.
	RegisterPrefix(context.Context, *RegisterPrefixRequest) (*RegisterPrefixResponse, error)
}

RegistrationServer is the server API for Registration service.

type UnimplementedRegistrationServer

type UnimplementedRegistrationServer struct {
}

UnimplementedRegistrationServer can be embedded to have forward compatible implementations.

func (*UnimplementedRegistrationServer) RegisterPrefix

func (*UnimplementedRegistrationServer) RegisterPrefix(context.Context, *RegisterPrefixRequest) (*RegisterPrefixResponse, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier