@@ -19,14 +19,14 @@ import (
1919func Shutdown (ctx context.Context ) ResponseExtra {
2020 reqURL := setting .LocalURL + "api/internal/manager/shutdown"
2121 req := newInternalRequest (ctx , reqURL , "POST" )
22- return requestJSONUserMsg (req , "Shutting down" )
22+ return requestJSONClientMsg (req , "Shutting down" )
2323}
2424
2525// Restart calls the internal restart function
2626func Restart (ctx context.Context ) ResponseExtra {
2727 reqURL := setting .LocalURL + "api/internal/manager/restart"
2828 req := newInternalRequest (ctx , reqURL , "POST" )
29- return requestJSONUserMsg (req , "Restarting" )
29+ return requestJSONClientMsg (req , "Restarting" )
3030}
3131
3232// FlushOptions represents the options for the flush call
@@ -42,35 +42,35 @@ func FlushQueues(ctx context.Context, timeout time.Duration, nonBlocking bool) R
4242 if timeout > 0 {
4343 req .SetReadWriteTimeout (timeout + 10 * time .Second )
4444 }
45- return requestJSONUserMsg (req , "Flushed" )
45+ return requestJSONClientMsg (req , "Flushed" )
4646}
4747
4848// PauseLogging pauses logging
4949func PauseLogging (ctx context.Context ) ResponseExtra {
5050 reqURL := setting .LocalURL + "api/internal/manager/pause-logging"
5151 req := newInternalRequest (ctx , reqURL , "POST" )
52- return requestJSONUserMsg (req , "Logging Paused" )
52+ return requestJSONClientMsg (req , "Logging Paused" )
5353}
5454
5555// ResumeLogging resumes logging
5656func ResumeLogging (ctx context.Context ) ResponseExtra {
5757 reqURL := setting .LocalURL + "api/internal/manager/resume-logging"
5858 req := newInternalRequest (ctx , reqURL , "POST" )
59- return requestJSONUserMsg (req , "Logging Restarted" )
59+ return requestJSONClientMsg (req , "Logging Restarted" )
6060}
6161
6262// ReleaseReopenLogging releases and reopens logging files
6363func ReleaseReopenLogging (ctx context.Context ) ResponseExtra {
6464 reqURL := setting .LocalURL + "api/internal/manager/release-and-reopen-logging"
6565 req := newInternalRequest (ctx , reqURL , "POST" )
66- return requestJSONUserMsg (req , "Logging Restarted" )
66+ return requestJSONClientMsg (req , "Logging Restarted" )
6767}
6868
6969// SetLogSQL sets database logging
7070func SetLogSQL (ctx context.Context , on bool ) ResponseExtra {
7171 reqURL := setting .LocalURL + "api/internal/manager/set-log-sql?on=" + strconv .FormatBool (on )
7272 req := newInternalRequest (ctx , reqURL , "POST" )
73- return requestJSONUserMsg (req , "Log SQL setting set" )
73+ return requestJSONClientMsg (req , "Log SQL setting set" )
7474}
7575
7676// LoggerOptions represents the options for the add logger call
@@ -90,14 +90,14 @@ func AddLogger(ctx context.Context, group, name, mode string, config map[string]
9090 Mode : mode ,
9191 Config : config ,
9292 })
93- return requestJSONUserMsg (req , "Added" )
93+ return requestJSONClientMsg (req , "Added" )
9494}
9595
9696// RemoveLogger removes a logger
9797func RemoveLogger (ctx context.Context , group , name string ) ResponseExtra {
9898 reqURL := setting .LocalURL + fmt .Sprintf ("api/internal/manager/remove-logger/%s/%s" , url .PathEscape (group ), url .PathEscape (name ))
9999 req := newInternalRequest (ctx , reqURL , "POST" )
100- return requestJSONUserMsg (req , "Removed" )
100+ return requestJSONClientMsg (req , "Removed" )
101101}
102102
103103// Processes return the current processes from this gitea instance
@@ -108,6 +108,6 @@ func Processes(ctx context.Context, out io.Writer, flat, noSystem, stacktraces,
108108 callback := func (resp * http.Response , extra * ResponseExtra ) {
109109 _ , extra .Error = io .Copy (out , resp .Body )
110110 }
111- _ , extra := requestJSONResp (req , & callback )
111+ _ , extra := requestJSONResp (req , & responseCallback { callback } )
112112 return extra
113113}
0 commit comments