-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSchema.go
56 lines (46 loc) · 1001 Bytes
/
Schema.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
package presilo
type TypeSchema interface {
GetSchemaType() SchemaType
GetTitle() string
GetDescription() string
SetTitle(string)
GetID() string
SetID(string)
GetNullable() bool
SetNullable(bool)
HasConstraints() bool
}
/*
Represents the schema of one field in a json document.
*/
type Schema struct {
Title string `json:"title"`
ID string `json:"id"`
Description string `json:"description"`
Nullable bool
typeCode SchemaType
}
func (this *Schema) GetSchemaType() SchemaType {
return this.typeCode
}
func (this *Schema) GetTitle() string {
return this.Title
}
func (this *Schema) GetDescription() string {
return this.Description
}
func (this *Schema) SetTitle(title string) {
this.Title = title
}
func (this *Schema) GetID() string {
return this.ID
}
func (this *Schema) SetID(id string) {
this.ID = id
}
func (this *Schema) GetNullable() bool {
return this.Nullable
}
func (this *Schema) SetNullable(nullable bool) {
this.Nullable = nullable
}