@@ -58,36 +58,36 @@ type taskResponse struct {
58
58
func newTask (client * client , resp * taskResponse ) Task {
59
59
return & task {
60
60
client : client ,
61
- id : resp .ID ,
62
- name : resp .Name ,
63
- command : resp .Command ,
61
+ id : & resp .ID ,
62
+ name : & resp .Name ,
63
+ command : & resp .Command ,
64
64
params : resp .Params ,
65
- period : resp .Period ,
66
- offset : resp .Offset ,
65
+ period : & resp .Period ,
66
+ offset : & resp .Offset ,
67
67
}
68
68
}
69
69
70
70
type task struct {
71
71
client * client
72
- id string
73
- name string
74
- command string
72
+ id * string
73
+ name * string
74
+ command * string
75
75
params json.RawMessage
76
- period int64
77
- offset float64
76
+ period * int64
77
+ offset * float64
78
78
}
79
79
80
80
// Task interface implementation for the task struct.
81
81
func (t * task ) ID () * string {
82
- return & t .id
82
+ return t .id
83
83
}
84
84
85
85
func (t * task ) Name () * string {
86
- return & t .name
86
+ return t .name
87
87
}
88
88
89
89
func (t * task ) Command () * string {
90
- return & t .command
90
+ return t .command
91
91
}
92
92
93
93
func (t * task ) Params (result interface {}) error {
@@ -98,11 +98,11 @@ func (t *task) Params(result interface{}) error {
98
98
}
99
99
100
100
func (t * task ) Period () * int64 {
101
- return & t .period
101
+ return t .period
102
102
}
103
103
104
104
func (t * task ) Offset () * float64 {
105
- return & t .offset
105
+ return t .offset
106
106
}
107
107
108
108
// Tasks retrieves all tasks from the specified database.
@@ -178,28 +178,28 @@ func (c *clientTask) CreateTask(ctx context.Context, databaseName string, option
178
178
}
179
179
// Prepare the request body
180
180
createRequest := struct {
181
- ID string `json:"id,omitempty"`
182
- Name string `json:"name,omitempty"`
183
- Command string `json:"command,omitempty"`
181
+ ID * string `json:"id,omitempty"`
182
+ Name * string `json:"name,omitempty"`
183
+ Command * string `json:"command,omitempty"`
184
184
Params json.RawMessage `json:"params,omitempty"`
185
- Period int64 `json:"period,omitempty"`
186
- Offset float64 `json:"offset,omitempty"`
185
+ Period * int64 `json:"period,omitempty"`
186
+ Offset * float64 `json:"offset,omitempty"`
187
187
}{}
188
188
189
189
if options .ID != nil {
190
- createRequest .ID = * options .ID
190
+ createRequest .ID = options .ID
191
191
}
192
192
if options .Name != nil {
193
- createRequest .Name = * options .Name
193
+ createRequest .Name = options .Name
194
194
}
195
195
if options .Command != nil {
196
- createRequest .Command = * options .Command
196
+ createRequest .Command = options .Command
197
197
}
198
198
if options .Period != nil {
199
- createRequest .Period = * options .Period
199
+ createRequest .Period = options .Period
200
200
}
201
201
if options .Offset != nil {
202
- createRequest .Offset = * options .Offset
202
+ createRequest .Offset = options .Offset
203
203
}
204
204
205
205
if options .Params != nil {
0 commit comments