Documentation
¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type GetServiceDescriptorRequest
- func (*GetServiceDescriptorRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetServiceDescriptorRequest) GetName() string
- func (*GetServiceDescriptorRequest) ProtoMessage()
- func (x *GetServiceDescriptorRequest) ProtoReflect() protoreflect.Message
- func (x *GetServiceDescriptorRequest) Reset()
- func (x *GetServiceDescriptorRequest) String() string
- type GetServiceDescriptorResponse
- func (*GetServiceDescriptorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetServiceDescriptorResponse) GetFileDescriptor() []byte
- func (*GetServiceDescriptorResponse) ProtoMessage()
- func (x *GetServiceDescriptorResponse) ProtoReflect() protoreflect.Message
- func (x *GetServiceDescriptorResponse) Reset()
- func (x *GetServiceDescriptorResponse) String() string
- type GetSymbolDescriptorRequest
- func (*GetSymbolDescriptorRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSymbolDescriptorRequest) GetSymbol() string
- func (*GetSymbolDescriptorRequest) ProtoMessage()
- func (x *GetSymbolDescriptorRequest) ProtoReflect() protoreflect.Message
- func (x *GetSymbolDescriptorRequest) Reset()
- func (x *GetSymbolDescriptorRequest) String() string
- type GetSymbolDescriptorResponse
- func (*GetSymbolDescriptorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSymbolDescriptorResponse) GetFileDescriptors() [][]byte
- func (*GetSymbolDescriptorResponse) ProtoMessage()
- func (x *GetSymbolDescriptorResponse) ProtoReflect() protoreflect.Message
- func (x *GetSymbolDescriptorResponse) Reset()
- func (x *GetSymbolDescriptorResponse) String() string
- type HTTPClient
- type ListServiceResponse
- func (*ListServiceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListServiceResponse) GetName() string
- func (*ListServiceResponse) ProtoMessage()
- func (x *ListServiceResponse) ProtoReflect() protoreflect.Message
- func (x *ListServiceResponse) Reset()
- func (x *ListServiceResponse) String() string
- type ListServicesRequest
- type ListServicesResponse
- func (*ListServicesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListServicesResponse) GetServices() []*ListServiceResponse
- func (*ListServicesResponse) ProtoMessage()
- func (x *ListServicesResponse) ProtoReflect() protoreflect.Message
- func (x *ListServicesResponse) Reset()
- func (x *ListServicesResponse) String() string
- type ServerReflectionService
- type TwirpServer
Constants ¶
const ServerReflectionServicePathPrefix = "/twirp/bakins.twirp.reflection.v0.ServerReflectionService/"
ServerReflectionServicePathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html
Variables ¶
var File_bakins_twirp_reflection_v0_reflection_proto protoreflect.FileDescriptor
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
type GetServiceDescriptorRequest ¶
type GetServiceDescriptorRequest struct { // Full name of a registered service, including its package name. The format // is <package>.<service> Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetServiceDescriptorRequest) Descriptor
deprecated
func (*GetServiceDescriptorRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetServiceDescriptorRequest.ProtoReflect.Descriptor instead.
func (*GetServiceDescriptorRequest) GetName ¶
func (x *GetServiceDescriptorRequest) GetName() string
func (*GetServiceDescriptorRequest) ProtoMessage ¶
func (*GetServiceDescriptorRequest) ProtoMessage()
func (*GetServiceDescriptorRequest) ProtoReflect ¶
func (x *GetServiceDescriptorRequest) ProtoReflect() protoreflect.Message
func (*GetServiceDescriptorRequest) Reset ¶
func (x *GetServiceDescriptorRequest) Reset()
func (*GetServiceDescriptorRequest) String ¶
func (x *GetServiceDescriptorRequest) String() string
type GetServiceDescriptorResponse ¶
type GetServiceDescriptorResponse struct { // Serialized FileDescriptorProto message. We avoid taking a dependency on // descriptor.proto, which uses proto2 only features, by making them opaque // bytes instead. FileDescriptor []byte `protobuf:"bytes,1,opt,name=file_descriptor,json=fileDescriptor,proto3" json:"file_descriptor,omitempty"` // contains filtered or unexported fields }
func (*GetServiceDescriptorResponse) Descriptor
deprecated
func (*GetServiceDescriptorResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetServiceDescriptorResponse.ProtoReflect.Descriptor instead.
func (*GetServiceDescriptorResponse) GetFileDescriptor ¶
func (x *GetServiceDescriptorResponse) GetFileDescriptor() []byte
func (*GetServiceDescriptorResponse) ProtoMessage ¶
func (*GetServiceDescriptorResponse) ProtoMessage()
func (*GetServiceDescriptorResponse) ProtoReflect ¶
func (x *GetServiceDescriptorResponse) ProtoReflect() protoreflect.Message
func (*GetServiceDescriptorResponse) Reset ¶
func (x *GetServiceDescriptorResponse) Reset()
func (*GetServiceDescriptorResponse) String ¶
func (x *GetServiceDescriptorResponse) String() string
type GetSymbolDescriptorRequest ¶
type GetSymbolDescriptorRequest struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` // contains filtered or unexported fields }
func (*GetSymbolDescriptorRequest) Descriptor
deprecated
func (*GetSymbolDescriptorRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSymbolDescriptorRequest.ProtoReflect.Descriptor instead.
func (*GetSymbolDescriptorRequest) GetSymbol ¶
func (x *GetSymbolDescriptorRequest) GetSymbol() string
func (*GetSymbolDescriptorRequest) ProtoMessage ¶
func (*GetSymbolDescriptorRequest) ProtoMessage()
func (*GetSymbolDescriptorRequest) ProtoReflect ¶
func (x *GetSymbolDescriptorRequest) ProtoReflect() protoreflect.Message
func (*GetSymbolDescriptorRequest) Reset ¶
func (x *GetSymbolDescriptorRequest) Reset()
func (*GetSymbolDescriptorRequest) String ¶
func (x *GetSymbolDescriptorRequest) String() string
type GetSymbolDescriptorResponse ¶
type GetSymbolDescriptorResponse struct { FileDescriptors [][]byte `protobuf:"bytes,1,rep,name=file_descriptors,json=fileDescriptors,proto3" json:"file_descriptors,omitempty"` // contains filtered or unexported fields }
func (*GetSymbolDescriptorResponse) Descriptor
deprecated
func (*GetSymbolDescriptorResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSymbolDescriptorResponse.ProtoReflect.Descriptor instead.
func (*GetSymbolDescriptorResponse) GetFileDescriptors ¶
func (x *GetSymbolDescriptorResponse) GetFileDescriptors() [][]byte
func (*GetSymbolDescriptorResponse) ProtoMessage ¶
func (*GetSymbolDescriptorResponse) ProtoMessage()
func (*GetSymbolDescriptorResponse) ProtoReflect ¶
func (x *GetSymbolDescriptorResponse) ProtoReflect() protoreflect.Message
func (*GetSymbolDescriptorResponse) Reset ¶
func (x *GetSymbolDescriptorResponse) Reset()
func (*GetSymbolDescriptorResponse) String ¶
func (x *GetSymbolDescriptorResponse) String() string
type HTTPClient ¶
HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.
HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.
type ListServiceResponse ¶
type ListServiceResponse struct { // Full name of a registered service, including its package name. The format // is <package>.<service> Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*ListServiceResponse) Descriptor
deprecated
func (*ListServiceResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListServiceResponse.ProtoReflect.Descriptor instead.
func (*ListServiceResponse) GetName ¶
func (x *ListServiceResponse) GetName() string
func (*ListServiceResponse) ProtoMessage ¶
func (*ListServiceResponse) ProtoMessage()
func (*ListServiceResponse) ProtoReflect ¶
func (x *ListServiceResponse) ProtoReflect() protoreflect.Message
func (*ListServiceResponse) Reset ¶
func (x *ListServiceResponse) Reset()
func (*ListServiceResponse) String ¶
func (x *ListServiceResponse) String() string
type ListServicesRequest ¶
type ListServicesRequest struct {
// contains filtered or unexported fields
}
func (*ListServicesRequest) Descriptor
deprecated
func (*ListServicesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListServicesRequest.ProtoReflect.Descriptor instead.
func (*ListServicesRequest) ProtoMessage ¶
func (*ListServicesRequest) ProtoMessage()
func (*ListServicesRequest) ProtoReflect ¶
func (x *ListServicesRequest) ProtoReflect() protoreflect.Message
func (*ListServicesRequest) Reset ¶
func (x *ListServicesRequest) Reset()
func (*ListServicesRequest) String ¶
func (x *ListServicesRequest) String() string
type ListServicesResponse ¶
type ListServicesResponse struct { Services []*ListServiceResponse `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` // contains filtered or unexported fields }
func (*ListServicesResponse) Descriptor
deprecated
func (*ListServicesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListServicesResponse.ProtoReflect.Descriptor instead.
func (*ListServicesResponse) GetServices ¶
func (x *ListServicesResponse) GetServices() []*ListServiceResponse
func (*ListServicesResponse) ProtoMessage ¶
func (*ListServicesResponse) ProtoMessage()
func (*ListServicesResponse) ProtoReflect ¶
func (x *ListServicesResponse) ProtoReflect() protoreflect.Message
func (*ListServicesResponse) Reset ¶
func (x *ListServicesResponse) Reset()
func (*ListServicesResponse) String ¶
func (x *ListServicesResponse) String() string
type ServerReflectionService ¶
type ServerReflectionService interface { ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) GetServiceDescriptor(context.Context, *GetServiceDescriptorRequest) (*GetServiceDescriptorResponse, error) GetSymbolDescriptor(context.Context, *GetSymbolDescriptorRequest) (*GetSymbolDescriptorResponse, error) }
func NewServerReflectionServiceJSONClient ¶
func NewServerReflectionServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ServerReflectionService
NewServerReflectionServiceJSONClient creates a JSON client that implements the ServerReflectionService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewServerReflectionServiceProtobufClient ¶
func NewServerReflectionServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ServerReflectionService
NewServerReflectionServiceProtobufClient creates a Protobuf client that implements the ServerReflectionService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type TwirpServer ¶
type TwirpServer interface { http.Handler // 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) // ProtocGenTwirpVersion is the semantic version string of the version of // twirp used to generate this file. ProtocGenTwirpVersion() string // 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: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.
func NewServerReflectionServiceServer ¶
func NewServerReflectionServiceServer(svc ServerReflectionService, opts ...interface{}) TwirpServer
NewServerReflectionServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).