Documentation ¶
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type CreateUserRequest
- type CreateUserResponse
- type HTTPClient
- type LinkDiscordUserRequest
- func (*LinkDiscordUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LinkDiscordUserRequest) GetDiscordId() string
- func (x *LinkDiscordUserRequest) GetUserId() string
- func (*LinkDiscordUserRequest) ProtoMessage()
- func (x *LinkDiscordUserRequest) ProtoReflect() protoreflect.Message
- func (x *LinkDiscordUserRequest) Reset()
- func (x *LinkDiscordUserRequest) String() string
- type LinkDiscordUserResponse
- type LookupDiscordUserRequest
- func (*LookupDiscordUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LookupDiscordUserRequest) GetDiscordId() string
- func (*LookupDiscordUserRequest) ProtoMessage()
- func (x *LookupDiscordUserRequest) ProtoReflect() protoreflect.Message
- func (x *LookupDiscordUserRequest) Reset()
- func (x *LookupDiscordUserRequest) String() string
- type LookupDiscordUserResponse
- func (*LookupDiscordUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LookupDiscordUserResponse) GetUser() *User
- func (*LookupDiscordUserResponse) ProtoMessage()
- func (x *LookupDiscordUserResponse) ProtoReflect() protoreflect.Message
- func (x *LookupDiscordUserResponse) Reset()
- func (x *LookupDiscordUserResponse) String() string
- type Taxonomy
- type TwirpServer
- type UnlinkDiscordUserRequest
- func (*UnlinkDiscordUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UnlinkDiscordUserRequest) GetDiscordId() string
- func (x *UnlinkDiscordUserRequest) GetUserId() string
- func (*UnlinkDiscordUserRequest) ProtoMessage()
- func (x *UnlinkDiscordUserRequest) ProtoReflect() protoreflect.Message
- func (x *UnlinkDiscordUserRequest) Reset()
- func (x *UnlinkDiscordUserRequest) String() string
- type UnlinkDiscordUserResponse
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamppb.Timestamp
- func (x *User) GetId() string
- func (x *User) GetName() string
- func (x *User) GetUpdatedAt() *timestamppb.Timestamp
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
Constants ¶
const TaxonomyPathPrefix = "/twirp/github.com.bsdlp.taxonomy.Taxonomy/"
TaxonomyPathPrefix 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_rpc_taxonomy_taxonomy_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 CreateUserRequest ¶
type CreateUserRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetName ¶
func (x *CreateUserRequest) GetName() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type CreateUserResponse ¶
type CreateUserResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetUser ¶
func (x *CreateUserResponse) GetUser() *User
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) 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 LinkDiscordUserRequest ¶
type LinkDiscordUserRequest struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` DiscordId string `protobuf:"bytes,2,opt,name=discord_id,json=discordId,proto3" json:"discord_id,omitempty"` // contains filtered or unexported fields }
func (*LinkDiscordUserRequest) Descriptor
deprecated
func (*LinkDiscordUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use LinkDiscordUserRequest.ProtoReflect.Descriptor instead.
func (*LinkDiscordUserRequest) GetDiscordId ¶
func (x *LinkDiscordUserRequest) GetDiscordId() string
func (*LinkDiscordUserRequest) GetUserId ¶
func (x *LinkDiscordUserRequest) GetUserId() string
func (*LinkDiscordUserRequest) ProtoMessage ¶
func (*LinkDiscordUserRequest) ProtoMessage()
func (*LinkDiscordUserRequest) ProtoReflect ¶
func (x *LinkDiscordUserRequest) ProtoReflect() protoreflect.Message
func (*LinkDiscordUserRequest) Reset ¶
func (x *LinkDiscordUserRequest) Reset()
func (*LinkDiscordUserRequest) String ¶
func (x *LinkDiscordUserRequest) String() string
type LinkDiscordUserResponse ¶
type LinkDiscordUserResponse struct {
// contains filtered or unexported fields
}
func (*LinkDiscordUserResponse) Descriptor
deprecated
func (*LinkDiscordUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use LinkDiscordUserResponse.ProtoReflect.Descriptor instead.
func (*LinkDiscordUserResponse) ProtoMessage ¶
func (*LinkDiscordUserResponse) ProtoMessage()
func (*LinkDiscordUserResponse) ProtoReflect ¶
func (x *LinkDiscordUserResponse) ProtoReflect() protoreflect.Message
func (*LinkDiscordUserResponse) Reset ¶
func (x *LinkDiscordUserResponse) Reset()
func (*LinkDiscordUserResponse) String ¶
func (x *LinkDiscordUserResponse) String() string
type LookupDiscordUserRequest ¶
type LookupDiscordUserRequest struct { DiscordId string `protobuf:"bytes,1,opt,name=discord_id,json=discordId,proto3" json:"discord_id,omitempty"` // contains filtered or unexported fields }
func (*LookupDiscordUserRequest) Descriptor
deprecated
func (*LookupDiscordUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use LookupDiscordUserRequest.ProtoReflect.Descriptor instead.
func (*LookupDiscordUserRequest) GetDiscordId ¶
func (x *LookupDiscordUserRequest) GetDiscordId() string
func (*LookupDiscordUserRequest) ProtoMessage ¶
func (*LookupDiscordUserRequest) ProtoMessage()
func (*LookupDiscordUserRequest) ProtoReflect ¶
func (x *LookupDiscordUserRequest) ProtoReflect() protoreflect.Message
func (*LookupDiscordUserRequest) Reset ¶
func (x *LookupDiscordUserRequest) Reset()
func (*LookupDiscordUserRequest) String ¶
func (x *LookupDiscordUserRequest) String() string
type LookupDiscordUserResponse ¶
type LookupDiscordUserResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*LookupDiscordUserResponse) Descriptor
deprecated
func (*LookupDiscordUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use LookupDiscordUserResponse.ProtoReflect.Descriptor instead.
func (*LookupDiscordUserResponse) GetUser ¶
func (x *LookupDiscordUserResponse) GetUser() *User
func (*LookupDiscordUserResponse) ProtoMessage ¶
func (*LookupDiscordUserResponse) ProtoMessage()
func (*LookupDiscordUserResponse) ProtoReflect ¶
func (x *LookupDiscordUserResponse) ProtoReflect() protoreflect.Message
func (*LookupDiscordUserResponse) Reset ¶
func (x *LookupDiscordUserResponse) Reset()
func (*LookupDiscordUserResponse) String ¶
func (x *LookupDiscordUserResponse) String() string
type Taxonomy ¶
type Taxonomy interface { CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) // discord LookupDiscordUser(context.Context, *LookupDiscordUserRequest) (*LookupDiscordUserResponse, error) LinkDiscordUser(context.Context, *LinkDiscordUserRequest) (*LinkDiscordUserResponse, error) UnlinkDiscordUser(context.Context, *UnlinkDiscordUserRequest) (*UnlinkDiscordUserResponse, error) }
func NewTaxonomyJSONClient ¶
func NewTaxonomyJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Taxonomy
NewTaxonomyJSONClient creates a JSON client that implements the Taxonomy interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewTaxonomyProtobufClient ¶
func NewTaxonomyProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Taxonomy
NewTaxonomyProtobufClient creates a Protobuf client that implements the Taxonomy interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
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 NewTaxonomyServer ¶
func NewTaxonomyServer(svc Taxonomy, opts ...interface{}) TwirpServer
NewTaxonomyServer 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 UnlinkDiscordUserRequest ¶
type UnlinkDiscordUserRequest struct { UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` DiscordId string `protobuf:"bytes,2,opt,name=discord_id,json=discordId,proto3" json:"discord_id,omitempty"` // contains filtered or unexported fields }
func (*UnlinkDiscordUserRequest) Descriptor
deprecated
func (*UnlinkDiscordUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnlinkDiscordUserRequest.ProtoReflect.Descriptor instead.
func (*UnlinkDiscordUserRequest) GetDiscordId ¶
func (x *UnlinkDiscordUserRequest) GetDiscordId() string
func (*UnlinkDiscordUserRequest) GetUserId ¶
func (x *UnlinkDiscordUserRequest) GetUserId() string
func (*UnlinkDiscordUserRequest) ProtoMessage ¶
func (*UnlinkDiscordUserRequest) ProtoMessage()
func (*UnlinkDiscordUserRequest) ProtoReflect ¶
func (x *UnlinkDiscordUserRequest) ProtoReflect() protoreflect.Message
func (*UnlinkDiscordUserRequest) Reset ¶
func (x *UnlinkDiscordUserRequest) Reset()
func (*UnlinkDiscordUserRequest) String ¶
func (x *UnlinkDiscordUserRequest) String() string
type UnlinkDiscordUserResponse ¶
type UnlinkDiscordUserResponse struct {
// contains filtered or unexported fields
}
func (*UnlinkDiscordUserResponse) Descriptor
deprecated
func (*UnlinkDiscordUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UnlinkDiscordUserResponse.ProtoReflect.Descriptor instead.
func (*UnlinkDiscordUserResponse) ProtoMessage ¶
func (*UnlinkDiscordUserResponse) ProtoMessage()
func (*UnlinkDiscordUserResponse) ProtoReflect ¶
func (x *UnlinkDiscordUserResponse) ProtoReflect() protoreflect.Message
func (*UnlinkDiscordUserResponse) Reset ¶
func (x *UnlinkDiscordUserResponse) Reset()
func (*UnlinkDiscordUserResponse) String ¶
func (x *UnlinkDiscordUserResponse) String() string
type User ¶
type User struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (x *User) GetCreatedAt() *timestamppb.Timestamp
func (*User) GetUpdatedAt ¶
func (x *User) GetUpdatedAt() *timestamppb.Timestamp
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message