load jobinfo secrets only on demand
This commit is contained in:
@@ -16,6 +16,7 @@ type Job struct {
|
||||
Weight int
|
||||
Miles int
|
||||
Meta string
|
||||
secrets func() interface{} `json:"-"`
|
||||
}
|
||||
|
||||
type JobLocation struct {
|
||||
@@ -24,6 +25,18 @@ type JobLocation struct {
|
||||
State string
|
||||
}
|
||||
|
||||
func (j *Job) Secrets() {
|
||||
if j.secrets == nil {
|
||||
return
|
||||
}
|
||||
v := j.secrets()
|
||||
j.secrets = nil
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
j.Meta = fmt.Sprintf("%s %+v", j.Meta, v)
|
||||
}
|
||||
|
||||
func (j Job) String() string {
|
||||
return fmt.Sprintf(
|
||||
`%s => %s (%d miles), Weight:%d, Notes:%s Link:%s`,
|
||||
|
||||
Reference in New Issue
Block a user