bot

package
v0.0.0-...-0d805c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2020 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package bot is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.11.0.

It is generated from these files:

rpc/bot/bot.proto

Index

Constants

View Source
const BotServicePathPrefix = "/twirp/taalbot.bot.BotService/"

BotServicePathPrefix is used for all URL paths on a twirp BotService server. Requests are always: POST BotServicePathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.

Variables

View Source
var File_rpc_bot_bot_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 AttachedGuild

type AttachedGuild struct {

	// Discord guild ID
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// Bot command prefix in this guild
	BotCommandPrefix string `protobuf:"bytes,2,opt,name=bot_command_prefix,json=botCommandPrefix,proto3" json:"bot_command_prefix,omitempty"`
	// contains filtered or unexported fields
}

AttachedGuild contains the target Discord guild ID and the bot command prefix used in the guild.

func (*AttachedGuild) Descriptor deprecated

func (*AttachedGuild) Descriptor() ([]byte, []int)

Deprecated: Use AttachedGuild.ProtoReflect.Descriptor instead.

func (*AttachedGuild) GetBotCommandPrefix

func (x *AttachedGuild) GetBotCommandPrefix() string

func (*AttachedGuild) GetGuildId

func (x *AttachedGuild) GetGuildId() string

func (*AttachedGuild) ProtoMessage

func (*AttachedGuild) ProtoMessage()

func (*AttachedGuild) ProtoReflect

func (x *AttachedGuild) ProtoReflect() protoreflect.Message

func (*AttachedGuild) Reset

func (x *AttachedGuild) Reset()

func (*AttachedGuild) String

func (x *AttachedGuild) String() string

type BotService

type BotService interface {
	// ListAttachedGuilds retrieves guilds in which taalbot service is enabled.
	ListAttachedGuilds(context.Context, *google_protobuf.Empty) (*ListAttachedGuildsResponse, error)

	// CreateAttachedGuild enables taalbot service for a given guild.
	CreateAttachedGuild(context.Context, *CreateAttachedGuildRequest) (*google_protobuf.Empty, error)

	// DeleteAttachedGuild disables taalbot service for a given guild.
	DeleteAttachedGuild(context.Context, *DeleteAttachedGuildRequest) (*google_protobuf.Empty, error)
}

func NewBotServiceJSONClient

func NewBotServiceJSONClient(addr string, client HTTPClient, opts ...twirp.ClientOption) BotService

NewBotServiceJSONClient creates a JSON client that implements the BotService interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewBotServiceProtobufClient

func NewBotServiceProtobufClient(addr string, client HTTPClient, opts ...twirp.ClientOption) BotService

NewBotServiceProtobufClient creates a Protobuf client that implements the BotService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type CreateAttachedGuildRequest

type CreateAttachedGuildRequest struct {
	GuildId          string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	BotCommandPrefix string `protobuf:"bytes,2,opt,name=bot_command_prefix,json=botCommandPrefix,proto3" json:"bot_command_prefix,omitempty"`
	// contains filtered or unexported fields
}

CreateAttachedGuildRequest is the request message for creating an attached guild.

func (*CreateAttachedGuildRequest) Descriptor deprecated

func (*CreateAttachedGuildRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateAttachedGuildRequest.ProtoReflect.Descriptor instead.

func (*CreateAttachedGuildRequest) GetBotCommandPrefix

func (x *CreateAttachedGuildRequest) GetBotCommandPrefix() string

func (*CreateAttachedGuildRequest) GetGuildId

func (x *CreateAttachedGuildRequest) GetGuildId() string

func (*CreateAttachedGuildRequest) ProtoMessage

func (*CreateAttachedGuildRequest) ProtoMessage()

func (*CreateAttachedGuildRequest) ProtoReflect

func (*CreateAttachedGuildRequest) Reset

func (x *CreateAttachedGuildRequest) Reset()

func (*CreateAttachedGuildRequest) String

func (x *CreateAttachedGuildRequest) String() string

type DeleteAttachedGuildRequest

type DeleteAttachedGuildRequest struct {
	GuildId string `protobuf:"bytes,1,opt,name=guild_id,json=guildId,proto3" json:"guild_id,omitempty"`
	// contains filtered or unexported fields
}

DeleteAttachedGuildRequest is the request message for deleting an attached guild.

func (*DeleteAttachedGuildRequest) Descriptor deprecated

func (*DeleteAttachedGuildRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteAttachedGuildRequest.ProtoReflect.Descriptor instead.

func (*DeleteAttachedGuildRequest) GetGuildId

func (x *DeleteAttachedGuildRequest) GetGuildId() string

func (*DeleteAttachedGuildRequest) ProtoMessage

func (*DeleteAttachedGuildRequest) ProtoMessage()

func (*DeleteAttachedGuildRequest) ProtoReflect

func (*DeleteAttachedGuildRequest) Reset

func (x *DeleteAttachedGuildRequest) Reset()

func (*DeleteAttachedGuildRequest) String

func (x *DeleteAttachedGuildRequest) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

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 ListAttachedGuildsResponse

type ListAttachedGuildsResponse struct {
	Guilds []*AttachedGuild `protobuf:"bytes,1,rep,name=guilds,proto3" json:"guilds,omitempty"`
	// contains filtered or unexported fields
}

ListAttachedGuildsResponse contains the list of Discord guilds in which taalabc service is enabled.

func (*ListAttachedGuildsResponse) Descriptor deprecated

func (*ListAttachedGuildsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListAttachedGuildsResponse.ProtoReflect.Descriptor instead.

func (*ListAttachedGuildsResponse) GetGuilds

func (x *ListAttachedGuildsResponse) GetGuilds() []*AttachedGuild

func (*ListAttachedGuildsResponse) ProtoMessage

func (*ListAttachedGuildsResponse) ProtoMessage()

func (*ListAttachedGuildsResponse) ProtoReflect

func (*ListAttachedGuildsResponse) Reset

func (x *ListAttachedGuildsResponse) Reset()

func (*ListAttachedGuildsResponse) String

func (x *ListAttachedGuildsResponse) 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
	// github.com/golang/protobuf/protoc-gen-go/descriptor.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
	// alongside non-twirp requests on one HTTP listener.
	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 NewBotServiceServer

func NewBotServiceServer(svc BotService, hooks *twirp.ServerHooks) TwirpServer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL