Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type EmailType
- type GetActionsRequest
- type GetNotorietyReportRequest
- func (*GetNotorietyReportRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetNotorietyReportRequest) GetUserId() string
- func (*GetNotorietyReportRequest) ProtoMessage()
- func (x *GetNotorietyReportRequest) ProtoReflect() protoreflect.Message
- func (x *GetNotorietyReportRequest) Reset()
- func (x *GetNotorietyReportRequest) String() string
- type HTTPClient
- type ModAction
- func (*ModAction) Descriptor() ([]byte, []int)deprecated
- func (x *ModAction) GetApplierUserId() string
- func (x *ModAction) GetChannel() string
- func (x *ModAction) GetChatText() string
- func (x *ModAction) GetDuration() int32
- func (x *ModAction) GetEmailType() EmailType
- func (x *ModAction) GetEndTime() *timestamppb.Timestamp
- func (x *ModAction) GetMessageId() string
- func (x *ModAction) GetNote() string
- func (x *ModAction) GetRemovedTime() *timestamppb.Timestamp
- func (x *ModAction) GetRemoverUserId() string
- func (x *ModAction) GetStartTime() *timestamppb.Timestamp
- func (x *ModAction) GetType() ModActionType
- func (x *ModAction) GetUserId() string
- func (*ModAction) ProtoMessage()
- func (x *ModAction) ProtoReflect() protoreflect.Message
- func (x *ModAction) Reset()
- func (x *ModAction) String() string
- type ModActionResponse
- type ModActionType
- func (ModActionType) Descriptor() protoreflect.EnumDescriptor
- func (x ModActionType) Enum() *ModActionType
- func (ModActionType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ModActionType) Number() protoreflect.EnumNumber
- func (x ModActionType) String() string
- func (ModActionType) Type() protoreflect.EnumType
- type ModActionsList
- type ModActionsMap
- type ModService
- type NotorietyReport
- func (*NotorietyReport) Descriptor() ([]byte, []int)deprecated
- func (x *NotorietyReport) GetGames() []*NotoriousGame
- func (x *NotorietyReport) GetScore() int32
- func (*NotorietyReport) ProtoMessage()
- func (x *NotorietyReport) ProtoReflect() protoreflect.Message
- func (x *NotorietyReport) Reset()
- func (x *NotorietyReport) String() string
- type NotoriousGame
- func (*NotoriousGame) Descriptor() ([]byte, []int)deprecated
- func (x *NotoriousGame) GetCreatedAt() *timestamppb.Timestamp
- func (x *NotoriousGame) GetId() string
- func (x *NotoriousGame) GetType() NotoriousGameType
- func (*NotoriousGame) ProtoMessage()
- func (x *NotoriousGame) ProtoReflect() protoreflect.Message
- func (x *NotoriousGame) Reset()
- func (x *NotoriousGame) String() string
- type NotoriousGameType
- func (NotoriousGameType) Descriptor() protoreflect.EnumDescriptor
- func (x NotoriousGameType) Enum() *NotoriousGameType
- func (NotoriousGameType) EnumDescriptor() ([]byte, []int)deprecated
- func (x NotoriousGameType) Number() protoreflect.EnumNumber
- func (x NotoriousGameType) String() string
- func (NotoriousGameType) Type() protoreflect.EnumType
- type ResetNotorietyRequest
- func (*ResetNotorietyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetNotorietyRequest) GetUserId() string
- func (*ResetNotorietyRequest) ProtoMessage()
- func (x *ResetNotorietyRequest) ProtoReflect() protoreflect.Message
- func (x *ResetNotorietyRequest) Reset()
- func (x *ResetNotorietyRequest) String() string
- type ResetNotorietyResponse
- type TwirpServer
Constants ¶
const ModServicePathPrefix = "/twirp/mod_service.ModService/"
ModServicePathPrefix 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 ( ModActionType_name = map[int32]string{ 0: "MUTE", 1: "SUSPEND_ACCOUNT", 2: "SUSPEND_RATED_GAMES", 3: "SUSPEND_GAMES", 4: "RESET_RATINGS", 5: "RESET_STATS", 6: "RESET_STATS_AND_RATINGS", 7: "REMOVE_CHAT", 8: "DELETE_ACCOUNT", } ModActionType_value = map[string]int32{ "MUTE": 0, "SUSPEND_ACCOUNT": 1, "SUSPEND_RATED_GAMES": 2, "SUSPEND_GAMES": 3, "RESET_RATINGS": 4, "RESET_STATS": 5, "RESET_STATS_AND_RATINGS": 6, "REMOVE_CHAT": 7, "DELETE_ACCOUNT": 8, } )
Enum value maps for ModActionType.
var ( EmailType_name = map[int32]string{ 0: "DEFAULT", 1: "CHEATING", 2: "DELETION", } EmailType_value = map[string]int32{ "DEFAULT": 0, "CHEATING": 1, "DELETION": 2, } )
Enum value maps for EmailType.
var ( NotoriousGameType_name = map[int32]string{ 0: "GOOD", 1: "NO_PLAY", 2: "SITTING", 3: "SANDBAG", 4: "NO_PLAY_DENIED_NUDGE", 5: "EXCESSIVE_PHONIES", } NotoriousGameType_value = map[string]int32{ "GOOD": 0, "NO_PLAY": 1, "SITTING": 2, "SANDBAG": 3, "NO_PLAY_DENIED_NUDGE": 4, "EXCESSIVE_PHONIES": 5, } )
Enum value maps for NotoriousGameType.
var File_api_proto_mod_service_mod_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 EmailType ¶
type EmailType int32
func (EmailType) Descriptor ¶
func (EmailType) Descriptor() protoreflect.EnumDescriptor
func (EmailType) EnumDescriptor
deprecated
func (EmailType) Number ¶
func (x EmailType) Number() protoreflect.EnumNumber
func (EmailType) Type ¶
func (EmailType) Type() protoreflect.EnumType
type GetActionsRequest ¶
type GetActionsRequest struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
func (*GetActionsRequest) Descriptor
deprecated
func (*GetActionsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetActionsRequest.ProtoReflect.Descriptor instead.
func (*GetActionsRequest) GetUserId ¶
func (x *GetActionsRequest) GetUserId() string
func (*GetActionsRequest) ProtoMessage ¶
func (*GetActionsRequest) ProtoMessage()
func (*GetActionsRequest) ProtoReflect ¶
func (x *GetActionsRequest) ProtoReflect() protoreflect.Message
func (*GetActionsRequest) Reset ¶
func (x *GetActionsRequest) Reset()
func (*GetActionsRequest) String ¶
func (x *GetActionsRequest) String() string
type GetNotorietyReportRequest ¶
type GetNotorietyReportRequest struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
func (*GetNotorietyReportRequest) Descriptor
deprecated
func (*GetNotorietyReportRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetNotorietyReportRequest.ProtoReflect.Descriptor instead.
func (*GetNotorietyReportRequest) GetUserId ¶
func (x *GetNotorietyReportRequest) GetUserId() string
func (*GetNotorietyReportRequest) ProtoMessage ¶
func (*GetNotorietyReportRequest) ProtoMessage()
func (*GetNotorietyReportRequest) ProtoReflect ¶
func (x *GetNotorietyReportRequest) ProtoReflect() protoreflect.Message
func (*GetNotorietyReportRequest) Reset ¶
func (x *GetNotorietyReportRequest) Reset()
func (*GetNotorietyReportRequest) String ¶
func (x *GetNotorietyReportRequest) 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 ModAction ¶
type ModAction struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Type ModActionType `protobuf:"varint,2,opt,name=type,proto3,enum=mod_service.ModActionType" json:"type,omitempty"` Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` RemovedTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=removed_time,json=removedTime,proto3" json:"removed_time,omitempty"` Channel string `protobuf:"bytes,7,opt,name=channel,proto3" json:"channel,omitempty"` MessageId string `protobuf:"bytes,8,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` ApplierUserId string `protobuf:"bytes,9,opt,name=applier_user_id,json=applierUserId,proto3" json:"applier_user_id,omitempty"` RemoverUserId string `protobuf:"bytes,10,opt,name=remover_user_id,json=removerUserId,proto3" json:"remover_user_id,omitempty"` ChatText string `protobuf:"bytes,11,opt,name=chat_text,json=chatText,proto3" json:"chat_text,omitempty"` // Note: an optional note from the moderator. Note string `protobuf:"bytes,12,opt,name=note,proto3" json:"note,omitempty"` EmailType EmailType `protobuf:"varint,13,opt,name=email_type,json=emailType,proto3,enum=mod_service.EmailType" json:"email_type,omitempty"` // contains filtered or unexported fields }
func (*ModAction) Descriptor
deprecated
func (*ModAction) GetApplierUserId ¶
func (*ModAction) GetChannel ¶
func (*ModAction) GetChatText ¶
func (*ModAction) GetDuration ¶
func (*ModAction) GetEmailType ¶
func (*ModAction) GetEndTime ¶
func (x *ModAction) GetEndTime() *timestamppb.Timestamp
func (*ModAction) GetMessageId ¶
func (*ModAction) GetRemovedTime ¶
func (x *ModAction) GetRemovedTime() *timestamppb.Timestamp
func (*ModAction) GetRemoverUserId ¶
func (*ModAction) GetStartTime ¶
func (x *ModAction) GetStartTime() *timestamppb.Timestamp
func (*ModAction) GetType ¶
func (x *ModAction) GetType() ModActionType
func (*ModAction) ProtoMessage ¶
func (*ModAction) ProtoMessage()
func (*ModAction) ProtoReflect ¶
func (x *ModAction) ProtoReflect() protoreflect.Message
type ModActionResponse ¶
type ModActionResponse struct {
// contains filtered or unexported fields
}
func (*ModActionResponse) Descriptor
deprecated
func (*ModActionResponse) Descriptor() ([]byte, []int)
Deprecated: Use ModActionResponse.ProtoReflect.Descriptor instead.
func (*ModActionResponse) ProtoMessage ¶
func (*ModActionResponse) ProtoMessage()
func (*ModActionResponse) ProtoReflect ¶
func (x *ModActionResponse) ProtoReflect() protoreflect.Message
func (*ModActionResponse) Reset ¶
func (x *ModActionResponse) Reset()
func (*ModActionResponse) String ¶
func (x *ModActionResponse) String() string
type ModActionType ¶
type ModActionType int32
const ( ModActionType_MUTE ModActionType = 0 ModActionType_SUSPEND_ACCOUNT ModActionType = 1 ModActionType_SUSPEND_RATED_GAMES ModActionType = 2 ModActionType_SUSPEND_GAMES ModActionType = 3 ModActionType_RESET_RATINGS ModActionType = 4 ModActionType_RESET_STATS ModActionType = 5 ModActionType_RESET_STATS_AND_RATINGS ModActionType = 6 ModActionType_REMOVE_CHAT ModActionType = 7 ModActionType_DELETE_ACCOUNT ModActionType = 8 )
func (ModActionType) Descriptor ¶
func (ModActionType) Descriptor() protoreflect.EnumDescriptor
func (ModActionType) Enum ¶
func (x ModActionType) Enum() *ModActionType
func (ModActionType) EnumDescriptor
deprecated
func (ModActionType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ModActionType.Descriptor instead.
func (ModActionType) Number ¶
func (x ModActionType) Number() protoreflect.EnumNumber
func (ModActionType) String ¶
func (x ModActionType) String() string
func (ModActionType) Type ¶
func (ModActionType) Type() protoreflect.EnumType
type ModActionsList ¶
type ModActionsList struct { Actions []*ModAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` // contains filtered or unexported fields }
func (*ModActionsList) Descriptor
deprecated
func (*ModActionsList) Descriptor() ([]byte, []int)
Deprecated: Use ModActionsList.ProtoReflect.Descriptor instead.
func (*ModActionsList) GetActions ¶
func (x *ModActionsList) GetActions() []*ModAction
func (*ModActionsList) ProtoMessage ¶
func (*ModActionsList) ProtoMessage()
func (*ModActionsList) ProtoReflect ¶
func (x *ModActionsList) ProtoReflect() protoreflect.Message
func (*ModActionsList) Reset ¶
func (x *ModActionsList) Reset()
func (*ModActionsList) String ¶
func (x *ModActionsList) String() string
type ModActionsMap ¶
type ModActionsMap struct { Actions map[string]*ModAction `` /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ModActionsMap) Descriptor
deprecated
func (*ModActionsMap) Descriptor() ([]byte, []int)
Deprecated: Use ModActionsMap.ProtoReflect.Descriptor instead.
func (*ModActionsMap) GetActions ¶
func (x *ModActionsMap) GetActions() map[string]*ModAction
func (*ModActionsMap) ProtoMessage ¶
func (*ModActionsMap) ProtoMessage()
func (*ModActionsMap) ProtoReflect ¶
func (x *ModActionsMap) ProtoReflect() protoreflect.Message
func (*ModActionsMap) Reset ¶
func (x *ModActionsMap) Reset()
func (*ModActionsMap) String ¶
func (x *ModActionsMap) String() string
type ModService ¶
type ModService interface { ApplyActions(context.Context, *ModActionsList) (*ModActionResponse, error) RemoveActions(context.Context, *ModActionsList) (*ModActionResponse, error) GetActions(context.Context, *GetActionsRequest) (*ModActionsMap, error) GetActionHistory(context.Context, *GetActionsRequest) (*ModActionsList, error) GetNotorietyReport(context.Context, *GetNotorietyReportRequest) (*NotorietyReport, error) ResetNotoriety(context.Context, *ResetNotorietyRequest) (*ResetNotorietyResponse, error) }
func NewModServiceJSONClient ¶
func NewModServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ModService
NewModServiceJSONClient creates a JSON client that implements the ModService interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewModServiceProtobufClient ¶
func NewModServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ModService
NewModServiceProtobufClient creates a Protobuf client that implements the ModService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type NotorietyReport ¶
type NotorietyReport struct { Score int32 `protobuf:"varint,1,opt,name=score,proto3" json:"score,omitempty"` Games []*NotoriousGame `protobuf:"bytes,2,rep,name=games,proto3" json:"games,omitempty"` // contains filtered or unexported fields }
func (*NotorietyReport) Descriptor
deprecated
func (*NotorietyReport) Descriptor() ([]byte, []int)
Deprecated: Use NotorietyReport.ProtoReflect.Descriptor instead.
func (*NotorietyReport) GetGames ¶
func (x *NotorietyReport) GetGames() []*NotoriousGame
func (*NotorietyReport) GetScore ¶
func (x *NotorietyReport) GetScore() int32
func (*NotorietyReport) ProtoMessage ¶
func (*NotorietyReport) ProtoMessage()
func (*NotorietyReport) ProtoReflect ¶
func (x *NotorietyReport) ProtoReflect() protoreflect.Message
func (*NotorietyReport) Reset ¶
func (x *NotorietyReport) Reset()
func (*NotorietyReport) String ¶
func (x *NotorietyReport) String() string
type NotoriousGame ¶
type NotoriousGame struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type NotoriousGameType `protobuf:"varint,2,opt,name=type,proto3,enum=mod_service.NotoriousGameType" json:"type,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*NotoriousGame) Descriptor
deprecated
func (*NotoriousGame) Descriptor() ([]byte, []int)
Deprecated: Use NotoriousGame.ProtoReflect.Descriptor instead.
func (*NotoriousGame) GetCreatedAt ¶
func (x *NotoriousGame) GetCreatedAt() *timestamppb.Timestamp
func (*NotoriousGame) GetId ¶
func (x *NotoriousGame) GetId() string
func (*NotoriousGame) GetType ¶
func (x *NotoriousGame) GetType() NotoriousGameType
func (*NotoriousGame) ProtoMessage ¶
func (*NotoriousGame) ProtoMessage()
func (*NotoriousGame) ProtoReflect ¶
func (x *NotoriousGame) ProtoReflect() protoreflect.Message
func (*NotoriousGame) Reset ¶
func (x *NotoriousGame) Reset()
func (*NotoriousGame) String ¶
func (x *NotoriousGame) String() string
type NotoriousGameType ¶
type NotoriousGameType int32
const ( NotoriousGameType_GOOD NotoriousGameType = 0 NotoriousGameType_NO_PLAY NotoriousGameType = 1 NotoriousGameType_SITTING NotoriousGameType = 2 NotoriousGameType_SANDBAG NotoriousGameType = 3 NotoriousGameType_NO_PLAY_DENIED_NUDGE NotoriousGameType = 4 NotoriousGameType_EXCESSIVE_PHONIES NotoriousGameType = 5 )
func (NotoriousGameType) Descriptor ¶
func (NotoriousGameType) Descriptor() protoreflect.EnumDescriptor
func (NotoriousGameType) Enum ¶
func (x NotoriousGameType) Enum() *NotoriousGameType
func (NotoriousGameType) EnumDescriptor
deprecated
func (NotoriousGameType) EnumDescriptor() ([]byte, []int)
Deprecated: Use NotoriousGameType.Descriptor instead.
func (NotoriousGameType) Number ¶
func (x NotoriousGameType) Number() protoreflect.EnumNumber
func (NotoriousGameType) String ¶
func (x NotoriousGameType) String() string
func (NotoriousGameType) Type ¶
func (NotoriousGameType) Type() protoreflect.EnumType
type ResetNotorietyRequest ¶
type ResetNotorietyRequest struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
func (*ResetNotorietyRequest) Descriptor
deprecated
func (*ResetNotorietyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResetNotorietyRequest.ProtoReflect.Descriptor instead.
func (*ResetNotorietyRequest) GetUserId ¶
func (x *ResetNotorietyRequest) GetUserId() string
func (*ResetNotorietyRequest) ProtoMessage ¶
func (*ResetNotorietyRequest) ProtoMessage()
func (*ResetNotorietyRequest) ProtoReflect ¶
func (x *ResetNotorietyRequest) ProtoReflect() protoreflect.Message
func (*ResetNotorietyRequest) Reset ¶
func (x *ResetNotorietyRequest) Reset()
func (*ResetNotorietyRequest) String ¶
func (x *ResetNotorietyRequest) String() string
type ResetNotorietyResponse ¶
type ResetNotorietyResponse struct {
// contains filtered or unexported fields
}
func (*ResetNotorietyResponse) Descriptor
deprecated
func (*ResetNotorietyResponse) Descriptor() ([]byte, []int)
Deprecated: Use ResetNotorietyResponse.ProtoReflect.Descriptor instead.
func (*ResetNotorietyResponse) ProtoMessage ¶
func (*ResetNotorietyResponse) ProtoMessage()
func (*ResetNotorietyResponse) ProtoReflect ¶
func (x *ResetNotorietyResponse) ProtoReflect() protoreflect.Message
func (*ResetNotorietyResponse) Reset ¶
func (x *ResetNotorietyResponse) Reset()
func (*ResetNotorietyResponse) String ¶
func (x *ResetNotorietyResponse) 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 NewModServiceServer ¶
func NewModServiceServer(svc ModService, opts ...interface{}) TwirpServer
NewModServiceServer 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).