Documentation
¶
Index ¶
- Constants
- type APIError
- type BioCustomLink
- type BioPageData
- type CancelLargeFileUploadRequest
- type CancelLargeFileUploadResponse
- type CheckTokenRequest
- type CheckTokenResponse
- type Client
- func (c *Client) CancelLargeFileUpload(uploadID string) (*CancelLargeFileUploadResponse, error)
- func (c *Client) CheckToken(token string) (*CheckTokenResponse, error)
- func (c *Client) CompleteLargeFileUpload(uploadID string) (*CompleteLargeFileUploadResponse, error)
- func (c *Client) CreateBioPage(req CreateBioPageRequest) (*CreateBioPageResponse, error)
- func (c *Client) CreateLargeFileUpload(req CreateLargeFileUploadRequest) (*CreateLargeFileUploadResponse, error)
- func (c *Client) CreateQRCode(req CreateQRCodeRequest) (*CreateQRCodeResponse, error)
- func (c *Client) CreateShortURL(req CreateShortURLRequest) (*CreateShortURLResponse, error)
- func (c *Client) CreateText(req CreateTextRequest) (*CreateTextResponse, error)
- func (c *Client) DeleteBioPage(id int64) (*DeleteBioPageResponse, error)
- func (c *Client) DeleteFile(deleteKey string) (*DeleteFileResponse, error)
- func (c *Client) DeleteQRCode(req DeleteQRCodeRequest) (*DeleteQRCodeResponse, error)
- func (c *Client) DeleteShortURL(req DeleteURLRequest) (*DeleteURLResponse, error)
- func (c *Client) DeleteText(req DeleteTextRequest) (*DeleteTextResponse, error)
- func (c *Client) GetBioPageHistory(page int) (*GetBioPageHistoryResponse, error)
- func (c *Client) GetDomains() (*DomainsResponse, error)
- func (c *Client) GetFileDomains() (*DomainsResponse, error)
- func (c *Client) GetFileHistory(page int) (*GetFileHistoryResponse, error)
- func (c *Client) GetLargeFileUploadOffset(uploadID string) (int64, error)
- func (c *Client) GetLargeFileUploadProgress(uploadID string) (*GetLargeFileUploadProgressResponse, error)
- func (c *Client) GetLinkHistory(page int) (*GetLinkHistoryResponse, error)
- func (c *Client) GetLinkVisitStat(domain, slug, period string) (*GetLinkVisitStatResponse, error)
- func (c *Client) GetPrivateFileDownloadURL(fileID int64) (*GetPrivateFileDownloadURLResponse, error)
- func (c *Client) GetQRCodeHistory(page int) (*GetQRCodeHistoryResponse, error)
- func (c *Client) GetTags() (*TagsResponse, error)
- func (c *Client) GetTextDomains() (*DomainsResponse, error)
- func (c *Client) GetTextHistory(page int) (*GetTextHistoryResponse, error)
- func (c *Client) GetUsage() (*GetUsageResponse, error)
- func (c *Client) SmartUploadFile(req UploadFileRequest) (*UploadFileResponse, error)
- func (c *Client) UpdateBioPage(req UpdateBioPageRequest) (*UpdateBioPageResponse, error)
- func (c *Client) UpdateShortURL(req UpdateShortURLRequest) (*UpdateShortURLResponse, error)
- func (c *Client) UpdateText(req UpdateTextRequest) (*UpdateTextResponse, error)
- func (c *Client) UploadFile(req UploadFileRequest) (*UploadFileResponse, error)
- func (c *Client) UploadLargeFile(req CreateLargeFileUploadRequest, r io.Reader) (*CompleteLargeFileUploadResponse, error)
- func (c *Client) UploadLargeFileChunk(uploadID string, offset int64, chunk []byte) (int64, error)
- type CompleteLargeFileUploadData
- type CompleteLargeFileUploadRequest
- type CompleteLargeFileUploadResponse
- type Config
- type CreateBioPageRequest
- type CreateBioPageResponse
- type CreateLargeFileUploadData
- type CreateLargeFileUploadRequest
- type CreateLargeFileUploadResponse
- type CreateQRCodeData
- type CreateQRCodeRequest
- type CreateQRCodeResponse
- type CreateShortURLRequest
- type CreateShortURLResponse
- type CreateTextRequest
- type CreateTextResponse
- type DeleteBioPageRequest
- type DeleteBioPageResponse
- type DeleteFileResponse
- type DeleteQRCodeRequest
- type DeleteQRCodeResponse
- type DeleteTextRequest
- type DeleteTextResponse
- type DeleteURLRequest
- type DeleteURLResponse
- type DomainsResponse
- type GetBioPageHistoryResponse
- type GetFileHistoryResponse
- type GetLargeFileUploadProgressResponse
- type GetLinkHistoryResponse
- type GetLinkVisitStatResponse
- type GetPrivateFileDownloadURLData
- type GetPrivateFileDownloadURLResponse
- type GetQRCodeHistoryResponse
- type GetTextHistoryResponse
- type GetUsageResponse
- type LargeFileUploadProgressData
- type LinkHistoryData
- type QRCodeHistoryData
- type Tag
- type TagsResponse
- type TextHistoryData
- type UpdateBioPageRequest
- type UpdateBioPageResponse
- type UpdateShortURLRequest
- type UpdateShortURLResponse
- type UpdateTextRequest
- type UpdateTextResponse
- type UploadFileData
- type UploadFileRequest
- type UploadFileResponse
Constants ¶
const ( VisitStatPeriodDaily = "daily" // today VisitStatPeriodMonthly = "monthly" // this month VisitStatPeriodTotally = "totally" // all-time (default) )
Visit statistics period values accepted by GetLinkVisitStat.
const ( LargeFileUploadStatusUploading = 1 LargeFileUploadStatusCompleted = 2 LargeFileUploadStatusFailed = 3 LargeFileUploadStatusCancelled = 4 )
Large file upload session status values reported by GetLargeFileUploadProgress.
const DefaultBaseURL = "https://s.ee/api/v1"
const DefaultLargeFileChunkSize = 16 * 1024 * 1024
DefaultLargeFileChunkSize is the chunk size used by UploadLargeFile (16MB).
const DefaultTimeout = 30 * time.Second
const UsageNoLimit = -1
UsageNoLimit represents unlimited usage.
const Version = "1.5.0"
Version is the current version of the SDK.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BioCustomLink ¶ added in v1.3.0
type BioCustomLink struct {
Description string `json:"description,omitempty"`
Title string `json:"title"`
URL string `json:"url"`
}
BioCustomLink represents a custom link on a bio page.
type BioPageData ¶ added in v1.3.0
type BioPageData struct {
CreatedAt int64 `json:"created_at"`
CustomLinks []BioCustomLink `json:"custom_links"`
Description string `json:"description"`
Domain string `json:"domain"`
ID int64 `json:"id"`
Link string `json:"link"` // The complete short URL of the bio page
MastodonURL string `json:"mastodon_url"`
RSSURL string `json:"rss_url"`
Slug string `json:"slug"`
Title string `json:"title"`
}
BioPageData represents a bio page entry in the history.
type CancelLargeFileUploadRequest ¶ added in v1.3.0
type CancelLargeFileUploadRequest struct {
UploadID string `json:"upload_id"`
}
CancelLargeFileUploadRequest represents a request to cancel a large file upload session.
type CancelLargeFileUploadResponse ¶ added in v1.3.0
type CancelLargeFileUploadResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
CancelLargeFileUploadResponse represents the response from cancelling a large file upload.
type CheckTokenRequest ¶ added in v1.3.0
type CheckTokenRequest struct {
Token string `json:"token"`
}
CheckTokenRequest represents a request to validate an API token.
type CheckTokenResponse ¶ added in v1.3.0
type CheckTokenResponse struct {
Code int `json:"code"`
Data struct {
ExpiresAt int64 `json:"expires_at"` // Token expiration time in Unix timestamp
Token string `json:"token"`
Valid bool `json:"valid"`
} `json:"data"`
Message string `json:"message"`
}
CheckTokenResponse represents the response from validating an API token.
type Client ¶
Client represents the SEE SDK client for short URL operations
func (*Client) CancelLargeFileUpload ¶ added in v1.3.0
func (c *Client) CancelLargeFileUpload(uploadID string) (*CancelLargeFileUploadResponse, error)
CancelLargeFileUpload cancels an in-progress upload session and removes the temporary data.
func (*Client) CheckToken ¶ added in v1.3.0
func (c *Client) CheckToken(token string) (*CheckTokenResponse, error)
CheckToken checks whether the provided API token is valid and usable. When valid, the response includes the token string and its expiration time.
func (*Client) CompleteLargeFileUpload ¶ added in v1.3.0
func (c *Client) CompleteLargeFileUpload(uploadID string) (*CompleteLargeFileUploadResponse, error)
CompleteLargeFileUpload finalizes an upload session after all chunks have been uploaded. It validates the file, moves it to permanent storage, and returns the file record. This consumes the upload session.
func (*Client) CreateBioPage ¶ added in v1.3.0
func (c *Client) CreateBioPage(req CreateBioPageRequest) (*CreateBioPageResponse, error)
CreateBioPage creates a new bio page with a short URL.
func (*Client) CreateLargeFileUpload ¶ added in v1.3.0
func (c *Client) CreateLargeFileUpload(req CreateLargeFileUploadRequest) (*CreateLargeFileUploadResponse, error)
CreateLargeFileUpload creates a TUS upload session for files up to 5GB. If FileHash is provided and the file already exists on the server, the response has FastUpload set to true and ExistingFile populated, and no data transfer is needed.
func (*Client) CreateQRCode ¶ added in v1.3.0
func (c *Client) CreateQRCode(req CreateQRCodeRequest) (*CreateQRCodeResponse, error)
CreateQRCode creates a dynamic QR code for a given URL. The QR code is generated server-side and available in PNG, SVG, and PDF formats.
func (*Client) CreateShortURL ¶
func (c *Client) CreateShortURL(req CreateShortURLRequest) (*CreateShortURLResponse, error)
CreateShortURL creates a new short URL with the given parameters.
func (*Client) CreateText ¶
func (c *Client) CreateText(req CreateTextRequest) (*CreateTextResponse, error)
CreateText creates a new text entry with the given parameters.
func (*Client) DeleteBioPage ¶ added in v1.3.0
func (c *Client) DeleteBioPage(id int64) (*DeleteBioPageResponse, error)
DeleteBioPage permanently deletes a bio page by its numeric ID.
func (*Client) DeleteFile ¶
func (c *Client) DeleteFile(deleteKey string) (*DeleteFileResponse, error)
DeleteFile deletes an uploaded file using its delete key.
func (*Client) DeleteQRCode ¶ added in v1.3.0
func (c *Client) DeleteQRCode(req DeleteQRCodeRequest) (*DeleteQRCodeResponse, error)
DeleteQRCode permanently deletes a QR code and its associated short link.
func (*Client) DeleteShortURL ¶
func (c *Client) DeleteShortURL(req DeleteURLRequest) (*DeleteURLResponse, error)
DeleteShortURL deletes an existing short URL.
func (*Client) DeleteText ¶
func (c *Client) DeleteText(req DeleteTextRequest) (*DeleteTextResponse, error)
DeleteText deletes an existing text entry.
func (*Client) GetBioPageHistory ¶ added in v1.3.0
func (c *Client) GetBioPageHistory(page int) (*GetBioPageHistoryResponse, error)
GetBioPageHistory retrieves a paginated list of bio pages. Page starts at 1. If page is 0 or negative, defaults to page 1.
func (*Client) GetDomains ¶
func (c *Client) GetDomains() (*DomainsResponse, error)
GetDomains retrieves the list of available domains.
func (*Client) GetFileDomains ¶
func (c *Client) GetFileDomains() (*DomainsResponse, error)
GetFileDomains retrieves the list of available domains for file sharing.
func (*Client) GetFileHistory ¶ added in v1.1.1
func (c *Client) GetFileHistory(page int) (*GetFileHistoryResponse, error)
GetFileHistory retrieves a paginated list of uploaded files. Returns 30 files per page, sorted by creation time descending. Page starts at 1. If page is 0 or negative, defaults to page 1.
func (*Client) GetLargeFileUploadOffset ¶ added in v1.3.0
GetLargeFileUploadOffset queries the server for the current upload offset of a session (TUS HEAD request). Use it to resume an interrupted upload.
func (*Client) GetLargeFileUploadProgress ¶ added in v1.3.0
func (c *Client) GetLargeFileUploadProgress(uploadID string) (*GetLargeFileUploadProgressResponse, error)
GetLargeFileUploadProgress returns the current progress of a large file upload session.
func (*Client) GetLinkHistory ¶ added in v1.3.0
func (c *Client) GetLinkHistory(page int) (*GetLinkHistoryResponse, error)
GetLinkHistory retrieves a paginated list of short links created by the account. Page starts at 1. If page is 0 or negative, defaults to page 1.
func (*Client) GetLinkVisitStat ¶ added in v1.3.0
func (c *Client) GetLinkVisitStat(domain, slug, period string) (*GetLinkVisitStatResponse, error)
GetLinkVisitStat retrieves click/visit statistics for a short URL. The period can be VisitStatPeriodDaily, VisitStatPeriodMonthly, or VisitStatPeriodTotally. An empty period defaults to all-time statistics.
func (*Client) GetPrivateFileDownloadURL ¶ added in v1.2.0
func (c *Client) GetPrivateFileDownloadURL(fileID int64) (*GetPrivateFileDownloadURLResponse, error)
GetPrivateFileDownloadURL retrieves a temporary download URL for a private file using its file ID. The URL is valid for a limited time (about 1 hour).
func (*Client) GetQRCodeHistory ¶ added in v1.3.0
func (c *Client) GetQRCodeHistory(page int) (*GetQRCodeHistoryResponse, error)
GetQRCodeHistory retrieves a paginated list of QR codes. Page starts at 1. If page is 0 or negative, defaults to page 1.
func (*Client) GetTags ¶
func (c *Client) GetTags() (*TagsResponse, error)
GetTags retrieves the list of available tags.
func (*Client) GetTextDomains ¶ added in v1.0.1
func (c *Client) GetTextDomains() (*DomainsResponse, error)
GetTextDomains retrieves the list of available domains for text sharing.
func (*Client) GetTextHistory ¶ added in v1.3.0
func (c *Client) GetTextHistory(page int) (*GetTextHistoryResponse, error)
GetTextHistory retrieves a paginated list of text sharings created by the account. Page starts at 1. If page is 0 or negative, defaults to page 1.
func (*Client) GetUsage ¶ added in v1.1.0
func (c *Client) GetUsage() (*GetUsageResponse, error)
GetUsage retrieves the usage statistics of the account.
func (*Client) SmartUploadFile ¶ added in v1.3.0
func (c *Client) SmartUploadFile(req UploadFileRequest) (*UploadFileResponse, error)
SmartUploadFile uploads a file choosing the best strategy automatically: files up to 100MB go through the regular multipart upload, while larger files (up to 5GB) are transferred with the TUS resumable protocol. The reader should expose its size via Stat() (e.g. *os.File) or Len() (e.g. *bytes.Reader); when the size cannot be determined, the regular upload is used.
func (*Client) UpdateBioPage ¶ added in v1.3.0
func (c *Client) UpdateBioPage(req UpdateBioPageRequest) (*UpdateBioPageResponse, error)
UpdateBioPage updates an existing bio page.
func (*Client) UpdateShortURL ¶
func (c *Client) UpdateShortURL(req UpdateShortURLRequest) (*UpdateShortURLResponse, error)
UpdateShortURL updates an existing short URL.
func (*Client) UpdateText ¶
func (c *Client) UpdateText(req UpdateTextRequest) (*UpdateTextResponse, error)
UpdateText updates an existing text entry.
func (*Client) UploadFile ¶
func (c *Client) UploadFile(req UploadFileRequest) (*UploadFileResponse, error)
UploadFile uploads a file to the server.
func (*Client) UploadLargeFile ¶ added in v1.3.0
func (c *Client) UploadLargeFile(req CreateLargeFileUploadRequest, r io.Reader) (*CompleteLargeFileUploadResponse, error)
UploadLargeFile uploads a file up to 5GB using the TUS resumable protocol. It creates an upload session, transfers the content in chunks of DefaultLargeFileChunkSize, and completes the session. When the server reports an instant (deduplicated) upload, no data is transferred and the existing file record is returned.
type CompleteLargeFileUploadData ¶ added in v1.3.0
type CompleteLargeFileUploadData struct {
File UploadFileData `json:"file"`
ShortLink string `json:"short_link,omitempty"` // Short link created for the file (if domain/alias were provided)
}
CompleteLargeFileUploadData contains the completed upload result.
type CompleteLargeFileUploadRequest ¶ added in v1.3.0
type CompleteLargeFileUploadRequest struct {
UploadID string `json:"upload_id"`
}
CompleteLargeFileUploadRequest represents a request to complete a large file upload session.
type CompleteLargeFileUploadResponse ¶ added in v1.3.0
type CompleteLargeFileUploadResponse struct {
Code int `json:"code"`
Data CompleteLargeFileUploadData `json:"data"`
Message string `json:"message"`
}
CompleteLargeFileUploadResponse represents the response from completing a large file upload.
type CreateBioPageRequest ¶ added in v1.3.0
type CreateBioPageRequest struct {
CustomLinks []BioCustomLink `json:"custom_links,omitempty"`
CustomSlug string `json:"custom_slug,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
MastodonURL string `json:"mastodon_url,omitempty"`
RSSURL string `json:"rss_url,omitempty"`
Title string `json:"title"`
}
CreateBioPageRequest represents a request to create a bio page.
type CreateBioPageResponse ¶ added in v1.3.0
type CreateBioPageResponse struct {
Code int `json:"code"`
Data struct {
BioPageID int64 `json:"bio_page_id"`
ShortURL string `json:"short_url"`
} `json:"data"`
Message string `json:"message"`
}
CreateBioPageResponse represents the response from creating a bio page.
type CreateLargeFileUploadData ¶ added in v1.3.0
type CreateLargeFileUploadData struct {
ExistingFile *UploadFileData `json:"existing_file,omitempty"` // Populated when FastUpload is true
ExpiresAt int64 `json:"expires_at"` // Unix timestamp when this upload session expires (24h)
FastUpload bool `json:"fast_upload"` // True when the file already exists and upload was skipped
FileSize int64 `json:"file_size"`
ID int64 `json:"id"`
UploadID string `json:"upload_id"`
UploadURL string `json:"upload_url"` // TUS upload endpoint URL
}
CreateLargeFileUploadData contains the created upload session information.
type CreateLargeFileUploadRequest ¶ added in v1.3.0
type CreateLargeFileUploadRequest struct {
Alias string `json:"alias,omitempty"` // Custom slug for the short link (alphanumeric only)
Description string `json:"description,omitempty"`
Domain string `json:"domain,omitempty"`
ExpireAt int64 `json:"expire_at,omitempty"` // Unix timestamp for link expiry
FileHash string `json:"file_hash,omitempty"` // SHA256 hash for instant upload deduplication
FileName string `json:"file_name"`
FileSize int64 `json:"file_size"`
IsPrivate int `json:"is_private,omitempty"` // 0 = public (default), 1 = private
MimeType string `json:"mime_type,omitempty"`
Password string `json:"password,omitempty"`
Title string `json:"title,omitempty"`
}
CreateLargeFileUploadRequest represents a request to create a large file (TUS) upload session.
type CreateLargeFileUploadResponse ¶ added in v1.3.0
type CreateLargeFileUploadResponse struct {
Code int `json:"code"`
Data CreateLargeFileUploadData `json:"data"`
Message string `json:"message"`
}
CreateLargeFileUploadResponse represents the response from creating a large file upload session.
type CreateQRCodeData ¶ added in v1.3.0
type CreateQRCodeData struct {
CustomSlug string `json:"custom_slug"`
PDFURL string `json:"pdf_url"`
PNGURL string `json:"png_url"`
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
SVGURL string `json:"svg_url"`
}
CreateQRCodeData contains the created QR code information.
type CreateQRCodeRequest ¶ added in v1.3.0
type CreateQRCodeRequest struct {
CustomSlug string `json:"custom_slug,omitempty"`
Domain string `json:"domain,omitempty"`
TargetURL string `json:"target_url"`
Title string `json:"title"`
}
CreateQRCodeRequest represents a request to create a dynamic QR code.
type CreateQRCodeResponse ¶ added in v1.3.0
type CreateQRCodeResponse struct {
Code int `json:"code"`
Data CreateQRCodeData `json:"data"`
Message string `json:"message"`
}
CreateQRCodeResponse represents the response from creating a QR code.
type CreateShortURLRequest ¶
type CreateShortURLRequest struct {
CustomSlug string `json:"custom_slug,omitempty"`
Domain string `json:"domain"`
ExpirationRedirectURL string `json:"expiration_redirect_url,omitempty"`
ExpireAt int64 `json:"expire_at,omitempty"` // Unix timestamp in seconds
Password string `json:"password,omitempty"`
TagIDs []int64 `json:"tag_ids,omitempty"`
TargetURL string `json:"target_url"`
Title string `json:"title,omitempty"`
}
CreateShortURLRequest represents a request to create a short URL.
type CreateShortURLResponse ¶
type CreateShortURLResponse struct {
Code int `json:"code"`
Data struct {
CustomSlug string `json:"custom_slug"`
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
} `json:"data"`
Message string `json:"message"`
}
CreateShortURLResponse represents the response from creating a short URL.
type CreateTextRequest ¶
type CreateTextRequest struct {
Content string `json:"content"`
CustomSlug string `json:"custom_slug,omitempty"`
Domain string `json:"domain,omitempty"`
ExpireAt int64 `json:"expire_at,omitempty"` // Unix timestamp in seconds
Password string `json:"password,omitempty"`
TagIDs []int64 `json:"tag_ids,omitempty"`
TextType string `json:"text_type,omitempty"`
Title string `json:"title,omitempty"`
}
type CreateTextResponse ¶
type CreateTextResponse struct {
Code int `json:"code"`
Data struct {
CustomSlug string `json:"custom_slug"`
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
} `json:"data"`
Message string `json:"message"`
}
CreateTextResponse represents the response from creating a text sharing.
type DeleteBioPageRequest ¶ added in v1.3.0
type DeleteBioPageRequest struct {
ID int64 `json:"id"`
}
DeleteBioPageRequest represents a request to delete a bio page.
type DeleteBioPageResponse ¶ added in v1.3.0
type DeleteBioPageResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
DeleteBioPageResponse represents the response from deleting a bio page.
type DeleteFileResponse ¶
type DeleteFileResponse struct {
Code string `json:"code"`
Message string `json:"message"`
Success bool `json:"success"`
}
DeleteFileResponse represents the response from deleting a file.
type DeleteQRCodeRequest ¶ added in v1.3.0
DeleteQRCodeRequest represents a request to delete a QR code.
type DeleteQRCodeResponse ¶ added in v1.3.0
type DeleteQRCodeResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
DeleteQRCodeResponse represents the response from deleting a QR code.
type DeleteTextRequest ¶
DeleteTextRequest represents a request to delete a text.
type DeleteTextResponse ¶
type DeleteTextResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
DeleteTextResponse represents the response from deleting a text.
type DeleteURLRequest ¶
DeleteURLRequest represents a request to delete a short URL.
type DeleteURLResponse ¶
type DeleteURLResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
DeleteURLResponse represents the response from deleting a short URL.
type DomainsResponse ¶
type DomainsResponse struct {
Code int `json:"code"`
Data struct {
Domains []string `json:"domains"`
} `json:"data"`
Message string `json:"message"`
}
DomainsResponse represents the response containing available domains.
type GetBioPageHistoryResponse ¶ added in v1.3.0
type GetBioPageHistoryResponse struct {
Code int `json:"code"`
Data struct {
BioPages []BioPageData `json:"bio_pages"`
Total int64 `json:"total"`
} `json:"data"`
Message string `json:"message"`
}
GetBioPageHistoryResponse represents the response containing bio page history.
type GetFileHistoryResponse ¶ added in v1.1.1
type GetFileHistoryResponse struct {
Code int `json:"code"`
Data []UploadFileData `json:"data"`
Message string `json:"message"`
Success bool `json:"success"`
}
GetFileHistoryResponse represents the response containing file upload history.
type GetLargeFileUploadProgressResponse ¶ added in v1.3.0
type GetLargeFileUploadProgressResponse struct {
Code int `json:"code"`
Data LargeFileUploadProgressData `json:"data"`
Message string `json:"message"`
}
GetLargeFileUploadProgressResponse represents the response containing upload progress.
type GetLinkHistoryResponse ¶ added in v1.3.0
type GetLinkHistoryResponse struct {
Code int `json:"code"`
Data []LinkHistoryData `json:"data"`
Message string `json:"message"`
Success bool `json:"success"`
}
GetLinkHistoryResponse represents the response containing link creation history.
type GetLinkVisitStatResponse ¶ added in v1.3.0
type GetLinkVisitStatResponse struct {
Code int `json:"code"`
Data struct {
VisitCount int64 `json:"visit_count"`
} `json:"data"`
Message string `json:"message"`
}
GetLinkVisitStatResponse represents the response containing link visit statistics.
type GetPrivateFileDownloadURLData ¶ added in v1.2.0
type GetPrivateFileDownloadURLData struct {
FileID int64 `json:"file_id"`
URL string `json:"url"`
ExpiresAt int64 `json:"expires_at"`
}
GetPrivateFileDownloadURLData contains the private file download URL information.
type GetPrivateFileDownloadURLResponse ¶ added in v1.2.0
type GetPrivateFileDownloadURLResponse struct {
Code int `json:"code"`
Data GetPrivateFileDownloadURLData `json:"data"`
Message string `json:"message"`
Success bool `json:"success"`
}
GetPrivateFileDownloadURLResponse represents the response when getting a private file download URL.
type GetQRCodeHistoryResponse ¶ added in v1.3.0
type GetQRCodeHistoryResponse struct {
Code int `json:"code"`
Data struct {
QRCodes []QRCodeHistoryData `json:"qrcodes"`
Total int64 `json:"total"`
} `json:"data"`
Message string `json:"message"`
}
GetQRCodeHistoryResponse represents the response containing QR code history.
type GetTextHistoryResponse ¶ added in v1.3.0
type GetTextHistoryResponse struct {
Code int `json:"code"`
Data []TextHistoryData `json:"data"`
Message string `json:"message"`
Success bool `json:"success"`
}
GetTextHistoryResponse represents the response containing text creation history.
type GetUsageResponse ¶ added in v1.1.0
type GetUsageResponse struct {
Code int `json:"code"`
Data struct {
APICountDay int `json:"api_count_day"`
APICountDayLimit int `json:"api_count_day_limit"`
APICountMonth int `json:"api_count_month"`
APICountMonthLimit int `json:"api_count_month_limit"`
LinkCountDay int `json:"link_count_day"`
LinkCountDayLimit int `json:"link_count_day_limit"`
LinkCountMonth int `json:"link_count_month"`
LinkCountMonthLimit int `json:"link_count_month_limit"`
QRCodeCountDay int `json:"qrcode_count_day"`
QRCodeCountDayLimit int `json:"qrcode_count_day_limit"`
QRCodeCountMonth int `json:"qrcode_count_month"`
QRCodeCountMonthLimit int `json:"qrcode_count_month_limit"`
TextCountDay int `json:"text_count_day"`
TextCountDayLimit int `json:"text_count_day_limit"`
TextCountMonth int `json:"text_count_month"`
TextCountMonthLimit int `json:"text_count_month_limit"`
UploadCountDay int `json:"upload_count_day"`
UploadCountDayLimit int `json:"upload_count_day_limit"`
UploadCountMonth int `json:"upload_count_month"`
UploadCountMonthLimit int `json:"upload_count_month_limit"`
FileCount int `json:"file_count"`
StorageUsageMB string `json:"storage_usage_mb"` // in MB, rounded to 2 decimal places
StorageUsageLimitMB string `json:"storage_usage_limit_mb"` // in MB, "-1" means unlimited
} `json:"data"`
Message string `json:"message"`
}
GetUsageResponse represents the response containing usage statistics.
type LargeFileUploadProgressData ¶ added in v1.3.0
type LargeFileUploadProgressData struct {
CreatedAt int64 `json:"created_at"`
FileName string `json:"file_name"`
FileSize int64 `json:"file_size"`
Progress float64 `json:"progress"` // Progress percentage (0-100)
Status int `json:"status"` // See LargeFileUploadStatus* constants
UpdatedAt int64 `json:"updated_at"`
UploadID string `json:"upload_id"`
UploadedSize int64 `json:"uploaded_size"`
}
LargeFileUploadProgressData contains the progress of a large file upload session.
type LinkHistoryData ¶ added in v1.3.0
type LinkHistoryData struct {
CreatedAt int64 `json:"created_at"`
Domain string `json:"domain"`
ObjectType int `json:"object_type"` // 0 = link, 1 = file, 2 = text, 3 = qrcode
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
TargetURL string `json:"target_url"`
Title string `json:"title"`
VisitCount int64 `json:"visit_count"`
}
LinkHistoryData represents a short link entry in the creation history.
type QRCodeHistoryData ¶ added in v1.3.0
type QRCodeHistoryData struct {
CreatedAt int64 `json:"created_at"`
Domain string `json:"domain"`
PDFURL string `json:"pdf_url"`
PNGURL string `json:"png_url"`
ScanCount int64 `json:"scan_count"`
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
SVGURL string `json:"svg_url"`
Title string `json:"title"`
}
QRCodeHistoryData represents a QR code entry in the history.
type TagsResponse ¶
type TagsResponse struct {
Code int `json:"code"`
Data struct {
Tags []Tag `json:"tags"`
} `json:"data"`
Message string `json:"message"`
}
TagsResponse represents the response containing available tags.
type TextHistoryData ¶ added in v1.3.0
type TextHistoryData struct {
ContentPreview string `json:"content_preview"` // Preview of the content (truncated)
CreatedAt int64 `json:"created_at"`
Domain string `json:"domain"`
ID int64 `json:"id"`
IsExpired bool `json:"is_expired"`
ShortURL string `json:"short_url"`
Slug string `json:"slug"`
TextType string `json:"text_type"` // "plain_text", "source_code", or "markdown"
Title string `json:"title"`
}
TextHistoryData represents a text sharing entry in the creation history.
type UpdateBioPageRequest ¶ added in v1.3.0
type UpdateBioPageRequest struct {
CustomLinks []BioCustomLink `json:"custom_links,omitempty"`
Description string `json:"description,omitempty"`
ID int64 `json:"id"`
MastodonURL string `json:"mastodon_url,omitempty"`
RSSURL string `json:"rss_url,omitempty"`
Title string `json:"title"`
}
UpdateBioPageRequest represents a request to update a bio page. Omit CustomLinks to leave the existing custom links unchanged.
type UpdateBioPageResponse ¶ added in v1.3.0
type UpdateBioPageResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
UpdateBioPageResponse represents the response from updating a bio page.
type UpdateShortURLRequest ¶
type UpdateShortURLRequest struct {
Domain string `json:"domain"`
Slug string `json:"slug"`
TargetURL string `json:"target_url"`
Title string `json:"title"`
}
UpdateShortURLRequest represents a request to update a short URL.
type UpdateShortURLResponse ¶
type UpdateShortURLResponse struct {
Code int `json:"code"`
Data any `json:"data"`
Message string `json:"message"`
}
UpdateShortURLResponse represents the response from updating a short URL.
type UpdateTextRequest ¶
type UpdateTextResponse ¶
type UpdateTextResponse struct {
Code int `json:"code"`
Data any `json:"data,omitempty"`
Message string `json:"message"`
}
UpdateTextResponse represents the response from updating a text.
type UploadFileData ¶ added in v1.1.1
type UploadFileData struct {
CreatedAt int `json:"created_at,omitempty"`
Delete string `json:"delete"`
FileID int `json:"file_id"`
Filename string `json:"filename"`
Hash string `json:"hash"`
Height int `json:"height"`
MimeType string `json:"mime_type,omitempty"`
Page string `json:"page"`
Path string `json:"path"`
Size int `json:"size"`
Storename string `json:"storename"`
ThumbURL string `json:"thumb_url,omitempty"`
UploadStatus int `json:"upload_status"`
URL string `json:"url"`
Width int `json:"width"`
}
UploadFileData represents the metadata of an uploaded file.
type UploadFileRequest ¶ added in v1.1.1
type UploadFileRequest struct {
Filename string
File io.Reader
Domain string
CustomSlug string
IsPrivate bool
}
UploadFileRequest represents a request to upload a file.
type UploadFileResponse ¶
type UploadFileResponse struct {
Code int `json:"code"`
Data UploadFileData `json:"data"`
Message string `json:"message"`
}
UploadFileResponse represents the response from uploading a file.