discovery

package
v0.0.0-...-d60a78d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 31

Documentation

Overview

Package discovery implements RPC service introspection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(server *prpc.Server)

Enable registers a discovery service on the server. It makes all currently registered services and the discovery service discoverable.

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 GetDescriptorSet

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

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 wit gzip. It must contain descriptions for all the services, their message types and all transitive dependencies.

This call is cheap.

func RegisterDiscoveryServer

func RegisterDiscoveryServer(s prpc.Registrar, srv DiscoveryServer)

Types

type DescribeResponse

type DescribeResponse struct {
	// Description contains descriptions of all services, their types and all
	// transitive dependencies.
	Description *descriptor.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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

DescribeResponse describes services.

func (*DescribeResponse) Descriptor

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

func (*DescribeResponse) GetDescription

func (m *DescribeResponse) GetDescription() *descriptor.FileDescriptorSet

func (*DescribeResponse) GetServices

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

func (*DescribeResponse) ProtoMessage

func (*DescribeResponse) ProtoMessage()

func (*DescribeResponse) Reset

func (m *DescribeResponse) Reset()

func (*DescribeResponse) String

func (m *DescribeResponse) String() string

func (*DescribeResponse) XXX_DiscardUnknown

func (m *DescribeResponse) XXX_DiscardUnknown()

func (*DescribeResponse) XXX_Marshal

func (m *DescribeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DescribeResponse) XXX_Merge

func (m *DescribeResponse) XXX_Merge(src proto.Message)

func (*DescribeResponse) XXX_Size

func (m *DescribeResponse) XXX_Size() int

func (*DescribeResponse) XXX_Unmarshal

func (m *DescribeResponse) XXX_Unmarshal(b []byte) error

type DiscoveryClient

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

func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient

func NewDiscoveryPRPCClient

func NewDiscoveryPRPCClient(client *prpc.Client) DiscoveryClient

type DiscoveryServer

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

func New(serviceNames ...string) (DiscoveryServer, error)

New creates a discovery server for all the given services. The service descriptions must be registered using RegisterDescriptorSetCompressed which is called by init() function generated by go.chromium.org/luci/grpc/cmd/cproto.

type Void

type Void struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Void is an empty message.

func (*Void) Descriptor

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

func (*Void) ProtoMessage

func (*Void) ProtoMessage()

func (*Void) Reset

func (m *Void) Reset()

func (*Void) String

func (m *Void) String() string

func (*Void) XXX_DiscardUnknown

func (m *Void) XXX_DiscardUnknown()

func (*Void) XXX_Marshal

func (m *Void) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Void) XXX_Merge

func (m *Void) XXX_Merge(src proto.Message)

func (*Void) XXX_Size

func (m *Void) XXX_Size() int

func (*Void) XXX_Unmarshal

func (m *Void) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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