http

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 6 Imported by: 0

README

Ssi Core / Http

This package uses and customizes the fiber application to be used in microservice applications. It was developed to not do them individually in every microservice.

Type

type Client struct {
	App *fiber.App
}

Config

type Config struct {
	NFMsgKey string
	DfMsgKey string
}

Functions

func New(i18n *i18n.I18n, config ...Config) *Client
func (h *Client) Listen(p string) error

### Example

package main

import (
    "github.com/gofiber/fiber/v2"
    "github.com/ssibrahimbas/ssi-core/pkg/http"
    "github.com/ssibrahimbas/ssi-core/pkg/i18n"
    "log"
)

func main() {
    i := i18n.New("tr")
	i.LoadLanguages("./locales", "tr", "en")
    h := http.New(i)
    h.App.Get("/", func(c *fiber.Ctx) error {
        return c.SendString("Hello, World!")
    })
    log.Fatal(h.Listen(":3000"))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	App *fiber.App
}

func New

func New(i18n *i18n.I18n, config ...Config) *Client

func (*Client) Listen

func (h *Client) Listen(p string) error

type Config

type Config struct {
	NFMsgKey string
	DfMsgKey string
}

Jump to

Keyboard shortcuts

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