reflection

package
v0.0.0-...-3c776f6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) GetServiceDescriptor

func (c *Client) GetServiceDescriptor(ctx context.Context, name string) (*descriptorpb.FileDescriptorProto, error)

func (*Client) GetSymbolDescriptor

func (c *Client) GetSymbolDescriptor(ctx context.Context, symbol string) ([]*descriptorpb.FileDescriptorProto, error)

func (*Client) ListServices

func (c *Client) ListServices(ctx context.Context) ([]string, error)

type Server

type Server struct {
	reflection.TwirpServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(options ...ServerOption) *Server

func (*Server) RegisterService

func (s *Server) RegisterService(server TwirpServer)

type ServerOption

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

type TwirpServer

type TwirpServer interface {
	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support.

Jump to

Keyboard shortcuts

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