defaultapp

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	DB *mongo.Database
}

A simple implementation of stupid.App using mongodb.

func NewDefaultApp

func NewDefaultApp(db *mongo.Database) *App

func (*App) Crashes

func (a *App) Crashes() db.CrashTable

func (*App) Logs

func (a *App) Logs() db.LogTable

type AuthorizedDataApp

type AuthorizedDataApp struct {
	*App
}

A simple implementation of stupid.App using mongodb. Pulls from the collection "data" and data must be in the form:

 {
	"_id": "data id",
	"owner": "user uuid",
	"data": "data",
}

The data is sent raw without any processing. Requests:

GET: /data/{data id}?key={API key}&token={JWT Token} DELETE: /data/{data id}?key={API key}&token={JWT Token} POST: /data/{data id}?key={API key}&token={JWT Token}

Request body will be the data

GET: /data/list?key={API key}?token={JWT Token}

Body will be a list of id strings in JSON format

func NewAuthorizedDataApp

func NewAuthorizedDataApp(db *mongo.Database) *AuthorizedDataApp

func (*AuthorizedDataApp) Extension

func (a *AuthorizedDataApp) Extension(req *stupid.Request) bool

type UnauthorizedDataApp

type UnauthorizedDataApp struct {
	*App
}

A simple implementation of stupid.App using mongodb. Can make requests to GET: /data/{data id}?key={API key} without any authorization checks other then the API Key. Pulls from the collection "data" and data must be in the form:

 {
	"_id": "data id",
	"data": "data",
}

The data is sent raw without any processing.

func NewUnauthorizedDataApp

func NewUnauthorizedDataApp(db *mongo.Database) *UnauthorizedDataApp

func (*UnauthorizedDataApp) Extension

func (u *UnauthorizedDataApp) Extension(req *stupid.Request) bool

Jump to

Keyboard shortcuts

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