Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type CloseReplayRequest
- func (*CloseReplayRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CloseReplayRequest) GetPlaybackId() string
- func (*CloseReplayRequest) ProtoMessage()
- func (x *CloseReplayRequest) ProtoReflect() protoreflect.Message
- func (x *CloseReplayRequest) Reset()
- func (x *CloseReplayRequest) String() string
- type DeleteReplayRequest
- func (*DeleteReplayRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteReplayRequest) GetReplayId() string
- func (*DeleteReplayRequest) ProtoMessage()
- func (x *DeleteReplayRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteReplayRequest) Reset()
- func (x *DeleteReplayRequest) String() string
- type HTTPClient
- type ListReplaysRequest
- type ListReplaysResponse
- func (*ListReplaysResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListReplaysResponse) GetReplays() []*ReplayInfo
- func (*ListReplaysResponse) ProtoMessage()
- func (x *ListReplaysResponse) ProtoReflect() protoreflect.Message
- func (x *ListReplaysResponse) Reset()
- func (x *ListReplaysResponse) String() string
- type LoadReplayRequest
- func (*LoadReplayRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoadReplayRequest) GetReplayId() string
- func (x *LoadReplayRequest) GetRoomName() string
- func (x *LoadReplayRequest) GetStartingPts() int64
- func (*LoadReplayRequest) ProtoMessage()
- func (x *LoadReplayRequest) ProtoReflect() protoreflect.Message
- func (x *LoadReplayRequest) Reset()
- func (x *LoadReplayRequest) String() string
- type LoadReplayResponse
- func (*LoadReplayResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoadReplayResponse) GetPlaybackId() string
- func (*LoadReplayResponse) ProtoMessage()
- func (x *LoadReplayResponse) ProtoReflect() protoreflect.Message
- func (x *LoadReplayResponse) Reset()
- func (x *LoadReplayResponse) String() string
- type Replay
- type ReplayInfo
- type RoomSeekRequest
- func (*RoomSeekRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RoomSeekRequest) GetPlaybackId() string
- func (x *RoomSeekRequest) GetPts() int64
- func (*RoomSeekRequest) ProtoMessage()
- func (x *RoomSeekRequest) ProtoReflect() protoreflect.Message
- func (x *RoomSeekRequest) Reset()
- func (x *RoomSeekRequest) String() string
- type TwirpServer
Constants ¶
const ReplayPathPrefix = "/twirp/replay.Replay/"
ReplayPathPrefix 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_cloud_replay_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 CloseReplayRequest ¶
type CloseReplayRequest struct { PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"` // contains filtered or unexported fields }
func (*CloseReplayRequest) Descriptor
deprecated
func (*CloseReplayRequest) Descriptor() ([]byte, []int)
Deprecated: Use CloseReplayRequest.ProtoReflect.Descriptor instead.
func (*CloseReplayRequest) GetPlaybackId ¶
func (x *CloseReplayRequest) GetPlaybackId() string
func (*CloseReplayRequest) ProtoMessage ¶
func (*CloseReplayRequest) ProtoMessage()
func (*CloseReplayRequest) ProtoReflect ¶
func (x *CloseReplayRequest) ProtoReflect() protoreflect.Message
func (*CloseReplayRequest) Reset ¶
func (x *CloseReplayRequest) Reset()
func (*CloseReplayRequest) String ¶
func (x *CloseReplayRequest) String() string
type DeleteReplayRequest ¶
type DeleteReplayRequest struct { ReplayId string `protobuf:"bytes,1,opt,name=replay_id,json=replayId,proto3" json:"replay_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteReplayRequest) Descriptor
deprecated
func (*DeleteReplayRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteReplayRequest.ProtoReflect.Descriptor instead.
func (*DeleteReplayRequest) GetReplayId ¶
func (x *DeleteReplayRequest) GetReplayId() string
func (*DeleteReplayRequest) ProtoMessage ¶
func (*DeleteReplayRequest) ProtoMessage()
func (*DeleteReplayRequest) ProtoReflect ¶
func (x *DeleteReplayRequest) ProtoReflect() protoreflect.Message
func (*DeleteReplayRequest) Reset ¶
func (x *DeleteReplayRequest) Reset()
func (*DeleteReplayRequest) String ¶
func (x *DeleteReplayRequest) 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 ListReplaysRequest ¶
type ListReplaysRequest struct {
// contains filtered or unexported fields
}
func (*ListReplaysRequest) Descriptor
deprecated
func (*ListReplaysRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListReplaysRequest.ProtoReflect.Descriptor instead.
func (*ListReplaysRequest) ProtoMessage ¶
func (*ListReplaysRequest) ProtoMessage()
func (*ListReplaysRequest) ProtoReflect ¶
func (x *ListReplaysRequest) ProtoReflect() protoreflect.Message
func (*ListReplaysRequest) Reset ¶
func (x *ListReplaysRequest) Reset()
func (*ListReplaysRequest) String ¶
func (x *ListReplaysRequest) String() string
type ListReplaysResponse ¶
type ListReplaysResponse struct { Replays []*ReplayInfo `protobuf:"bytes,1,rep,name=replays,proto3" json:"replays,omitempty"` // contains filtered or unexported fields }
func (*ListReplaysResponse) Descriptor
deprecated
func (*ListReplaysResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListReplaysResponse.ProtoReflect.Descriptor instead.
func (*ListReplaysResponse) GetReplays ¶
func (x *ListReplaysResponse) GetReplays() []*ReplayInfo
func (*ListReplaysResponse) ProtoMessage ¶
func (*ListReplaysResponse) ProtoMessage()
func (*ListReplaysResponse) ProtoReflect ¶
func (x *ListReplaysResponse) ProtoReflect() protoreflect.Message
func (*ListReplaysResponse) Reset ¶
func (x *ListReplaysResponse) Reset()
func (*ListReplaysResponse) String ¶
func (x *ListReplaysResponse) String() string
type LoadReplayRequest ¶
type LoadReplayRequest struct { ReplayId string `protobuf:"bytes,1,opt,name=replay_id,json=replayId,proto3" json:"replay_id,omitempty"` RoomName string `protobuf:"bytes,2,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` StartingPts int64 `protobuf:"varint,3,opt,name=starting_pts,json=startingPts,proto3" json:"starting_pts,omitempty"` // contains filtered or unexported fields }
func (*LoadReplayRequest) Descriptor
deprecated
func (*LoadReplayRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoadReplayRequest.ProtoReflect.Descriptor instead.
func (*LoadReplayRequest) GetReplayId ¶
func (x *LoadReplayRequest) GetReplayId() string
func (*LoadReplayRequest) GetRoomName ¶
func (x *LoadReplayRequest) GetRoomName() string
func (*LoadReplayRequest) GetStartingPts ¶
func (x *LoadReplayRequest) GetStartingPts() int64
func (*LoadReplayRequest) ProtoMessage ¶
func (*LoadReplayRequest) ProtoMessage()
func (*LoadReplayRequest) ProtoReflect ¶
func (x *LoadReplayRequest) ProtoReflect() protoreflect.Message
func (*LoadReplayRequest) Reset ¶
func (x *LoadReplayRequest) Reset()
func (*LoadReplayRequest) String ¶
func (x *LoadReplayRequest) String() string
type LoadReplayResponse ¶
type LoadReplayResponse struct { PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"` // contains filtered or unexported fields }
func (*LoadReplayResponse) Descriptor
deprecated
func (*LoadReplayResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoadReplayResponse.ProtoReflect.Descriptor instead.
func (*LoadReplayResponse) GetPlaybackId ¶
func (x *LoadReplayResponse) GetPlaybackId() string
func (*LoadReplayResponse) ProtoMessage ¶
func (*LoadReplayResponse) ProtoMessage()
func (*LoadReplayResponse) ProtoReflect ¶
func (x *LoadReplayResponse) ProtoReflect() protoreflect.Message
func (*LoadReplayResponse) Reset ¶
func (x *LoadReplayResponse) Reset()
func (*LoadReplayResponse) String ¶
func (x *LoadReplayResponse) String() string
type Replay ¶
type Replay interface { ListReplays(context.Context, *ListReplaysRequest) (*ListReplaysResponse, error) LoadReplay(context.Context, *LoadReplayRequest) (*LoadReplayResponse, error) SeekForRoom(context.Context, *RoomSeekRequest) (*google_protobuf.Empty, error) CloseReplay(context.Context, *CloseReplayRequest) (*google_protobuf.Empty, error) DeleteReplay(context.Context, *DeleteReplayRequest) (*google_protobuf.Empty, error) }
Experimental (not currently available)
func NewReplayJSONClient ¶
func NewReplayJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Replay
NewReplayJSONClient creates a JSON client that implements the Replay interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewReplayProtobufClient ¶
func NewReplayProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Replay
NewReplayProtobufClient creates a Protobuf client that implements the Replay interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type ReplayInfo ¶
type ReplayInfo struct { ReplayId string `protobuf:"bytes,1,opt,name=replay_id,json=replayId,proto3" json:"replay_id,omitempty"` // contains filtered or unexported fields }
func (*ReplayInfo) Descriptor
deprecated
func (*ReplayInfo) Descriptor() ([]byte, []int)
Deprecated: Use ReplayInfo.ProtoReflect.Descriptor instead.
func (*ReplayInfo) GetReplayId ¶
func (x *ReplayInfo) GetReplayId() string
func (*ReplayInfo) ProtoMessage ¶
func (*ReplayInfo) ProtoMessage()
func (*ReplayInfo) ProtoReflect ¶
func (x *ReplayInfo) ProtoReflect() protoreflect.Message
func (*ReplayInfo) Reset ¶
func (x *ReplayInfo) Reset()
func (*ReplayInfo) String ¶
func (x *ReplayInfo) String() string
type RoomSeekRequest ¶
type RoomSeekRequest struct { PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"` Pts int64 `protobuf:"varint,2,opt,name=pts,proto3" json:"pts,omitempty"` // contains filtered or unexported fields }
func (*RoomSeekRequest) Descriptor
deprecated
func (*RoomSeekRequest) Descriptor() ([]byte, []int)
Deprecated: Use RoomSeekRequest.ProtoReflect.Descriptor instead.
func (*RoomSeekRequest) GetPlaybackId ¶
func (x *RoomSeekRequest) GetPlaybackId() string
func (*RoomSeekRequest) GetPts ¶
func (x *RoomSeekRequest) GetPts() int64
func (*RoomSeekRequest) ProtoMessage ¶
func (*RoomSeekRequest) ProtoMessage()
func (*RoomSeekRequest) ProtoReflect ¶
func (x *RoomSeekRequest) ProtoReflect() protoreflect.Message
func (*RoomSeekRequest) Reset ¶
func (x *RoomSeekRequest) Reset()
func (*RoomSeekRequest) String ¶
func (x *RoomSeekRequest) 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 NewReplayServer ¶
func NewReplayServer(svc Replay, opts ...interface{}) TwirpServer
NewReplayServer 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).