mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-10 12:47:44 +02:00
Migrate the deprecated gofumpt `extra-rules` to `extra.group-params`, as the alias now also enables the new `clothe-returns` and `balance-calls` rules. Disable SA4023, which hangs on go 1.27, see https://github.com/golangci/golangci-lint/issues/6732. Apply the resulting modernize fixes, mostly flattening embedded struct literals and switching errors.As to errors.AsType. Assisted-by: Claude:Opus 5
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
// Copyright 2017 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package structs
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Attachment a generic attachment
|
|
// swagger:model
|
|
type Attachment struct {
|
|
// ID is the unique identifier for the attachment
|
|
ID int64 `json:"id"`
|
|
// Name is the filename of the attachment
|
|
Name string `json:"name"`
|
|
// Size is the file size in bytes
|
|
Size int64 `json:"size"`
|
|
// DownloadCount is the number of times the attachment has been downloaded
|
|
DownloadCount int64 `json:"download_count"`
|
|
// swagger:strfmt date-time
|
|
// Created is the time when the attachment was uploaded
|
|
Created time.Time `json:"created_at"`
|
|
// UUID is the unique identifier for the attachment file
|
|
UUID string `json:"uuid"`
|
|
// DownloadURL is the URL to download the attachment
|
|
DownloadURL string `json:"browser_download_url"`
|
|
}
|
|
|
|
// EditAttachmentOptions options for editing attachments
|
|
// swagger:model
|
|
type EditAttachmentOptions struct {
|
|
// Name is the new filename for the attachment
|
|
Name string `json:"name"`
|
|
}
|