-
Notifications
You must be signed in to change notification settings - Fork 0
/
qualifications.go
49 lines (39 loc) · 1.06 KB
/
qualifications.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
package qualifications
import (
"database/sql/driver"
"github.com/galexrt/fivenet/pkg/utils/protoutils"
"google.golang.org/protobuf/encoding/protojson"
)
func (x *QualificationJobAccess) SetJob(job string) {
x.Job = job
}
func (x *QualificationJobAccess) SetJobLabel(label string) {
x.JobLabel = &label
}
func (x *QualificationJobAccess) GetJobGrade() int32 {
return x.MinimumGrade
}
func (x *QualificationJobAccess) SetJobGrade(grade int32) {
x.MinimumGrade = grade
}
func (x *QualificationJobAccess) SetJobGradeLabel(label string) {
x.JobGradeLabel = &label
}
// Scan implements driver.Valuer for protobuf QualificationDiscordSettings.
func (x *QualificationDiscordSettings) Scan(value any) error {
switch t := value.(type) {
case string:
return protojson.Unmarshal([]byte(t), x)
case []byte:
return protojson.Unmarshal(t, x)
}
return nil
}
// Value marshals the value into driver.Valuer.
func (x *QualificationDiscordSettings) Value() (driver.Value, error) {
if x == nil {
return nil, nil
}
out, err := protoutils.Marshal(x)
return string(out), err
}