server

package
v0.0.0-...-0ce34fa Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleGuest = 0
	RoleUser  = 1
	RoleAdmin = 1000
)

Guest will be the default role for simplifying the development of the RBAC system

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       string    `json:"id,omitempty,nonempty" toml:"id"`
	UUID     string    `json:"uuid,omitempty" toml:"uuid"`
	Password string    `json:"password,omitempty" toml:"password"`
	Creation time.Time `json:"creation,omitempty" toml:"creation"`
	Role     int       `json:"role,omitempty" xml:"role,omitempty" toml:"role"`
}

We don't bother with email

type Config

type Config struct {
	Port        string
	Host        string
	Environment string
	ServerName  string
}

type Server

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

func New

func New(config *Config) *Server

func (*Server) Echo

func (s *Server) Echo() *echo.Echo

Echo returns the underlying Echo instance for advanced configuration

func (*Server) GetConfig

func (s *Server) GetConfig() *Config

GetConfig returns the server configuration

func (*Server) SetupMiddleware

func (s *Server) SetupMiddleware()

SetupMiddleware configures all middleware

func (*Server) SetupRoutes

func (s *Server) SetupRoutes()

SetupRoutes configures all application routes

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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