Documentation
¶
Overview ¶
Package pdefs is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.4.1.
It is generated from these files:
protobuf/pdefs/bye.proto protobuf/pdefs/hello.proto protobuf/pdefs/service.proto
Index ¶
- Constants
- func WriteError(resp http.ResponseWriter, err error)
- type AwesomeTwirpService
- type GoodBye
- func (*GoodBye) Descriptor() ([]byte, []int)
- func (m *GoodBye) GetMessage() string
- func (m *GoodBye) GetUserID() string
- func (*GoodBye) ProtoMessage()
- func (m *GoodBye) Reset()
- func (m *GoodBye) String() string
- func (m *GoodBye) XXX_DiscardUnknown()
- func (m *GoodBye) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *GoodBye) XXX_Merge(src proto.Message)
- func (m *GoodBye) XXX_Size() int
- func (m *GoodBye) XXX_Unmarshal(b []byte) error
- type HTTPClient
- type Hello
- func (*Hello) Descriptor() ([]byte, []int)
- func (m *Hello) GetMessage() string
- func (m *Hello) GetUserID() string
- func (*Hello) ProtoMessage()
- func (m *Hello) Reset()
- func (m *Hello) String() string
- func (m *Hello) XXX_DiscardUnknown()
- func (m *Hello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Hello) XXX_Merge(src proto.Message)
- func (m *Hello) XXX_Size() int
- func (m *Hello) XXX_Unmarshal(b []byte) error
- type ReqHello
- func (*ReqHello) Descriptor() ([]byte, []int)
- func (m *ReqHello) GetHello() *Hello
- func (*ReqHello) ProtoMessage()
- func (m *ReqHello) Reset()
- func (m *ReqHello) String() string
- func (m *ReqHello) XXX_DiscardUnknown()
- func (m *ReqHello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ReqHello) XXX_Merge(src proto.Message)
- func (m *ReqHello) XXX_Size() int
- func (m *ReqHello) XXX_Unmarshal(b []byte) error
- type ResHello
- func (*ResHello) Descriptor() ([]byte, []int)
- func (m *ResHello) GetGoodBye() *GoodBye
- func (*ResHello) ProtoMessage()
- func (m *ResHello) Reset()
- func (m *ResHello) String() string
- func (m *ResHello) XXX_DiscardUnknown()
- func (m *ResHello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ResHello) XXX_Merge(src proto.Message)
- func (m *ResHello) XXX_Size() int
- func (m *ResHello) XXX_Unmarshal(b []byte) error
- type TwirpServer
Constants ¶
const AwesomeTwirpServicePathPrefix = "/twirp/pdefs.AwesomeTwirpService/"
AwesomeTwirpServicePathPrefix is used for all URL paths on a twirp AwesomeTwirpService server. Requests are always: POST AwesomeTwirpServicePathPrefix/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 AwesomeTwirpService ¶
func NewAwesomeTwirpServiceJSONClient ¶
func NewAwesomeTwirpServiceJSONClient(addr string, client HTTPClient) AwesomeTwirpService
NewAwesomeTwirpServiceJSONClient creates a JSON client that implements the AwesomeTwirpService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewAwesomeTwirpServiceProtobufClient ¶
func NewAwesomeTwirpServiceProtobufClient(addr string, client HTTPClient) AwesomeTwirpService
NewAwesomeTwirpServiceProtobufClient creates a Protobuf client that implements the AwesomeTwirpService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type GoodBye ¶
type GoodBye struct { UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message" json:"Message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GoodBye) Descriptor ¶
func (*GoodBye) GetMessage ¶
func (*GoodBye) ProtoMessage ¶
func (*GoodBye) ProtoMessage()
func (*GoodBye) XXX_DiscardUnknown ¶
func (m *GoodBye) XXX_DiscardUnknown()
func (*GoodBye) XXX_Marshal ¶
func (*GoodBye) XXX_Unmarshal ¶
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 Hello ¶
type Hello struct { UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message" json:"Message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Hello) Descriptor ¶
func (*Hello) GetMessage ¶
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
func (*Hello) XXX_DiscardUnknown ¶
func (m *Hello) XXX_DiscardUnknown()
func (*Hello) XXX_Marshal ¶
func (*Hello) XXX_Unmarshal ¶
type ReqHello ¶
type ReqHello struct { Hello *Hello `protobuf:"bytes,1,opt,name=Hello" json:"Hello,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReqHello) Descriptor ¶
func (*ReqHello) ProtoMessage ¶
func (*ReqHello) ProtoMessage()
func (*ReqHello) XXX_DiscardUnknown ¶
func (m *ReqHello) XXX_DiscardUnknown()
func (*ReqHello) XXX_Marshal ¶
func (*ReqHello) XXX_Unmarshal ¶
type ResHello ¶
type ResHello struct { GoodBye *GoodBye `protobuf:"bytes,1,opt,name=GoodBye" json:"GoodBye,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ResHello) Descriptor ¶
func (*ResHello) GetGoodBye ¶
func (*ResHello) ProtoMessage ¶
func (*ResHello) ProtoMessage()
func (*ResHello) XXX_DiscardUnknown ¶
func (m *ResHello) XXX_DiscardUnknown()
func (*ResHello) XXX_Marshal ¶
func (*ResHello) XXX_Unmarshal ¶
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 NewAwesomeTwirpServiceServer ¶
func NewAwesomeTwirpServiceServer(svc AwesomeTwirpService, hooks *twirp.ServerHooks) TwirpServer