rest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthWithAttemptsControl

func BasicAuthWithAttemptsControl(creds Credentials) gin.HandlerFunc

BasicAuthWithAttemptsControl offers basic auth with maximum failure control.

func FixPath

func FixPath(p string) string

FixPath fixes a relative path

Types

type Credentials

type Credentials map[string]string

Credentials is the basic auth authentication credentials

type Midgard

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

Midgard is the midgard server that serves all API endpoints.

func NewMidgard

func NewMidgard() *Midgard

NewMidgard creates a new midgard server

func (*Midgard) AllocateURL

func (m *Midgard) AllocateURL(c *gin.Context)

AllocateURL generates an universal access URL for the requested resource. The requested resource can be an attached data, the midgard universal clipboard, and etc.

func (*Midgard) Code

func (m *Midgard) Code(c *gin.Context)

Code lists all code2img codes

func (*Midgard) Code2img

func (m *Midgard) Code2img(c *gin.Context)

Code2img code to image handler

func (*Midgard) GetFromUniversalClipboard

func (m *Midgard) GetFromUniversalClipboard(c *gin.Context)

GetFromUniversalClipboard returns the in-memory clipboard data inside the midgard server

func (*Midgard) PingPong

func (m *Midgard) PingPong(c *gin.Context)

PingPong is a naive handler for health checking

func (*Midgard) PutToUniversalClipboard

func (m *Midgard) PutToUniversalClipboard(c *gin.Context)

PutToUniversalClipboard saves data to the in-memory clipboard data inside the midgrad server.

func (*Midgard) Serve

func (m *Midgard) Serve()

Serve serves Midgard RESTful APIs.

func (*Midgard) Subscribe

func (m *Midgard) Subscribe(c *gin.Context)

Subscribe subscribes the Midgard's server.

Jump to

Keyboard shortcuts

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