app

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application is a wrapper defining the router, the client layer, and other elements needed to interact with the storage and serve it.

func MakeServer

func MakeServer(
	settings *dsl.Settings, setupValidator func(*validator.Validate),
	setup func(*mongo.Client, *dsl.Settings),
) (app *Application, err error)

MakeServer is used to create a server. The connection is created and established, but the server is not run immediately.

func (*Application) Run

func (application *Application) Run(addr string) error

Run runs the actual web server.

type CreateOneFunc

type CreateOneFunc func(echo.Context, any) (primitive.ObjectID, error)

CreateOneFunc stands for a function that creates one element.

type DeleteOneFunc

type DeleteOneFunc func(echo.Context, primitive.ObjectID) (bool, error)

DeleteOneFunc stands for a function that deletes an element.

type GetManyFunc

type GetManyFunc func(echo.Context, int64, int64) ([]any, error)

GetManyFunc stands for a function that gets many documents.

type GetOneFunc

type GetOneFunc func(echo.Context, primitive.ObjectID) (any, error)

GetOneFunc stands for a function that gets one element.

type IDGetter

type IDGetter func(any) primitive.ObjectID

IDGetter is a function that returns the ID of an object.

type IDSetter

type IDSetter func(any, primitive.ObjectID)

IDSetter is a function that sets the ID to an object.

type Panicked

type Panicked struct {
	With any
}

Panicked is a class that wraps a panicked value into an error.

func (*Panicked) Error

func (panicked *Panicked) Error() string

Error stands for the implementation of the Error interface, always rendering the panicked value.

type ReplaceOneFunc

type ReplaceOneFunc func(echo.Context, primitive.ObjectID, any) (bool, error)

ReplaceOneFunc stands for a function that replaces a document.

type SimulatedUpdateFunc

type SimulatedUpdateFunc func(echo.Context, primitive.ObjectID, any, any) (any, error)

SimulatedUpdateFunc is a function that interacts with a collection and performs a preview of an in-collection update later.

type UpdateOneFunc

type UpdateOneFunc func(echo.Context, primitive.ObjectID, bson.M) (bool, error)

UpdateOneFunc stands for a function that updates a document.

Jump to

Keyboard shortcuts

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