-
Notifications
You must be signed in to change notification settings - Fork 40
/
types.go
82 lines (69 loc) · 2.21 KB
/
types.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
package main
import (
"time"
"github.com/sqlitebrowser/dbhub.io/common/database"
)
type ActivityRange string
const (
TODAY ActivityRange = "today"
THIS_WEEK = "week"
THIS_MONTH = "month"
ALL_TIME = "all"
)
type APIKey struct {
Uuid string `json:"uuid"`
Key string `json:"key"`
DateCreated time.Time `json:"date_created"`
ExpiryDate *time.Time `json:"expiry_date"`
Comment string `json:"comment"`
Permissions database.ShareDatabasePermissions `json:"permissions"`
}
type Auth0Set struct {
CallbackURL string
ClientID string
Domain string
}
type CommitData struct {
AuthorAvatar string `json:"author_avatar"`
AuthorEmail string `json:"author_email"`
AuthorName string `json:"author_name"`
AuthorUsername string `json:"author_username"`
ID string `json:"id"`
Parent string `json:"parent"`
LicenceChange string `json:"licence_change"`
Message string `json:"message"`
Timestamp time.Time `json:"timestamp"`
}
type PageMetaInfo struct {
ApiUrl string
Auth0 Auth0Set
AvatarURL string
Environment string
LoggedInUser string
NumStatusUpdates int
PageSection string
Protocol string
Server string
Title string
}
// ShareDatabasePermissionsOthers contains a list of user permissions for a given database
type ShareDatabasePermissionsOthers struct {
DBName string `json:"database_name"`
IsLive bool `json:"is_live"`
Perms map[string]database.ShareDatabasePermissions `json:"user_permissions"`
}
type UpdateDataRequestRow struct {
Key map[string]string `json:"key"`
Values map[string]string `json:"values,omitempty"`
}
type UpdateDataRequest struct {
Table string `json:"table"`
Data []UpdateDataRequestRow `json:"data"`
}
type ExecuteSqlRequest struct {
Sql string `json:"sql"`
}
type SaveSqlRequest struct {
Sql string `json:"sql"`
SqlName string `json:"sql_name"`
}