service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB = mongo.New(mongo.Config{
	Host:     utils.GetEnv("DB_HOST"),
	Database: utils.GetEnv("DB_NAME"),
	Username: utils.GetEnv("DB_USER"),
	Password: utils.GetEnv("DB_PASS"),
})
View Source
var Mongo = NewService("mongo").
	SetHandler(
		Handler{
			Method: utils.METHOD_GET,
			Path:   "/health",
			Func:   check_mg_health,
		})

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Name   string
	Path   string
	Method string
	Func   func(c *fiber.Ctx) error
}

type Service

type Service struct {
	Name     string
	Mongo    *mongo.Mongo
	Schemas  []mongo.Schema
	Handlers []Handler
}

func NewService

func NewService(name string) *Service

func (*Service) Load

func (s *Service) Load(app fiber.Router) int

func (*Service) SetHandler

func (s *Service) SetHandler(x Handler) *Service

func (*Service) SetSchema

func (s *Service) SetSchema(schema *mongo.Schema) *Service

func (*Service) SetupSchemas

func (s *Service) SetupSchemas()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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