Documentation ¶
Index ¶
- Variables
- type FileReader
- func (fr *FileReader) ParseFile(raw []byte, data any, ext string) error
- func (fr *FileReader) ReadFile(location string, data any) error
- func (fr *FileReader) ReadFileReturnRaw(location string, data any) ([]byte, error)
- func (fr *FileReader) ReadIntoRawBytes(location string) ([]byte, error)
- func (fr *FileReader) SaveFile(location string, data any) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExtNotSupported = errors.New("extension not suppoerted")
)
Functions ¶
This section is empty.
Types ¶
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
func New ¶
func New() (*FileReader, error)
func (*FileReader) ParseFile ¶
func (fr *FileReader) ParseFile(raw []byte, data any, ext string) error
func (*FileReader) ReadFile ¶
func (fr *FileReader) ReadFile(location string, data any) error
to read a file and parse it
func (*FileReader) ReadFileReturnRaw ¶
func (fr *FileReader) ReadFileReturnRaw(location string, data any) ([]byte, error)
this is just for a special case in whic swagger validation requires raw buffer for all other usecases use ReadFile to get parsed go structure or the GetRaw for getting raw bytes data
func (*FileReader) ReadIntoRawBytes ¶
func (fr *FileReader) ReadIntoRawBytes(location string) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.