server

package
v0.0.0-...-ffd1547 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(w http.ResponseWriter, r *http.Request)

func AddMoney

func AddMoney(w http.ResponseWriter, r *http.Request)

Controlador para condignar a una cuenta

func DeleteAccount

func DeleteAccount(w http.ResponseWriter, r *http.Request)

Controlador para usar método para eliminar cuentas

func GetBalance

func GetBalance(w http.ResponseWriter, r *http.Request)

Controlador para retornal el saldo de una cuenta

func HandlePanel

func HandlePanel(w http.ResponseWriter, r *http.Request)

func HandleRoot

func HandleRoot(w http.ResponseWriter, r *http.Request)

func Login

func Login(w http.ResponseWriter, r *http.Request)

func ModifyAccount

func ModifyAccount(w http.ResponseWriter, r *http.Request)

Controlador para modificar una cuenta

func RunServer

func RunServer(hostRPCServer string, token string)

func Withdrawals

func Withdrawals(w http.ResponseWriter, r *http.Request)

Controlador para condignar a una cuenta

Types

type IndexContext

type IndexContext struct {
	Title string
}

el contexto por defecto del index

type Middleware

type Middleware func(http.HandlerFunc) http.HandlerFunc

func CheckAuth

func CheckAuth(URLToRedirect string) Middleware

func Log

func Log() Middleware

esta middleware registra los logs a los handlers en los que se implementa

type Router

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

sruct Router

func NewRouter

func NewRouter() *Router

funcíon para instanciar el router

func (*Router) FindHandler

func (r *Router) FindHandler(path string, method string) (http.HandlerFunc, bool, bool)

función que se encarga de buscar el handler solicitado

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, request *http.Request)

función encargada de recibir las solicitudes hechas al servidor

type Server

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

struct Server ...

func NewServer

func NewServer(config *serverConfig) *Server

NewServer ...

func (*Server) AddMiddleware

func (s *Server) AddMiddleware(f http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc

función encargada de implementar los middlewares deseados a un handler

func (*Server) Handle

func (s *Server) Handle(method string, path string, handler http.HandlerFunc)

función usada para definir los Handles del servidor con sus respectias rutas

func (*Server) Listen

func (s *Server) Listen() error

función que se ejecutara para iniciar el servidor

type UserSession

type UserSession interface {
	GetId() int
	GetIdentifier() string
	GetPassword() string
}

* *la interfase UserSession define los metodos get que debe implementar *una estructura que se quiera guardar en la sesión

Jump to

Keyboard shortcuts

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