Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type Anime
- type AnimeSnatch
- func (*AnimeSnatch) Descriptor() ([]byte, []int)deprecated
- func (x *AnimeSnatch) GetBotName() string
- func (x *AnimeSnatch) GetCrc32() string
- func (x *AnimeSnatch) GetEpisode() string
- func (x *AnimeSnatch) GetFname() string
- func (x *AnimeSnatch) GetPackId() string
- func (x *AnimeSnatch) GetResolution() string
- func (x *AnimeSnatch) GetShowName() string
- func (as *AnimeSnatch) LogValue() slog.Value
- func (*AnimeSnatch) ProtoMessage()
- func (x *AnimeSnatch) ProtoReflect() protoreflect.Message
- func (x *AnimeSnatch) Reset()
- func (x *AnimeSnatch) String() string
- type AnimeSnatches
- type HTTPClient
- type Show
- func (*Show) Descriptor() ([]byte, []int)deprecated
- func (x *Show) GetDiskPath() string
- func (x *Show) GetQuality() string
- func (x *Show) GetTitle() string
- func (s *Show) LogValue() slog.Value
- func (*Show) ProtoMessage()
- func (x *Show) ProtoReflect() protoreflect.Message
- func (x *Show) Reset()
- func (x *Show) String() string
- func (s *Show) Valid() error
- type Shows
- type TV
- type TVSnatch
- func (*TVSnatch) Descriptor() ([]byte, []int)deprecated
- func (x *TVSnatch) GetCategory() string
- func (x *TVSnatch) GetFreeleech() bool
- func (x *TVSnatch) GetName() string
- func (x *TVSnatch) GetTorrentId() string
- func (tvs *TVSnatch) LogValue() slog.Value
- func (*TVSnatch) ProtoMessage()
- func (x *TVSnatch) ProtoReflect() protoreflect.Message
- func (x *TVSnatch) Reset()
- func (x *TVSnatch) String() string
- type TVSnatches
- type TwirpServer
Constants ¶
const AnimePathPrefix = "/twirp/within.website.x.sanguisuga.Anime/"
AnimePathPrefix 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 TVPathPrefix = "/twirp/within.website.x.sanguisuga.TV/"
TVPathPrefix 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_sanguisuga_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 Anime ¶
type Anime interface { List(context.Context, *google_protobuf.Empty) (*Shows, error) Track(context.Context, *Show) (*google_protobuf.Empty, error) Untrack(context.Context, *Show) (*google_protobuf.Empty, error) Snatches(context.Context, *google_protobuf.Empty) (*AnimeSnatches, error) }
func NewAnimeJSONClient ¶
func NewAnimeJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Anime
NewAnimeJSONClient creates a JSON client that implements the Anime interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewAnimeProtobufClient ¶
func NewAnimeProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Anime
NewAnimeProtobufClient creates a Protobuf client that implements the Anime interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type AnimeSnatch ¶
type AnimeSnatch struct { Fname string `protobuf:"bytes,1,opt,name=fname,proto3" json:"fname,omitempty"` ShowName string `protobuf:"bytes,2,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` Episode string `protobuf:"bytes,3,opt,name=episode,proto3" json:"episode,omitempty"` Resolution string `protobuf:"bytes,4,opt,name=resolution,proto3" json:"resolution,omitempty"` Crc32 string `protobuf:"bytes,5,opt,name=crc32,proto3" json:"crc32,omitempty"` BotName string `protobuf:"bytes,6,opt,name=bot_name,json=botName,proto3" json:"bot_name,omitempty"` PackId string `protobuf:"bytes,7,opt,name=pack_id,json=packId,proto3" json:"pack_id,omitempty"` // contains filtered or unexported fields }
func (*AnimeSnatch) Descriptor
deprecated
func (*AnimeSnatch) Descriptor() ([]byte, []int)
Deprecated: Use AnimeSnatch.ProtoReflect.Descriptor instead.
func (*AnimeSnatch) GetBotName ¶
func (x *AnimeSnatch) GetBotName() string
func (*AnimeSnatch) GetCrc32 ¶
func (x *AnimeSnatch) GetCrc32() string
func (*AnimeSnatch) GetEpisode ¶
func (x *AnimeSnatch) GetEpisode() string
func (*AnimeSnatch) GetFname ¶
func (x *AnimeSnatch) GetFname() string
func (*AnimeSnatch) GetPackId ¶
func (x *AnimeSnatch) GetPackId() string
func (*AnimeSnatch) GetResolution ¶
func (x *AnimeSnatch) GetResolution() string
func (*AnimeSnatch) GetShowName ¶
func (x *AnimeSnatch) GetShowName() string
func (*AnimeSnatch) LogValue ¶
func (as *AnimeSnatch) LogValue() slog.Value
func (*AnimeSnatch) ProtoMessage ¶
func (*AnimeSnatch) ProtoMessage()
func (*AnimeSnatch) ProtoReflect ¶
func (x *AnimeSnatch) ProtoReflect() protoreflect.Message
func (*AnimeSnatch) Reset ¶
func (x *AnimeSnatch) Reset()
func (*AnimeSnatch) String ¶
func (x *AnimeSnatch) String() string
type AnimeSnatches ¶
type AnimeSnatches struct { Snatches []*AnimeSnatch `protobuf:"bytes,1,rep,name=snatches,proto3" json:"snatches,omitempty"` // contains filtered or unexported fields }
func (*AnimeSnatches) Descriptor
deprecated
func (*AnimeSnatches) Descriptor() ([]byte, []int)
Deprecated: Use AnimeSnatches.ProtoReflect.Descriptor instead.
func (*AnimeSnatches) GetSnatches ¶
func (x *AnimeSnatches) GetSnatches() []*AnimeSnatch
func (*AnimeSnatches) ProtoMessage ¶
func (*AnimeSnatches) ProtoMessage()
func (*AnimeSnatches) ProtoReflect ¶
func (x *AnimeSnatches) ProtoReflect() protoreflect.Message
func (*AnimeSnatches) Reset ¶
func (x *AnimeSnatches) Reset()
func (*AnimeSnatches) String ¶
func (x *AnimeSnatches) 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 Show ¶
type Show struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` DiskPath string `protobuf:"bytes,2,opt,name=disk_path,json=diskPath,proto3" json:"disk_path,omitempty"` Quality string `protobuf:"bytes,3,opt,name=quality,proto3" json:"quality,omitempty"` // contains filtered or unexported fields }
func (*Show) Descriptor
deprecated
func (*Show) GetDiskPath ¶
func (*Show) GetQuality ¶
func (*Show) ProtoMessage ¶
func (*Show) ProtoMessage()
func (*Show) ProtoReflect ¶
func (x *Show) ProtoReflect() protoreflect.Message
type Shows ¶
type Shows struct { Shows []*Show `protobuf:"bytes,1,rep,name=shows,proto3" json:"shows,omitempty"` // contains filtered or unexported fields }
func (*Shows) Descriptor
deprecated
func (*Shows) ProtoMessage ¶
func (*Shows) ProtoMessage()
func (*Shows) ProtoReflect ¶
func (x *Shows) ProtoReflect() protoreflect.Message
type TV ¶
type TV interface { List(context.Context, *google_protobuf.Empty) (*Shows, error) Track(context.Context, *Show) (*google_protobuf.Empty, error) Untrack(context.Context, *Show) (*google_protobuf.Empty, error) Snatches(context.Context, *google_protobuf.Empty) (*TVSnatches, error) }
func NewTVJSONClient ¶
func NewTVJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TV
NewTVJSONClient creates a JSON client that implements the TV interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewTVProtobufClient ¶
func NewTVProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TV
NewTVProtobufClient creates a Protobuf client that implements the TV interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type TVSnatch ¶
type TVSnatch struct { Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Freeleech bool `protobuf:"varint,3,opt,name=freeleech,proto3" json:"freeleech,omitempty"` TorrentId string `protobuf:"bytes,4,opt,name=torrent_id,json=torrentId,proto3" json:"torrent_id,omitempty"` // contains filtered or unexported fields }
func (*TVSnatch) Descriptor
deprecated
func (*TVSnatch) GetCategory ¶
func (*TVSnatch) GetFreeleech ¶
func (*TVSnatch) GetTorrentId ¶
func (*TVSnatch) ProtoMessage ¶
func (*TVSnatch) ProtoMessage()
func (*TVSnatch) ProtoReflect ¶
func (x *TVSnatch) ProtoReflect() protoreflect.Message
type TVSnatches ¶
type TVSnatches struct { Snatches []*TVSnatch `protobuf:"bytes,1,rep,name=snatches,proto3" json:"snatches,omitempty"` // contains filtered or unexported fields }
func (*TVSnatches) Descriptor
deprecated
func (*TVSnatches) Descriptor() ([]byte, []int)
Deprecated: Use TVSnatches.ProtoReflect.Descriptor instead.
func (*TVSnatches) GetSnatches ¶
func (x *TVSnatches) GetSnatches() []*TVSnatch
func (*TVSnatches) ProtoMessage ¶
func (*TVSnatches) ProtoMessage()
func (*TVSnatches) ProtoReflect ¶
func (x *TVSnatches) ProtoReflect() protoreflect.Message
func (*TVSnatches) Reset ¶
func (x *TVSnatches) Reset()
func (*TVSnatches) String ¶
func (x *TVSnatches) 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 NewAnimeServer ¶
func NewAnimeServer(svc Anime, opts ...interface{}) TwirpServer
NewAnimeServer 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 NewTVServer ¶
func NewTVServer(svc TV, opts ...interface{}) TwirpServer
NewTVServer 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).