api

package
v0.0.0-...-8bf6882 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Binds onto eureka uapi

Index

Constants

View Source
const (
	PERMISSION_CHECK_KEY = "permissionCheck"
	SESSION_EXPIRY       = 60 * 30 // 30 minutes
)

Variables

This section is empty.

Functions

func Authorize

func Authorize(r uapi.Route, req *http.Request) (uapi.AuthData, uapi.HttpResponse, bool)

Authorizes a request

func HandlePermissionCheck

func HandlePermissionCheck(
	userId,
	guildId,
	command string,
	permLimits []string,
) (hresp uapi.HttpResponse, ok bool)

func PermLimits

func PermLimits(d uapi.AuthData) []string

func Setup

func Setup()

Types

type DefaultResponder

type DefaultResponder struct{}

func (DefaultResponder) New

func (d DefaultResponder) New(err string, ctx map[string]string) any

type PermissionCheck

type PermissionCheck struct {
	Command func(d uapi.Route, r *http.Request) string
	GuildID func(d uapi.Route, r *http.Request) string
}

Jump to

Keyboard shortcuts

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