internalapi

package
v2.33.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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