internal

package
v0.0.0-...-9829ae4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK                  = 200
	NoContent           = 204
	BadRequest          = 400
	Unauthorized        = 401
	Forbidden           = 403
	NotFound            = 404
	InternalServerError = 500
)
View Source
const (
	InternalOK = 200
)

Variables

This section is empty.

Functions

func NewNoSQLSyscallHandler

func NewNoSQLSyscallHandler() func(signal os.Signal, backend *NoSQLBackend)

func NewSQLSyscallHandler

func NewSQLSyscallHandler() func(signal os.Signal, backend *SQLBackend)

Types

type Backend

type Backend interface {
	Start()
	Stop()
	SysCallSetup()
}

type HTTPResponder

type HTTPResponder struct{}

func NewHTTPResponder

func NewHTTPResponder() *HTTPResponder

func (HTTPResponder) BadRequest

func (HTTPResponder) BadRequest(c *fiber.Ctx, err error) error

func (HTTPResponder) Forbidden

func (HTTPResponder) Forbidden(c *fiber.Ctx, err error) error

func (HTTPResponder) InternalServerError

func (HTTPResponder) InternalServerError(c *fiber.Ctx, err error) error

func (HTTPResponder) NoContent

func (HTTPResponder) NoContent(c *fiber.Ctx, err error) error

func (HTTPResponder) NotFound

func (HTTPResponder) NotFound(c *fiber.Ctx, err error) error

func (HTTPResponder) Success

func (HTTPResponder) Success(c *fiber.Ctx, data interface{}) error

func (HTTPResponder) Unauthorized

func (HTTPResponder) Unauthorized(c *fiber.Ctx, err error) error

type HTTPResponse

type HTTPResponse struct {
	StatusCode         int         `json:"statusCode"`
	InternalStatusCode int         `json:"internalStatusCode"`
	Status             string      `json:"status"`
	Data               interface{} `json:"data,omitempty"`
	Error              interface{} `json:"error,omitempty"`
}

type Logger

type Logger struct {
	Info    func(format string, args ...any)
	Debug   func(format string, args ...any)
	Warning func(format string, args ...any)
	Error   func(format string, args ...any)
	Fatal   func(format string, args ...any)
	File    *os.File
}

func BackendSetup

func BackendSetup() (*fiber.App, *Logger)

func NewLogger

func NewLogger() *Logger

func (*Logger) SetFile

func (logger *Logger) SetFile(file *os.File)

type NoSQLBackend

type NoSQLBackend struct {
	Fiber    *fiber.App
	Database data_db.NoSQLDatabase
	Logger   *Logger
	HTTP     *HTTPResponder
	Syscall  func(signal os.Signal, backend *NoSQLBackend)
}

func NewNoSQLBackend

func NewNoSQLBackend() *NoSQLBackend

func (*NoSQLBackend) Start

func (backend *NoSQLBackend) Start()

func (*NoSQLBackend) StartServer

func (backend *NoSQLBackend) StartServer()

func (*NoSQLBackend) Stop

func (backend *NoSQLBackend) Stop()

func (*NoSQLBackend) SysCallSetup

func (backend *NoSQLBackend) SysCallSetup()

type SQLBackend

type SQLBackend struct {
	Fiber    *fiber.App
	Database data_db.SQLDatabase
	Logger   *Logger
	HTTP     *HTTPResponder
	Syscall  func(signal os.Signal, backend *SQLBackend)
}

func NewSQLBackend

func NewSQLBackend() *SQLBackend

func (*SQLBackend) Start

func (backend *SQLBackend) Start()

func (*SQLBackend) StartServer

func (backend *SQLBackend) StartServer()

func (*SQLBackend) Stop

func (backend *SQLBackend) Stop()

func (*SQLBackend) SysCallSetup

func (backend *SQLBackend) SysCallSetup()

Jump to

Keyboard shortcuts

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