0x4a52466c696e74 1 éve
szülő
commit
cd49e8667d
1 módosított fájl, 28 hozzáadás és 0 törlés
  1. 28 0
      request.go

+ 28 - 0
request.go

@@ -135,9 +135,37 @@ func (s *RequestIn) RCore() any {
 	return s.Core
 }
 
+func (s *RequestIn) OutSuccess(data json.Map, files RequestFiles) IRequestOut {
+	return &RequestOut{
+		Request: &Request{
+			Type:    RequestTypeOut,
+			Command: s.RCommand(),
+			Data:    data,
+			Files:   files,
+		},
+	}
+}
+
+func (s *RequestIn) OutError(err IErrorArgs) IRequestOut {
+	return &RequestOut{
+		Err: err,
+	}
+}
+
 /////////////////////////////////////////////////////////
 
 type IRequestOut interface {
 	IRequest
 	Write(io.Writer) IErrorArgs
 }
+
+/////////////////////////////////////////////////////////
+
+type RequestOut struct {
+	*Request
+	Err IErrorArgs
+}
+
+func (s *RequestOut) Write(w io.Writer) IErrorArgs {
+	return nil
+}