Complete loading page to pdf and base API

This commit is contained in:
2023-03-27 22:09:54 +03:00
parent 92469fa3a2
commit 91d8f676ae
24 changed files with 864 additions and 95 deletions

View File

@@ -4,6 +4,7 @@ package openapi
import (
"fmt"
"io"
"time"
"github.com/go-faster/errors"
@@ -148,6 +149,50 @@ func (s *Format) UnmarshalText(data []byte) error {
}
}
// GetFileNotFound is response for GetFile operation.
type GetFileNotFound struct{}
func (*GetFileNotFound) getFileRes() {}
type GetFileOKApplicationPdf struct {
Data io.Reader
}
// Read reads data from the Data reader.
//
// Kept to satisfy the io.Reader interface.
func (s GetFileOKApplicationPdf) Read(p []byte) (n int, err error) {
return s.Data.Read(p)
}
func (*GetFileOKApplicationPdf) getFileRes() {}
type GetFileOKTextHTML struct {
Data io.Reader
}
// Read reads data from the Data reader.
//
// Kept to satisfy the io.Reader interface.
func (s GetFileOKTextHTML) Read(p []byte) (n int, err error) {
return s.Data.Read(p)
}
func (*GetFileOKTextHTML) getFileRes() {}
type GetFileOKTextPlain struct {
Data io.Reader
}
// Read reads data from the Data reader.
//
// Kept to satisfy the io.Reader interface.
func (s GetFileOKTextPlain) Read(p []byte) (n int, err error) {
return s.Data.Read(p)
}
func (*GetFileOKTextPlain) getFileRes() {}
// GetPageNotFound is response for GetPage operation.
type GetPageNotFound struct{}