Documentation
¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type HTTPClient
- type Manage
- type ManualImportRequest
- func (*ManualImportRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ManualImportRequest) GetCategory() int64
- func (x *ManualImportRequest) GetCompetition() int64
- func (x *ManualImportRequest) GetForce() bool
- func (x *ManualImportRequest) GetFromDate() string
- func (x *ManualImportRequest) GetToDate() string
- func (*ManualImportRequest) ProtoMessage()
- func (x *ManualImportRequest) ProtoReflect() protoreflect.Message
- func (x *ManualImportRequest) Reset()
- func (x *ManualImportRequest) String() string
- type ManualImportResponse
- func (*ManualImportResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ManualImportResponse) GetQueuedImports() int64
- func (*ManualImportResponse) ProtoMessage()
- func (x *ManualImportResponse) ProtoReflect() protoreflect.Message
- func (x *ManualImportResponse) Reset()
- func (x *ManualImportResponse) String() string
- type TwirpServer
Constants ¶
const ManagePathPrefix = "/twirp/ttab.everysport.Manage/"
ManagePathPrefix 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_everysport_service_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 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 Manage ¶
type Manage interface {
// ManualImport re-imports calendar events based on a search query.
ManualImport(context.Context, *ManualImportRequest) (*ManualImportResponse, error)
}
func NewManageJSONClient ¶
func NewManageJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Manage
NewManageJSONClient creates a JSON client that implements the Manage interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewManageProtobufClient ¶
func NewManageProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Manage
NewManageProtobufClient creates a Protobuf client that implements the Manage interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type ManualImportRequest ¶
type ManualImportRequest struct {
// FromDate is the date from which to fetch events for import. Optional,
// defaults to today.
FromDate string `protobuf:"bytes,1,opt,name=from_date,json=fromDate,proto3" json:"from_date,omitempty"`
// FromDate is the last date we should get events for. Optional.
ToDate string `protobuf:"bytes,2,opt,name=to_date,json=toDate,proto3" json:"to_date,omitempty"`
// Category only re-imports the events with the specific category.
Category int64 `protobuf:"varint,3,opt,name=category,proto3" json:"category,omitempty"`
// Category only re-imports the events for the specific competition static ID.
Competition int64 `protobuf:"varint,4,opt,name=competition,proto3" json:"competition,omitempty"`
// Force overwrite of calendar entries.
Force bool `protobuf:"varint,5,opt,name=force,proto3" json:"force,omitempty"`
// contains filtered or unexported fields
}
func (*ManualImportRequest) Descriptor
deprecated
func (*ManualImportRequest) Descriptor() ([]byte, []int)
Deprecated: Use ManualImportRequest.ProtoReflect.Descriptor instead.
func (*ManualImportRequest) GetCategory ¶
func (x *ManualImportRequest) GetCategory() int64
func (*ManualImportRequest) GetCompetition ¶
func (x *ManualImportRequest) GetCompetition() int64
func (*ManualImportRequest) GetForce ¶
func (x *ManualImportRequest) GetForce() bool
func (*ManualImportRequest) GetFromDate ¶
func (x *ManualImportRequest) GetFromDate() string
func (*ManualImportRequest) GetToDate ¶
func (x *ManualImportRequest) GetToDate() string
func (*ManualImportRequest) ProtoMessage ¶
func (*ManualImportRequest) ProtoMessage()
func (*ManualImportRequest) ProtoReflect ¶
func (x *ManualImportRequest) ProtoReflect() protoreflect.Message
func (*ManualImportRequest) Reset ¶
func (x *ManualImportRequest) Reset()
func (*ManualImportRequest) String ¶
func (x *ManualImportRequest) String() string
type ManualImportResponse ¶
type ManualImportResponse struct {
// QueuedImports is the total numer of events that were queued for import.
QueuedImports int64 `protobuf:"varint,1,opt,name=queued_imports,json=queuedImports,proto3" json:"queued_imports,omitempty"`
// contains filtered or unexported fields
}
func (*ManualImportResponse) Descriptor
deprecated
func (*ManualImportResponse) Descriptor() ([]byte, []int)
Deprecated: Use ManualImportResponse.ProtoReflect.Descriptor instead.
func (*ManualImportResponse) GetQueuedImports ¶
func (x *ManualImportResponse) GetQueuedImports() int64
func (*ManualImportResponse) ProtoMessage ¶
func (*ManualImportResponse) ProtoMessage()
func (*ManualImportResponse) ProtoReflect ¶
func (x *ManualImportResponse) ProtoReflect() protoreflect.Message
func (*ManualImportResponse) Reset ¶
func (x *ManualImportResponse) Reset()
func (*ManualImportResponse) String ¶
func (x *ManualImportResponse) 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 NewManageServer ¶
func NewManageServer(svc Manage, opts ...interface{}) TwirpServer
NewManageServer 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).