Documentation ¶
Index ¶
- func DecodeMultipartForm(r *http.Request, v interface{})
- func Decoder(r *http.Request, v interface{}) error
- func DeleteAllFiles(writePath string, id string, v interface{})
- func WriteAllFileFields(writePath string, id string, v interface{})
- type FileField
- func (ff *FileField) DeleteFile(fileStorePath string, id string) error
- func (ff *FileField) GetFile(fileStorePath string, id string) (*os.File, error)
- func (ff *FileField) GetFileDir(fileStorePath string, id string) string
- func (ff *FileField) GetFileName() string
- func (ff *FileField) GetFilePath(fileStorePath string, id string) string
- func (ff *FileField) HasContent() bool
- func (ff *FileField) WriteFile(fileStorePath string, id string) error
- type FileStore
- func (fs FileStore[T]) AutoAddHooks()
- func (fs FileStore[T]) CreateUpdateHook(_ *http.Request, resource T) *babyapi.ErrResponse
- func (fs FileStore[T]) DeleteHook(r *http.Request) *babyapi.ErrResponse
- func (fs FileStore[T]) DeleteResourceFiles(id string) error
- func (fs FileStore[T]) ServeFile(w http.ResponseWriter, r *http.Request) render.Renderer
- func (fs FileStore[T]) ServeFilesRoute(basePattern string) chi.Route
- type MultipartFormDecoder
- func (d *MultipartFormDecoder) AddContext(formKey string) string
- func (d *MultipartFormDecoder) CheckDecodeNode(formValue string, formKey string, tags []string, value reflect.Value)
- func (d *MultipartFormDecoder) DecodeNode(formValue string, formKey string, tags []string, value reflect.Value)
- func (d *MultipartFormDecoder) GetContext() string
- func (d *MultipartFormDecoder) GetFormKey(field reflect.StructField) (string, []string)
- func (d *MultipartFormDecoder) PopContext() string
- func (d *MultipartFormDecoder) PushContext(newLayer string)
- func (d *MultipartFormDecoder) RecursiveStructDecoder(v reflect.Value)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeMultipartForm ¶
func DeleteAllFiles ¶
func WriteAllFileFields ¶
Types ¶
type FileField ¶
type FileField struct { FileName string FileSize int64 MIMEHeader textproto.MIMEHeader FormKey string FormContext string // contains filtered or unexported fields }
func FindByFileName ¶
func (*FileField) DeleteFile ¶
func (*FileField) GetFileDir ¶
func (*FileField) GetFileName ¶
func (*FileField) GetFilePath ¶
func (*FileField) HasContent ¶
type FileStore ¶
type FileStore[T babyapi.Resource] struct { FileStorePath string // contains filtered or unexported fields }
func NewFileStore ¶
func (FileStore[T]) AutoAddHooks ¶
func (fs FileStore[T]) AutoAddHooks()
func (FileStore[T]) CreateUpdateHook ¶
func (fs FileStore[T]) CreateUpdateHook(_ *http.Request, resource T) *babyapi.ErrResponse
func (FileStore[T]) DeleteHook ¶
func (fs FileStore[T]) DeleteHook(r *http.Request) *babyapi.ErrResponse
func (FileStore[T]) DeleteResourceFiles ¶
func (FileStore[T]) ServeFilesRoute ¶
type MultipartFormDecoder ¶
type MultipartFormDecoder struct {
// contains filtered or unexported fields
}
func (*MultipartFormDecoder) AddContext ¶
func (d *MultipartFormDecoder) AddContext(formKey string) string
func (*MultipartFormDecoder) CheckDecodeNode ¶
func (*MultipartFormDecoder) DecodeNode ¶
func (*MultipartFormDecoder) GetContext ¶
func (d *MultipartFormDecoder) GetContext() string
func (*MultipartFormDecoder) GetFormKey ¶
func (d *MultipartFormDecoder) GetFormKey(field reflect.StructField) (string, []string)
func (*MultipartFormDecoder) PopContext ¶
func (d *MultipartFormDecoder) PopContext() string
func (*MultipartFormDecoder) PushContext ¶
func (d *MultipartFormDecoder) PushContext(newLayer string)
func (*MultipartFormDecoder) RecursiveStructDecoder ¶
func (d *MultipartFormDecoder) RecursiveStructDecoder(v reflect.Value)
Click to show internal directories.
Click to hide internal directories.