Documentation
¶
Index ¶
- type Client
- func (c *Client) GetServiceDescriptor(ctx context.Context, name string) (*descriptorpb.FileDescriptorProto, error)
- func (c *Client) GetSymbolDescriptor(ctx context.Context, symbol string) ([]*descriptorpb.FileDescriptorProto, error)
- func (c *Client) ListServices(ctx context.Context) ([]string, error)
- type Server
- func (s *Server) GetServiceDescriptor(_ context.Context, req *reflection.GetServiceDescriptorRequest) (*reflection.GetServiceDescriptorResponse, error)
- func (s *Server) GetSymbolDescriptor(_ context.Context, req *reflection.GetSymbolDescriptorRequest) (*reflection.GetSymbolDescriptorResponse, error)
- func (s *Server) ListServices(_ context.Context, _ *reflection.ListServicesRequest) (*reflection.ListServicesResponse, error)
- func (s *Server) RegisterService(server TwirpServer)
- type ServerOption
- type TwirpServer
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 NewClient ¶
func NewClient(base reflection.ServerReflectionService) *Client
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)
type Server ¶
type Server struct { reflection.TwirpServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(options ...ServerOption) *Server
func (*Server) GetServiceDescriptor ¶
func (s *Server) GetServiceDescriptor(_ context.Context, req *reflection.GetServiceDescriptorRequest) (*reflection.GetServiceDescriptorResponse, error)
func (*Server) GetSymbolDescriptor ¶
func (s *Server) GetSymbolDescriptor(_ context.Context, req *reflection.GetSymbolDescriptorRequest) (*reflection.GetSymbolDescriptorResponse, error)
func (*Server) ListServices ¶
func (s *Server) ListServices(_ context.Context, _ *reflection.ListServicesRequest) (*reflection.ListServicesResponse, error)
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.
Click to show internal directories.
Click to hide internal directories.