luci: go.chromium.org/luci/grpc/discovery Index | Files

package discovery

import "go.chromium.org/luci/grpc/discovery"

Package discovery implements RPC service introspection.

Index

Package Files

discovery.go generate.go pb.discovery.go registry.go service.pb.go

Variables

var File_go_chromium_org_luci_grpc_discovery_service_proto protoreflect.FileDescriptor

func Enable Uses

func Enable(server *prpc.Server)

Enable registers a discovery service in the server.

It makes all services registered in the server (now or later), including the discovery service itself, discoverable.

func FileDescriptorSet Uses

func FileDescriptorSet() *descriptorpb.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 GetDescriptorSet Uses

func GetDescriptorSet(serviceName string) (*descriptor.FileDescriptorSet, error)

GetDescriptorSet returns a descriptor set that contains the request service, its message types and all transitive dependencies. Returns (nil, nil) if the service descriptor is unknown.

Do NOT modify the returned descriptor.

func RegisterDescriptorSetCompressed Uses

func RegisterDescriptorSetCompressed(serviceNames []string, compressedDescriptorSet []byte)

RegisterDescriptorSetCompressed registers a descriptor set for a set of services. Called from code generated by go.chromium.org/luci/grpc/cmd/cproto

compressedDescriptorSet must be a valid descriptor.FileDescriptorSet message compressed with gzip. It must contain descriptions for all the services, their message types and all transitive dependencies.

This call is cheap.

func RegisterDiscoveryServer Uses

func RegisterDiscoveryServer(s prpc.Registrar, srv DiscoveryServer)

type DescribeResponse Uses

type DescribeResponse struct {

    // Description contains descriptions of all services, their types and all
    // transitive dependencies.
    Description *descriptorpb.FileDescriptorSet `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
    // Services are service names provided by a server.
    Services []string `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"`
    // contains filtered or unexported fields
}

DescribeResponse describes services.

func (*DescribeResponse) Descriptor Uses

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

Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead.

func (*DescribeResponse) GetDescription Uses

func (x *DescribeResponse) GetDescription() *descriptorpb.FileDescriptorSet

func (*DescribeResponse) GetServices Uses

func (x *DescribeResponse) GetServices() []string

func (*DescribeResponse) ProtoMessage Uses

func (*DescribeResponse) ProtoMessage()

func (*DescribeResponse) ProtoReflect Uses

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

func (*DescribeResponse) Reset Uses

func (x *DescribeResponse) Reset()

func (*DescribeResponse) String Uses

func (x *DescribeResponse) String() string

type DiscoveryClient Uses

type DiscoveryClient interface {
    // Describe returns a list of services and a descriptor.FileDescriptorSet
    // that covers them all.
    Describe(ctx context.Context, in *Void, opts ...grpc.CallOption) (*DescribeResponse, error)
}

DiscoveryClient is the client API for Discovery service.

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

func NewDiscoveryClient Uses

func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient

func NewDiscoveryPRPCClient Uses

func NewDiscoveryPRPCClient(client *prpc.Client) DiscoveryClient

type DiscoveryServer Uses

type DiscoveryServer interface {
    // Describe returns a list of services and a descriptor.FileDescriptorSet
    // that covers them all.
    Describe(context.Context, *Void) (*DescribeResponse, error)
}

DiscoveryServer is the server API for Discovery service.

func New Uses

func New(serviceNames ...string) DiscoveryServer

New creates a discovery server for all given services.

Service names have form "<pkg>.<service>", where "<pkg>" is name of the proto package and "<service>" is name of the service in the proto.

The service descriptions must be registered already using RegisterDescriptorSetCompressed which is called by init() function generated by go.chromium.org/luci/grpc/cmd/cproto.

type UnimplementedDiscoveryServer Uses

type UnimplementedDiscoveryServer struct {
}

UnimplementedDiscoveryServer can be embedded to have forward compatible implementations.

func (*UnimplementedDiscoveryServer) Describe Uses

func (*UnimplementedDiscoveryServer) Describe(context.Context, *Void) (*DescribeResponse, error)

type Void Uses

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

Void is an empty message.

func (*Void) Descriptor Uses

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

Deprecated: Use Void.ProtoReflect.Descriptor instead.

func (*Void) ProtoMessage Uses

func (*Void) ProtoMessage()

func (*Void) ProtoReflect Uses

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

func (*Void) Reset Uses

func (x *Void) Reset()

func (*Void) String Uses

func (x *Void) String() string

Package discovery imports 18 packages (graph) and is imported by 64 packages. Updated 2020-12-05. Refresh now. Tools for package owners.