Documentation
¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type ClosePlaybackRequest
- func (*ClosePlaybackRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ClosePlaybackRequest) GetPlaybackId() string
- func (*ClosePlaybackRequest) ProtoMessage()
- func (x *ClosePlaybackRequest) ProtoReflect() protoreflect.Message
- func (x *ClosePlaybackRequest) Reset()
- func (x *ClosePlaybackRequest) 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
- func (*ListReplaysRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListReplaysRequest) GetPageToken() *livekit.TokenPagination
- func (x *ListReplaysRequest) GetRoomName() string
- func (*ListReplaysRequest) ProtoMessage()
- func (x *ListReplaysRequest) ProtoReflect() protoreflect.Message
- func (x *ListReplaysRequest) Reset()
- func (x *ListReplaysRequest) String() string
- type ListReplaysResponse
- func (*ListReplaysResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListReplaysResponse) GetNextPageToken() *livekit.TokenPagination
- func (x *ListReplaysResponse) GetReplays() []*ReplayInfo
- func (*ListReplaysResponse) ProtoMessage()
- func (x *ListReplaysResponse) ProtoReflect() protoreflect.Message
- func (x *ListReplaysResponse) Reset()
- func (x *ListReplaysResponse) String() string
- type PlaybackRequest
- func (*PlaybackRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PlaybackRequest) GetPlaybackRoom() string
- func (x *PlaybackRequest) GetReplayId() string
- func (x *PlaybackRequest) GetSeekOffset() int64
- func (*PlaybackRequest) ProtoMessage()
- func (x *PlaybackRequest) ProtoReflect() protoreflect.Message
- func (x *PlaybackRequest) Reset()
- func (x *PlaybackRequest) String() string
- type PlaybackResponse
- type Replay
- type ReplayInfo
- func (*ReplayInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ReplayInfo) GetDuration() int64
- func (x *ReplayInfo) GetReplayId() string
- func (x *ReplayInfo) GetRoomName() string
- func (x *ReplayInfo) GetStartTime() int64
- func (*ReplayInfo) ProtoMessage()
- func (x *ReplayInfo) ProtoReflect() protoreflect.Message
- func (x *ReplayInfo) Reset()
- func (x *ReplayInfo) String() string
- type SeekRequest
- func (*SeekRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SeekRequest) GetPlaybackId() string
- func (x *SeekRequest) GetSeekOffset() int64
- func (*SeekRequest) ProtoMessage()
- func (x *SeekRequest) ProtoReflect() protoreflect.Message
- func (x *SeekRequest) Reset()
- func (x *SeekRequest) 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 ClosePlaybackRequest ¶ added in v1.42.0
type ClosePlaybackRequest struct {
PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"`
// contains filtered or unexported fields
}
func (*ClosePlaybackRequest) Descriptor
deprecated
added in
v1.42.0
func (*ClosePlaybackRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClosePlaybackRequest.ProtoReflect.Descriptor instead.
func (*ClosePlaybackRequest) GetPlaybackId ¶ added in v1.42.0
func (x *ClosePlaybackRequest) GetPlaybackId() string
func (*ClosePlaybackRequest) ProtoMessage ¶ added in v1.42.0
func (*ClosePlaybackRequest) ProtoMessage()
func (*ClosePlaybackRequest) ProtoReflect ¶ added in v1.42.0
func (x *ClosePlaybackRequest) ProtoReflect() protoreflect.Message
func (*ClosePlaybackRequest) Reset ¶ added in v1.42.0
func (x *ClosePlaybackRequest) Reset()
func (*ClosePlaybackRequest) String ¶ added in v1.42.0
func (x *ClosePlaybackRequest) 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 {
RoomName string `protobuf:"bytes,1,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"` // optional
PageToken *livekit.TokenPagination `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListReplaysRequest) Descriptor
deprecated
func (*ListReplaysRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListReplaysRequest.ProtoReflect.Descriptor instead.
func (*ListReplaysRequest) GetPageToken ¶ added in v1.42.2
func (x *ListReplaysRequest) GetPageToken() *livekit.TokenPagination
func (*ListReplaysRequest) GetRoomName ¶ added in v1.42.0
func (x *ListReplaysRequest) GetRoomName() string
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"`
NextPageToken *livekit.TokenPagination `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// contains filtered or unexported fields
}
func (*ListReplaysResponse) Descriptor
deprecated
func (*ListReplaysResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListReplaysResponse.ProtoReflect.Descriptor instead.
func (*ListReplaysResponse) GetNextPageToken ¶ added in v1.42.2
func (x *ListReplaysResponse) GetNextPageToken() *livekit.TokenPagination
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 PlaybackRequest ¶ added in v1.42.0
type PlaybackRequest struct {
ReplayId string `protobuf:"bytes,1,opt,name=replay_id,json=replayId,proto3" json:"replay_id,omitempty"`
PlaybackRoom string `protobuf:"bytes,2,opt,name=playback_room,json=playbackRoom,proto3" json:"playback_room,omitempty"` // name of room to play into
SeekOffset int64 `protobuf:"varint,3,opt,name=seek_offset,json=seekOffset,proto3" json:"seek_offset,omitempty"` // initial timestamp (ms)
// contains filtered or unexported fields
}
func (*PlaybackRequest) Descriptor
deprecated
added in
v1.42.0
func (*PlaybackRequest) Descriptor() ([]byte, []int)
Deprecated: Use PlaybackRequest.ProtoReflect.Descriptor instead.
func (*PlaybackRequest) GetPlaybackRoom ¶ added in v1.42.2
func (x *PlaybackRequest) GetPlaybackRoom() string
func (*PlaybackRequest) GetReplayId ¶ added in v1.42.0
func (x *PlaybackRequest) GetReplayId() string
func (*PlaybackRequest) GetSeekOffset ¶ added in v1.42.2
func (x *PlaybackRequest) GetSeekOffset() int64
func (*PlaybackRequest) ProtoMessage ¶ added in v1.42.0
func (*PlaybackRequest) ProtoMessage()
func (*PlaybackRequest) ProtoReflect ¶ added in v1.42.0
func (x *PlaybackRequest) ProtoReflect() protoreflect.Message
func (*PlaybackRequest) Reset ¶ added in v1.42.0
func (x *PlaybackRequest) Reset()
func (*PlaybackRequest) String ¶ added in v1.42.0
func (x *PlaybackRequest) String() string
type PlaybackResponse ¶ added in v1.42.0
type PlaybackResponse struct {
PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"`
// contains filtered or unexported fields
}
func (*PlaybackResponse) Descriptor
deprecated
added in
v1.42.0
func (*PlaybackResponse) Descriptor() ([]byte, []int)
Deprecated: Use PlaybackResponse.ProtoReflect.Descriptor instead.
func (*PlaybackResponse) GetPlaybackId ¶ added in v1.42.0
func (x *PlaybackResponse) GetPlaybackId() string
func (*PlaybackResponse) ProtoMessage ¶ added in v1.42.0
func (*PlaybackResponse) ProtoMessage()
func (*PlaybackResponse) ProtoReflect ¶ added in v1.42.0
func (x *PlaybackResponse) ProtoReflect() protoreflect.Message
func (*PlaybackResponse) Reset ¶ added in v1.42.0
func (x *PlaybackResponse) Reset()
func (*PlaybackResponse) String ¶ added in v1.42.0
func (x *PlaybackResponse) String() string
type Replay ¶
type Replay interface {
ListReplays(context.Context, *ListReplaysRequest) (*ListReplaysResponse, error)
DeleteReplay(context.Context, *DeleteReplayRequest) (*google_protobuf.Empty, error)
Playback(context.Context, *PlaybackRequest) (*PlaybackResponse, error)
Seek(context.Context, *SeekRequest) (*google_protobuf.Empty, error)
Close(context.Context, *ClosePlaybackRequest) (*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"`
RoomName string `protobuf:"bytes,2,opt,name=room_name,json=roomName,proto3" json:"room_name,omitempty"`
StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
Duration int64 `protobuf:"varint,4,opt,name=duration,proto3" json:"duration,omitempty"`
// contains filtered or unexported fields
}
func (*ReplayInfo) Descriptor
deprecated
func (*ReplayInfo) Descriptor() ([]byte, []int)
Deprecated: Use ReplayInfo.ProtoReflect.Descriptor instead.
func (*ReplayInfo) GetDuration ¶ added in v1.42.0
func (x *ReplayInfo) GetDuration() int64
func (*ReplayInfo) GetReplayId ¶
func (x *ReplayInfo) GetReplayId() string
func (*ReplayInfo) GetRoomName ¶ added in v1.42.0
func (x *ReplayInfo) GetRoomName() string
func (*ReplayInfo) GetStartTime ¶ added in v1.42.0
func (x *ReplayInfo) GetStartTime() int64
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 SeekRequest ¶ added in v1.42.0
type SeekRequest struct {
PlaybackId string `protobuf:"bytes,1,opt,name=playback_id,json=playbackId,proto3" json:"playback_id,omitempty"`
SeekOffset int64 `protobuf:"varint,2,opt,name=seek_offset,json=seekOffset,proto3" json:"seek_offset,omitempty"` // timestamp (ms)
// contains filtered or unexported fields
}
func (*SeekRequest) Descriptor
deprecated
added in
v1.42.0
func (*SeekRequest) Descriptor() ([]byte, []int)
Deprecated: Use SeekRequest.ProtoReflect.Descriptor instead.
func (*SeekRequest) GetPlaybackId ¶ added in v1.42.0
func (x *SeekRequest) GetPlaybackId() string
func (*SeekRequest) GetSeekOffset ¶ added in v1.42.2
func (x *SeekRequest) GetSeekOffset() int64
func (*SeekRequest) ProtoMessage ¶ added in v1.42.0
func (*SeekRequest) ProtoMessage()
func (*SeekRequest) ProtoReflect ¶ added in v1.42.0
func (x *SeekRequest) ProtoReflect() protoreflect.Message
func (*SeekRequest) Reset ¶ added in v1.42.0
func (x *SeekRequest) Reset()
func (*SeekRequest) String ¶ added in v1.42.0
func (x *SeekRequest) 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).