Documentation
¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type Announcement
- func (*Announcement) Descriptor() ([]byte, []int)deprecated
- func (x *Announcement) GetBody() string
- func (x *Announcement) GetLink() string
- func (x *Announcement) GetTitle() string
- func (*Announcement) ProtoMessage()
- func (x *Announcement) ProtoReflect() protoreflect.Message
- func (x *Announcement) Reset()
- func (x *Announcement) String() string
- type AnnouncementsResponse
- func (*AnnouncementsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AnnouncementsResponse) GetAnnouncements() []*Announcement
- func (*AnnouncementsResponse) ProtoMessage()
- func (x *AnnouncementsResponse) ProtoReflect() protoreflect.Message
- func (x *AnnouncementsResponse) Reset()
- func (x *AnnouncementsResponse) String() string
- type ConfigResponse
- type ConfigService
- type EnableGamesRequest
- func (*EnableGamesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EnableGamesRequest) GetEnabled() bool
- func (*EnableGamesRequest) ProtoMessage()
- func (x *EnableGamesRequest) ProtoReflect() protoreflect.Message
- func (x *EnableGamesRequest) Reset()
- func (x *EnableGamesRequest) String() string
- type GetAnnouncementsRequest
- type HTTPClient
- type PermissionsRequest
- func (*PermissionsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PermissionsRequest) GetAdmin() *wrapperspb.BoolValue
- func (x *PermissionsRequest) GetBot() *wrapperspb.BoolValue
- func (x *PermissionsRequest) GetDirector() *wrapperspb.BoolValue
- func (x *PermissionsRequest) GetMod() *wrapperspb.BoolValue
- func (x *PermissionsRequest) GetUsername() string
- func (*PermissionsRequest) ProtoMessage()
- func (x *PermissionsRequest) ProtoReflect() protoreflect.Message
- func (x *PermissionsRequest) Reset()
- func (x *PermissionsRequest) String() string
- type SetAnnouncementsRequest
- func (*SetAnnouncementsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetAnnouncementsRequest) GetAnnouncements() []*Announcement
- func (*SetAnnouncementsRequest) ProtoMessage()
- func (x *SetAnnouncementsRequest) ProtoReflect() protoreflect.Message
- func (x *SetAnnouncementsRequest) Reset()
- func (x *SetAnnouncementsRequest) String() string
- type SetFEHashRequest
- type TwirpServer
- type UserRequest
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) GetEmail() string
- func (x *UserResponse) GetIsAdmin() bool
- func (x *UserResponse) GetIsBot() bool
- func (x *UserResponse) GetIsDirector() bool
- func (x *UserResponse) GetIsMod() bool
- func (x *UserResponse) GetUsername() string
- func (x *UserResponse) GetUuid() string
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) String() string
Constants ¶
const ConfigServicePathPrefix = "/twirp/config_service.ConfigService/"
ConfigServicePathPrefix 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_api_proto_config_service_config_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 Announcement ¶ added in v0.1.3
type Announcement struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Link string `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` // contains filtered or unexported fields }
func (*Announcement) Descriptor
deprecated
added in
v0.1.3
func (*Announcement) Descriptor() ([]byte, []int)
Deprecated: Use Announcement.ProtoReflect.Descriptor instead.
func (*Announcement) GetBody ¶ added in v0.1.3
func (x *Announcement) GetBody() string
func (*Announcement) GetLink ¶ added in v0.1.3
func (x *Announcement) GetLink() string
func (*Announcement) GetTitle ¶ added in v0.1.3
func (x *Announcement) GetTitle() string
func (*Announcement) ProtoMessage ¶ added in v0.1.3
func (*Announcement) ProtoMessage()
func (*Announcement) ProtoReflect ¶ added in v0.1.3
func (x *Announcement) ProtoReflect() protoreflect.Message
func (*Announcement) Reset ¶ added in v0.1.3
func (x *Announcement) Reset()
func (*Announcement) String ¶ added in v0.1.3
func (x *Announcement) String() string
type AnnouncementsResponse ¶ added in v0.1.3
type AnnouncementsResponse struct { Announcements []*Announcement `protobuf:"bytes,1,rep,name=announcements,proto3" json:"announcements,omitempty"` // contains filtered or unexported fields }
func (*AnnouncementsResponse) Descriptor
deprecated
added in
v0.1.3
func (*AnnouncementsResponse) Descriptor() ([]byte, []int)
Deprecated: Use AnnouncementsResponse.ProtoReflect.Descriptor instead.
func (*AnnouncementsResponse) GetAnnouncements ¶ added in v0.1.3
func (x *AnnouncementsResponse) GetAnnouncements() []*Announcement
func (*AnnouncementsResponse) ProtoMessage ¶ added in v0.1.3
func (*AnnouncementsResponse) ProtoMessage()
func (*AnnouncementsResponse) ProtoReflect ¶ added in v0.1.3
func (x *AnnouncementsResponse) ProtoReflect() protoreflect.Message
func (*AnnouncementsResponse) Reset ¶ added in v0.1.3
func (x *AnnouncementsResponse) Reset()
func (*AnnouncementsResponse) String ¶ added in v0.1.3
func (x *AnnouncementsResponse) String() string
type ConfigResponse ¶
type ConfigResponse struct {
// contains filtered or unexported fields
}
func (*ConfigResponse) Descriptor
deprecated
func (*ConfigResponse) Descriptor() ([]byte, []int)
Deprecated: Use ConfigResponse.ProtoReflect.Descriptor instead.
func (*ConfigResponse) ProtoMessage ¶
func (*ConfigResponse) ProtoMessage()
func (*ConfigResponse) ProtoReflect ¶
func (x *ConfigResponse) ProtoReflect() protoreflect.Message
func (*ConfigResponse) Reset ¶
func (x *ConfigResponse) Reset()
func (*ConfigResponse) String ¶
func (x *ConfigResponse) String() string
type ConfigService ¶
type ConfigService interface { SetGamesEnabled(context.Context, *EnableGamesRequest) (*ConfigResponse, error) SetFEHash(context.Context, *SetFEHashRequest) (*ConfigResponse, error) SetUserPermissions(context.Context, *PermissionsRequest) (*ConfigResponse, error) GetUserDetails(context.Context, *UserRequest) (*UserResponse, error) SetAnnouncements(context.Context, *SetAnnouncementsRequest) (*ConfigResponse, error) GetAnnouncements(context.Context, *GetAnnouncementsRequest) (*AnnouncementsResponse, error) }
func NewConfigServiceJSONClient ¶
func NewConfigServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ConfigService
NewConfigServiceJSONClient creates a JSON client that implements the ConfigService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewConfigServiceProtobufClient ¶
func NewConfigServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ConfigService
NewConfigServiceProtobufClient creates a Protobuf client that implements the ConfigService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type EnableGamesRequest ¶
type EnableGamesRequest struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
func (*EnableGamesRequest) Descriptor
deprecated
func (*EnableGamesRequest) Descriptor() ([]byte, []int)
Deprecated: Use EnableGamesRequest.ProtoReflect.Descriptor instead.
func (*EnableGamesRequest) GetEnabled ¶
func (x *EnableGamesRequest) GetEnabled() bool
func (*EnableGamesRequest) ProtoMessage ¶
func (*EnableGamesRequest) ProtoMessage()
func (*EnableGamesRequest) ProtoReflect ¶
func (x *EnableGamesRequest) ProtoReflect() protoreflect.Message
func (*EnableGamesRequest) Reset ¶
func (x *EnableGamesRequest) Reset()
func (*EnableGamesRequest) String ¶
func (x *EnableGamesRequest) String() string
type GetAnnouncementsRequest ¶ added in v0.1.3
type GetAnnouncementsRequest struct {
// contains filtered or unexported fields
}
func (*GetAnnouncementsRequest) Descriptor
deprecated
added in
v0.1.3
func (*GetAnnouncementsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAnnouncementsRequest.ProtoReflect.Descriptor instead.
func (*GetAnnouncementsRequest) ProtoMessage ¶ added in v0.1.3
func (*GetAnnouncementsRequest) ProtoMessage()
func (*GetAnnouncementsRequest) ProtoReflect ¶ added in v0.1.3
func (x *GetAnnouncementsRequest) ProtoReflect() protoreflect.Message
func (*GetAnnouncementsRequest) Reset ¶ added in v0.1.3
func (x *GetAnnouncementsRequest) Reset()
func (*GetAnnouncementsRequest) String ¶ added in v0.1.3
func (x *GetAnnouncementsRequest) 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 PermissionsRequest ¶ added in v0.1.3
type PermissionsRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Director *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=director,proto3" json:"director,omitempty"` Admin *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=admin,proto3" json:"admin,omitempty"` Mod *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=mod,proto3" json:"mod,omitempty"` Bot *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=bot,proto3" json:"bot,omitempty"` // contains filtered or unexported fields }
func (*PermissionsRequest) Descriptor
deprecated
added in
v0.1.3
func (*PermissionsRequest) Descriptor() ([]byte, []int)
Deprecated: Use PermissionsRequest.ProtoReflect.Descriptor instead.
func (*PermissionsRequest) GetAdmin ¶ added in v0.1.3
func (x *PermissionsRequest) GetAdmin() *wrapperspb.BoolValue
func (*PermissionsRequest) GetBot ¶ added in v0.1.3
func (x *PermissionsRequest) GetBot() *wrapperspb.BoolValue
func (*PermissionsRequest) GetDirector ¶ added in v0.1.3
func (x *PermissionsRequest) GetDirector() *wrapperspb.BoolValue
func (*PermissionsRequest) GetMod ¶ added in v0.1.3
func (x *PermissionsRequest) GetMod() *wrapperspb.BoolValue
func (*PermissionsRequest) GetUsername ¶ added in v0.1.3
func (x *PermissionsRequest) GetUsername() string
func (*PermissionsRequest) ProtoMessage ¶ added in v0.1.3
func (*PermissionsRequest) ProtoMessage()
func (*PermissionsRequest) ProtoReflect ¶ added in v0.1.3
func (x *PermissionsRequest) ProtoReflect() protoreflect.Message
func (*PermissionsRequest) Reset ¶ added in v0.1.3
func (x *PermissionsRequest) Reset()
func (*PermissionsRequest) String ¶ added in v0.1.3
func (x *PermissionsRequest) String() string
type SetAnnouncementsRequest ¶ added in v0.1.3
type SetAnnouncementsRequest struct { Announcements []*Announcement `protobuf:"bytes,1,rep,name=announcements,proto3" json:"announcements,omitempty"` // contains filtered or unexported fields }
func (*SetAnnouncementsRequest) Descriptor
deprecated
added in
v0.1.3
func (*SetAnnouncementsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetAnnouncementsRequest.ProtoReflect.Descriptor instead.
func (*SetAnnouncementsRequest) GetAnnouncements ¶ added in v0.1.3
func (x *SetAnnouncementsRequest) GetAnnouncements() []*Announcement
func (*SetAnnouncementsRequest) ProtoMessage ¶ added in v0.1.3
func (*SetAnnouncementsRequest) ProtoMessage()
func (*SetAnnouncementsRequest) ProtoReflect ¶ added in v0.1.3
func (x *SetAnnouncementsRequest) ProtoReflect() protoreflect.Message
func (*SetAnnouncementsRequest) Reset ¶ added in v0.1.3
func (x *SetAnnouncementsRequest) Reset()
func (*SetAnnouncementsRequest) String ¶ added in v0.1.3
func (x *SetAnnouncementsRequest) String() string
type SetFEHashRequest ¶ added in v0.1.3
type SetFEHashRequest struct { Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*SetFEHashRequest) Descriptor
deprecated
added in
v0.1.3
func (*SetFEHashRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetFEHashRequest.ProtoReflect.Descriptor instead.
func (*SetFEHashRequest) GetHash ¶ added in v0.1.3
func (x *SetFEHashRequest) GetHash() string
func (*SetFEHashRequest) ProtoMessage ¶ added in v0.1.3
func (*SetFEHashRequest) ProtoMessage()
func (*SetFEHashRequest) ProtoReflect ¶ added in v0.1.3
func (x *SetFEHashRequest) ProtoReflect() protoreflect.Message
func (*SetFEHashRequest) Reset ¶ added in v0.1.3
func (x *SetFEHashRequest) Reset()
func (*SetFEHashRequest) String ¶ added in v0.1.3
func (x *SetFEHashRequest) 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 NewConfigServiceServer ¶
func NewConfigServiceServer(svc ConfigService, opts ...interface{}) TwirpServer
NewConfigServiceServer 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 UserRequest ¶ added in v0.1.3
type UserRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*UserRequest) Descriptor
deprecated
added in
v0.1.3
func (*UserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) GetUsername ¶ added in v0.1.3
func (x *UserRequest) GetUsername() string
func (*UserRequest) ProtoMessage ¶ added in v0.1.3
func (*UserRequest) ProtoMessage()
func (*UserRequest) ProtoReflect ¶ added in v0.1.3
func (x *UserRequest) ProtoReflect() protoreflect.Message
func (*UserRequest) Reset ¶ added in v0.1.3
func (x *UserRequest) Reset()
func (*UserRequest) String ¶ added in v0.1.3
func (x *UserRequest) String() string
type UserResponse ¶ added in v0.1.3
type UserResponse struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` IsBot bool `protobuf:"varint,4,opt,name=is_bot,json=isBot,proto3" json:"is_bot,omitempty"` IsDirector bool `protobuf:"varint,5,opt,name=is_director,json=isDirector,proto3" json:"is_director,omitempty"` IsMod bool `protobuf:"varint,6,opt,name=is_mod,json=isMod,proto3" json:"is_mod,omitempty"` IsAdmin bool `protobuf:"varint,7,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` // contains filtered or unexported fields }
func (*UserResponse) Descriptor
deprecated
added in
v0.1.3
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) GetEmail ¶ added in v0.1.3
func (x *UserResponse) GetEmail() string
func (*UserResponse) GetIsAdmin ¶ added in v0.1.3
func (x *UserResponse) GetIsAdmin() bool
func (*UserResponse) GetIsBot ¶ added in v0.1.3
func (x *UserResponse) GetIsBot() bool
func (*UserResponse) GetIsDirector ¶ added in v0.1.3
func (x *UserResponse) GetIsDirector() bool
func (*UserResponse) GetIsMod ¶ added in v0.1.3
func (x *UserResponse) GetIsMod() bool
func (*UserResponse) GetUsername ¶ added in v0.1.3
func (x *UserResponse) GetUsername() string
func (*UserResponse) GetUuid ¶ added in v0.1.3
func (x *UserResponse) GetUuid() string
func (*UserResponse) ProtoMessage ¶ added in v0.1.3
func (*UserResponse) ProtoMessage()
func (*UserResponse) ProtoReflect ¶ added in v0.1.3
func (x *UserResponse) ProtoReflect() protoreflect.Message
func (*UserResponse) Reset ¶ added in v0.1.3
func (x *UserResponse) Reset()
func (*UserResponse) String ¶ added in v0.1.3
func (x *UserResponse) String() string