-
Notifications
You must be signed in to change notification settings - Fork 3
/
malina.go
100 lines (77 loc) · 2.06 KB
/
malina.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* @author John Aran (Ilyas Aranzhanovich Toxanbayev)
* @version 1.0.0
* @based on
* @email il.aranov@gmail.com
* @link
* @github https://github.com/ilyaran/github.com/ilyaran/Malina
* @license MIT License Copyright (c) 2017 John Aran (Ilyas Toxanbayev)
*/package berry
import (
"html/template"
"net/http"
"time"
"github.com/ilyaran/Malina/entity"
)
type IController interface {
GetList(malina *Malina, w http.ResponseWriter, r *http.Request, condition string)
FormHandler(malina *Malina, action byte, w http.ResponseWriter, r *http.Request)
ResultHandler(malina *Malina, args ...interface{})
Default(malina *Malina, w http.ResponseWriter, r *http.Request)
}
type Malina struct {
ChannelBool chan bool
Lang string
CurrentAccount *entity.Account
SessionId string
Status int64
Result map[string]interface{}
Controller IController
List *[]entity.Scanable
Item entity.Scanable
IdInt64 int64
IdStr string
Url string
Order_index int64
Per_page int64
Page int64
PageStr string
Search string
TableSql string
JoinSql string
SelectSql string
WhereSql string
LimitSql string
OrderBySql string
All int64
Department string
ControllerName string
Action string
Paging string
Device string
NavAuth template.HTML
Content template.HTML
CategoryParameters template.HTML
}
//**** Context
// Done returns a channel that is closed when this Context is canceled
// or times out.
func (s *Malina) Done() <-chan struct{} {
t := make(chan struct{})
return t
}
// Err indicates why this context was canceled, after the Done channel
// is closed.
func (s *Malina) Err() error {
var err error
return err
}
// Deadline returns the time when this Context will be canceled, if any.
func (s *Malina) Deadline() (deadline time.Time, ok bool) {
return time.Now(), false
}
// Value returns the value associated with key or nil if none.
func (s *Malina) Value(key interface{}) interface{} {
return key
}
//**** end Context