Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterAnnounceServer(s grpc.ServiceRegistrar, srv AnnounceServer)
- func RegisterPostServer(s grpc.ServiceRegistrar, srv PostServer)
- func WriteError(resp http.ResponseWriter, err error)
- type Announce
- type AnnounceClient
- type AnnounceServer
- type HTTPClient
- type Post
- type PostClient
- type PostServer
- type StatusUpdate
- type TwirpServer
- type UnimplementedAnnounceServer
- type UnimplementedPostServer
- type UnsafeAnnounceServer
- type UnsafePostServer
Constants ¶
const AnnouncePathPrefix = "/twirp/within.website.x.mimi.announce.Announce/"
AnnouncePathPrefix 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
const (
Announce_Announce_FullMethodName = "/within.website.x.mimi.announce.Announce/Announce"
)
const PostPathPrefix = "/twirp/within.website.x.mimi.announce.Post/"
PostPathPrefix 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
const (
Post_Post_FullMethodName = "/within.website.x.mimi.announce.Post/Post"
)
Variables ¶
var Announce_ServiceDesc = grpc.ServiceDesc{ ServiceName: "within.website.x.mimi.announce.Announce", HandlerType: (*AnnounceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Announce", Handler: _Announce_Announce_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "announce.proto", }
Announce_ServiceDesc is the grpc.ServiceDesc for Announce service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_announce_proto protoreflect.FileDescriptor
var Post_ServiceDesc = grpc.ServiceDesc{ ServiceName: "within.website.x.mimi.announce.Post", HandlerType: (*PostServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Post", Handler: _Post_Post_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "announce.proto", }
Post_ServiceDesc is the grpc.ServiceDesc for Post service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAnnounceServer ¶ added in v1.11.0
func RegisterAnnounceServer(s grpc.ServiceRegistrar, srv AnnounceServer)
func RegisterPostServer ¶ added in v1.11.0
func RegisterPostServer(s grpc.ServiceRegistrar, srv PostServer)
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 Announce ¶
type Announce interface {
Announce(context.Context, *jsonfeed.Item) (*google_protobuf.Empty, error)
}
func NewAnnounceJSONClient ¶
func NewAnnounceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Announce
NewAnnounceJSONClient creates a JSON client that implements the Announce interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewAnnounceProtobufClient ¶
func NewAnnounceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Announce
NewAnnounceProtobufClient creates a Protobuf client that implements the Announce interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type AnnounceClient ¶ added in v1.11.0
type AnnounceClient interface {
Announce(ctx context.Context, in *jsonfeed.Item, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
AnnounceClient is the client API for Announce service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAnnounceClient ¶ added in v1.11.0
func NewAnnounceClient(cc grpc.ClientConnInterface) AnnounceClient
type AnnounceServer ¶ added in v1.11.0
type AnnounceServer interface { Announce(context.Context, *jsonfeed.Item) (*emptypb.Empty, error) // contains filtered or unexported methods }
AnnounceServer is the server API for Announce service. All implementations must embed UnimplementedAnnounceServer for forward compatibility.
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 Post ¶ added in v1.11.0
type Post interface {
Post(context.Context, *StatusUpdate) (*google_protobuf.Empty, error)
}
func NewPostJSONClient ¶ added in v1.11.0
func NewPostJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Post
NewPostJSONClient creates a JSON client that implements the Post interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewPostProtobufClient ¶ added in v1.11.0
func NewPostProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Post
NewPostProtobufClient creates a Protobuf client that implements the Post interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type PostClient ¶ added in v1.11.0
type PostClient interface {
Post(ctx context.Context, in *StatusUpdate, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
PostClient is the client API for Post service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPostClient ¶ added in v1.11.0
func NewPostClient(cc grpc.ClientConnInterface) PostClient
type PostServer ¶ added in v1.11.0
type PostServer interface { Post(context.Context, *StatusUpdate) (*emptypb.Empty, error) // contains filtered or unexported methods }
PostServer is the server API for Post service. All implementations must embed UnimplementedPostServer for forward compatibility.
type StatusUpdate ¶ added in v1.11.0
type StatusUpdate struct { Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*StatusUpdate) Descriptor
deprecated
added in
v1.11.0
func (*StatusUpdate) Descriptor() ([]byte, []int)
Deprecated: Use StatusUpdate.ProtoReflect.Descriptor instead.
func (*StatusUpdate) GetBody ¶ added in v1.11.0
func (x *StatusUpdate) GetBody() string
func (*StatusUpdate) ProtoMessage ¶ added in v1.11.0
func (*StatusUpdate) ProtoMessage()
func (*StatusUpdate) ProtoReflect ¶ added in v1.11.0
func (x *StatusUpdate) ProtoReflect() protoreflect.Message
func (*StatusUpdate) Reset ¶ added in v1.11.0
func (x *StatusUpdate) Reset()
func (*StatusUpdate) String ¶ added in v1.11.0
func (x *StatusUpdate) String() string
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 NewAnnounceServer ¶
func NewAnnounceServer(svc Announce, opts ...interface{}) TwirpServer
NewAnnounceServer 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).
func NewPostServer ¶ added in v1.11.0
func NewPostServer(svc Post, opts ...interface{}) TwirpServer
NewPostServer 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).
type UnimplementedAnnounceServer ¶ added in v1.11.0
type UnimplementedAnnounceServer struct{}
UnimplementedAnnounceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
type UnimplementedPostServer ¶ added in v1.11.0
type UnimplementedPostServer struct{}
UnimplementedPostServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedPostServer) Post ¶ added in v1.11.0
func (UnimplementedPostServer) Post(context.Context, *StatusUpdate) (*emptypb.Empty, error)
type UnsafeAnnounceServer ¶ added in v1.11.0
type UnsafeAnnounceServer interface {
// contains filtered or unexported methods
}
UnsafeAnnounceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AnnounceServer will result in compilation errors.
type UnsafePostServer ¶ added in v1.11.0
type UnsafePostServer interface {
// contains filtered or unexported methods
}
UnsafePostServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PostServer will result in compilation errors.