server

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidData = fmt.Errorf("invalid data")
View Source
var (
	ErrNotAuthorized = fmt.Errorf("user not authorized")
)

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(users *store.Users, secret string) *Auth

func (*Auth) Add

func (a *Auth) Add(
	name string,
	password string,
	email string,
	role store.Role,
) error

func (*Auth) CheckPermissions

func (a *Auth) CheckPermissions(c echo.Context) error

func (*Auth) GenerateToken

func (a *Auth) GenerateToken(c echo.Context, u store.User) error

func (*Auth) Login

func (a *Auth) Login(c echo.Context, name, password string) error

func (*Auth) Middleware

func (a *Auth) Middleware(
	f func(error, echo.Context) error,
) echo.MiddlewareFunc

type Claims

type Claims struct {
	jwt.StandardClaims

	Name string     `json:"name"`
	Role store.Role `json:"role"`
}

type Server

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

func New

func New(
	addr string,
	tlsAddr string,
	domains string,
	e *store.Effects,
	auth *Auth,
	dataPath string,
	dev bool,
	readOnly bool,
) (*Server, error)

func (*Server) Start

func (s *Server) Start() error

type Template

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

func (*Template) Render

func (t *Template) Render(
	w io.Writer, name string, data interface{}, c echo.Context,
) error

Directories

Path Synopsis
cmd
glsladmin command
glslsandbox command

Jump to

Keyboard shortcuts

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