Skip to content

Commit

Permalink
Name in form
Browse files Browse the repository at this point in the history
  • Loading branch information
trumae committed May 19, 2020
1 parent 682c4e0 commit 6c7bb96
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion valente.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type HandlerFunc func(*action.WebSocket, *App, []string)

//Form represents the unit of user interaction
type Form interface {
Name() string
AddEventHandler(evt string, f HandlerFunc) Form
Run(ws *action.WebSocket, app *App) error
Initialize(ws *action.WebSocket) Form
Expand All @@ -34,10 +35,15 @@ type Form interface {

//FormImpl its a simple Form
type FormImpl struct {
Name string
name string
trans map[string]HandlerFunc
}

//Name return the name string
func (form FormImpl) Name() string {
return form.name
}

//AddEventHandler add an f function to handle evt event
func (form FormImpl) AddEventHandler(evt string, f HandlerFunc) Form {
if form.trans == nil {
Expand Down

0 comments on commit 6c7bb96

Please sign in to comment.