src

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApplication

func NewApplication() applicationInterface

func NewMars

func NewMars(app applicationInterface) marsinterface

func NewPassword

func NewPassword() passwordinterface

func NewPath

func NewPath() pathinterface

func NewValidation

func NewValidation() validationinterface

func UniqueArr

func UniqueArr(arr []string) []string

Types

type ControllerInterface

type ControllerInterface interface {
	Handler(ctx *fiber.Ctx) error
}

type CoreControllerInterface

type CoreControllerInterface interface {
	App() applicationInterface
	Result(data interface{}) fiber.Map
}

func NewController

func NewController(app applicationInterface) CoreControllerInterface

type CoreMiddlewareInterface

type CoreMiddlewareInterface interface {
	App() applicationInterface
}

func NewMiddleware

func NewMiddleware(app applicationInterface) CoreMiddlewareInterface

type ErrorResponse

type ErrorResponse map[string][]string

type MarsToken

type MarsToken struct {
	AccessToken string
	ExpiresIn   int64
	Abilities   datatypes.JSON
}

type Middleware

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

func (*Middleware) App

func (m *Middleware) App() applicationInterface

type MiddlewareInterface

type MiddlewareInterface interface {
	Handler(ctx *fiber.Ctx) error
}

type NewControllerInterface

type NewControllerInterface = func(controller CoreControllerInterface) ControllerInterface

type NewMiddlewareInterface

type NewMiddlewareInterface = func(middleware CoreMiddlewareInterface) MiddlewareInterface

type Pagination

type Pagination struct {
	Records interface{} `json:"data"`
	Meta    *Paginator  `json:"pagination"`
}

func NewPagination

func NewPagination(p *PaginationParam, result interface{}) *Pagination

type PaginationParam

type PaginationParam struct {
	DB      *gorm.DB
	Page    int64
	Limit   int64
	OrderBy []string
}

type Paginator

type Paginator struct {
	TotalRecord int64 `json:"total"`
	TotalPage   int64 `json:"total_page"`
	Offset      int64 `json:"offset"`
	Limit       int64 `json:"limit"`
	Page        int64 `json:"page"`
	PrevPage    int64 `json:"prev_page"`
	NextPage    int64 `json:"next_page"`
}

type Resource

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

func NewResource

func NewResource(venus VenusInterface, data ResourceInterface) *Resource

func (*Resource) Collection

func (r *Resource) Collection(data interface{}) fiber.Map

func (*Resource) Item

func (r *Resource) Item(data interface{}) fiber.Map

type ResourceInterface

type ResourceInterface interface {
	Map(model interface{}, venus VenusInterface) interface{}
}

type Server

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

func (*Server) Init

func (s *Server) Init() *Server

func (*Server) Logger

func (s *Server) Logger() fiber.Handler

func (*Server) Middleware

func (s *Server) Middleware(middleware NewMiddlewareInterface) *Server

func (*Server) Route

func (s *Server) Route(method string, path string, constroller NewControllerInterface, middlewares ...NewMiddlewareInterface) fiber.Router

func (*Server) Run

func (s *Server) Run()

type ServerInterface

type ServerInterface interface {
	Init() *Server
	Route(method string, path string, controller NewControllerInterface, middlewares ...NewMiddlewareInterface) fiber.Router
	Run()
}

func NewServer

func NewServer(app applicationInterface) ServerInterface

type VenusInterface

type VenusInterface interface {
	Decode(data string) int64
	Encode(data int64) string
}

func NewVenus

func NewVenus() VenusInterface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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