Documentation
¶
Overview ¶
Package proto is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.4.2.
It is generated from these files:
test.proto
Index ¶
- Constants
- func WriteError(resp http.ResponseWriter, err error)
- type HTTPClient
- type HelloWorld
- func NewHelloWorldAnalytics(next HelloWorld, client analytics.Client) HelloWorld
- func NewHelloWorldJSONClient(addr string, client HTTPClient) HelloWorld
- func NewHelloWorldLogging(next HelloWorld) HelloWorld
- func NewHelloWorldMetrics(next HelloWorld, prov provider.Provider) HelloWorld
- func NewHelloWorldProtobufClient(addr string, client HTTPClient) HelloWorld
- type HelloWorldAnalytics
- type HelloWorldLogging
- type HelloWorldMetrics
- type TwirpServer
- type Words
- func (*Words) Descriptor() ([]byte, []int)
- func (i Words) F() ln.F
- func (m *Words) GetMessage() string
- func (*Words) ProtoMessage()
- func (m *Words) Reset()
- func (m *Words) String() string
- func (m *Words) XXX_DiscardUnknown()
- func (m *Words) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Words) XXX_Merge(src proto.Message)
- func (m *Words) XXX_Size() int
- func (m *Words) XXX_Unmarshal(b []byte) error
Constants ¶
const HelloWorldPathPrefix = "/twirp/us.xeserv.api.HelloWorld/"
HelloWorldPathPrefix is used for all URL paths on a twirp HelloWorld server. Requests are always: POST HelloWorldPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(resp http.ResponseWriter, err error)
WriteError writes an HTTP response with a valid Twirp error format. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)
Types ¶
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 HelloWorld ¶
func NewHelloWorldAnalytics ¶
func NewHelloWorldAnalytics(next HelloWorld, client analytics.Client) HelloWorld
func NewHelloWorldJSONClient ¶
func NewHelloWorldJSONClient(addr string, client HTTPClient) HelloWorld
NewHelloWorldJSONClient creates a JSON client that implements the HelloWorld interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewHelloWorldLogging ¶
func NewHelloWorldLogging(next HelloWorld) HelloWorld
func NewHelloWorldMetrics ¶
func NewHelloWorldMetrics(next HelloWorld, prov provider.Provider) HelloWorld
func NewHelloWorldProtobufClient ¶
func NewHelloWorldProtobufClient(addr string, client HTTPClient) HelloWorld
NewHelloWorldProtobufClient creates a Protobuf client that implements the HelloWorld interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type HelloWorldAnalytics ¶
type HelloWorldAnalytics struct { Next HelloWorld // contains filtered or unexported fields }
HelloWorldAnalytics is a middleware for HelloWorld that collects timing and error rate data for servers.
type HelloWorldLogging ¶
type HelloWorldLogging struct {
// contains filtered or unexported fields
}
HelloWorldLogging is a middleware for HelloWorld that logs all usage of the methods
type HelloWorldMetrics ¶
type HelloWorldMetrics struct { Next HelloWorld SpeakErrorCount metrics.Counter SpeakDurationNS metrics.Histogram }
HelloWorldMetrics is a middleware for HelloWorld that collects timing and error rate data for servers.
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 // github.com/golang/protobuf/protoc-gen-go/descriptor.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 }
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 NewHelloWorldServer ¶
func NewHelloWorldServer(svc HelloWorld, hooks *twirp.ServerHooks) TwirpServer
type Words ¶
type Words struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Words) Descriptor ¶
func (*Words) GetMessage ¶
func (*Words) ProtoMessage ¶
func (*Words) ProtoMessage()
func (*Words) XXX_DiscardUnknown ¶
func (m *Words) XXX_DiscardUnknown()