internalapi

package
v2.48.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerError     = errors.New("internal api server is having issues")
	ErrCantFindAddress = errors.New("can't find address for provided shard")
)
View Source
var (
	ConfListenPortRange = config.RegisterOption("yagpdb.botrest.port_range", "botrest listen port range", "5100-5999")
)

Functions

func GetServerAddrForGuild

func GetServerAddrForGuild(guildID int64) string

func GetServerAddrForShard

func GetServerAddrForShard(shard int) string

func GetWithAddress

func GetWithAddress(addr string, url string, dest interface{}) error

func GetWithGuild

func GetWithGuild(guildID int64, url string, dest interface{}) error

func GetWithShard

func GetWithShard(shard int, url string, dest interface{}) error

func PostWithAddress

func PostWithAddress(serverAddr string, url string, bodyData interface{}, dest interface{}) error

func PostWithGuild

func PostWithGuild(guildID int64, url string, bodyData interface{}, dest interface{}) error

func PostWithShard

func PostWithShard(shard int, url string, bodyData interface{}, dest interface{}) error

func RegisterPlugin

func RegisterPlugin()

func ServeJson

func ServeJson(w http.ResponseWriter, r *http.Request, data interface{})

func ServerError

func ServerError(w http.ResponseWriter, r *http.Request, err error) bool

Returns true if an error occured

Types

type InternalAPIPlugin

type InternalAPIPlugin interface {
	InitInternalAPIRoutes(mux *goji.Mux)
}

InternalAPIPlugin represents a plugin that provides interactions with the internal apis

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) CommonRun

func (p *Plugin) CommonRun()

func (*Plugin) PluginInfo

func (p *Plugin) PluginInfo() *common.PluginInfo

Jump to

Keyboard shortcuts

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