 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func NewAttachment(ctx context.Context, attach *repo_model.Attachment, file io.Reader, size int64) (*repo_model.Attachment, error)
- func UpdateAttachment(ctx context.Context, allowedTypes string, attach *repo_model.Attachment) error
- func UploadAttachmentGeneralSizeLimit(ctx context.Context, file *UploaderFile, allowedTypes string, ...) (*repo_model.Attachment, error)
- type UploaderFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAttachment ¶
func NewAttachment(ctx context.Context, attach *repo_model.Attachment, file io.Reader, size int64) (*repo_model.Attachment, error)
NewAttachment creates a new attachment object, but do not verify.
func UpdateAttachment ¶ added in v1.23.0
func UpdateAttachment(ctx context.Context, allowedTypes string, attach *repo_model.Attachment) error
UpdateAttachment updates an attachment, verifying that its name is among the allowed types.
func UploadAttachmentGeneralSizeLimit ¶ added in v1.25.0
func UploadAttachmentGeneralSizeLimit(ctx context.Context, file *UploaderFile, allowedTypes string, attach *repo_model.Attachment) (*repo_model.Attachment, error)
Types ¶
type UploaderFile ¶ added in v1.25.0
type UploaderFile struct {
	// contains filtered or unexported fields
}
    func NewLimitedUploaderKnownSize ¶ added in v1.25.0
func NewLimitedUploaderKnownSize(r io.Reader, size int64) *UploaderFile
func NewLimitedUploaderMaxBytesReader ¶ added in v1.25.0
func NewLimitedUploaderMaxBytesReader(r io.ReadCloser, w http.ResponseWriter) *UploaderFile
 Click to show internal directories. 
   Click to hide internal directories.