Documentation
¶
Index ¶
- type AuhtorizationController
- type AuthorizationContext
- type Controller
- type DefaultHomepage
- type HttpListener
- func (l *HttpListener) AddAuthentication() *HttpListener
- func (l *HttpListener) AddController(c Controller, path string, methods ...string)
- func (l *HttpListener) AddDefaultHomepage() *HttpListener
- func (l *HttpListener) AddHealthCheck() *HttpListener
- func (l *HttpListener) AddJsonContent() *HttpListener
- func (l *HttpListener) AddLogger() *HttpListener
- func (l *HttpListener) Login(w http.ResponseWriter, r *http.Request)
- func (c *HttpListener) Probe(w http.ResponseWriter, r *http.Request)
- func (l *HttpListener) Start()
- func (l *HttpListener) Validate(w http.ResponseWriter, r *http.Request)
- type HttpListenerOptions
- type LoginErrorResponse
- type LoginRequest
- type LoginResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuhtorizationController ¶
type AuhtorizationController struct{}
type AuthorizationContext ¶
type AuthorizationContext struct {
User string
}
type Controller ¶
type Controller func(w http.ResponseWriter, r *http.Request)
type DefaultHomepage ¶
type HttpListener ¶
type HttpListener struct {
Router *mux.Router
Services *executionctx.ServiceProvider
Logger *logger.Logger
Options *HttpListenerOptions
Controllers []Controller
}
HttpListener HttpListener structure
func GetHttpListener ¶
func GetHttpListener() *HttpListener
func NewHttpListener ¶
func NewHttpListener() *HttpListener
NewHttpListener Creates a new controller
func (*HttpListener) AddAuthentication ¶
func (l *HttpListener) AddAuthentication() *HttpListener
func (*HttpListener) AddController ¶
func (l *HttpListener) AddController(c Controller, path string, methods ...string)
func (*HttpListener) AddDefaultHomepage ¶
func (l *HttpListener) AddDefaultHomepage() *HttpListener
func (*HttpListener) AddHealthCheck ¶
func (l *HttpListener) AddHealthCheck() *HttpListener
func (*HttpListener) AddJsonContent ¶
func (l *HttpListener) AddJsonContent() *HttpListener
func (*HttpListener) AddLogger ¶
func (l *HttpListener) AddLogger() *HttpListener
func (*HttpListener) Login ¶
func (l *HttpListener) Login(w http.ResponseWriter, r *http.Request)
Login Generate a token for a valid user
func (*HttpListener) Probe ¶
func (c *HttpListener) Probe(w http.ResponseWriter, r *http.Request)
Login Generate a token for a valid user
func (*HttpListener) Start ¶
func (l *HttpListener) Start()
func (*HttpListener) Validate ¶
func (l *HttpListener) Validate(w http.ResponseWriter, r *http.Request)
Validate Validate a token for a valid user
type HttpListenerOptions ¶
type LoginErrorResponse ¶
type LoginErrorResponse struct {
Code string `json:"code" yaml:"code"`
Error string `json:"error"`
Message string `json:"message"`
}
LoginErrorResponse entity
type LoginRequest ¶
type LoginRequest struct {
Username string `json:"username" bson:"username" yaml:"username"`
Password string `json:"password" bson:"password" yaml:"username"`
}
LoginRequest entity
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `json:"access_token"`
Expiring string `json:"expiring"`
}
LoginResponse entity
type User ¶
type User struct {
ID string `json:"id" bson:"_id"`
Email string `json:"email" bson:"email"`
Username string `json:"username" bson:"username"`
FirstName string `json:"firstName" bson:"firstName"`
LastName string `json:"lastName" bson:"lastName"`
Password string `json:"password" bson:"password"`
}
User entity
func GetDefaultUsers ¶
func GetDefaultUsers() []User
Click to show internal directories.
Click to hide internal directories.