-
Notifications
You must be signed in to change notification settings - Fork 335
/
apigw_route.go
57 lines (46 loc) · 1.67 KB
/
apigw_route.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
package types
import (
"database/sql/driver"
"encoding/json"
"time"
"github.com/cortezaproject/corteza/server/pkg/sql"
"github.com/cortezaproject/corteza/server/pkg/filter"
)
type (
ApigwRoute struct {
ID uint64 `json:"routeID,string"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
Enabled bool `json:"enabled"`
Group uint64 `json:"group,string"`
Meta ApigwRouteMeta `json:"meta"`
CreatedAt time.Time `json:"createdAt,omitempty"`
CreatedBy uint64 `json:"createdBy,string" `
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
UpdatedBy uint64 `json:"updatedBy,string,omitempty" `
DeletedAt *time.Time `json:"deletedAt,omitempty"`
DeletedBy uint64 `json:"deletedBy,string,omitempty" `
}
ApigwRouteMeta struct {
Debug bool `json:"debug"`
Async bool `json:"async"`
Desc string `json:"description"`
}
ApigwRouteFilter struct {
ApigwRouteID []string `json:"apigwRouteID"`
Route string `json:"route"`
Endpoint string `json:"endpoint"`
Method string `json:"method"`
Deleted filter.State `json:"deleted"`
Disabled filter.State `json:"disabled"`
// Check fn is called by store backend for each resource found function can
// modify the resource and return false if store should not return it
//
// Store then loads additional resources to satisfy the paging parameters
Check func(*ApigwRoute) (bool, error) `json:"-"`
filter.Sorting
filter.Paging
}
)
func (cc *ApigwRouteMeta) Scan(src any) error { return sql.ParseJSON(src, cc) }
func (cc ApigwRouteMeta) Value() (driver.Value, error) { return json.Marshal(cc) }