Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateShortURL(req CreateShortURLRequest) (*CreateShortURLResponse, error)
- func (c *Client) CreateText(req CreateTextRequest) (*CreateTextResponse, error)
- func (c *Client) DeleteFile(deleteKey string) (*DeleteFileResponse, error)
- func (c *Client) DeleteShortURL(request DeleteURLRequest) (*DeleteURLResponse, error)
- func (c *Client) DeleteText(req DeleteTextRequest) (*DeleteTextResponse, error)
- func (c *Client) GetDomains() (*DomainsResponse, error)
- func (c *Client) GetFileDomains() (*DomainsResponse, error)
- func (c *Client) GetFileHistory(page int) (*GetFileHistoryResponse, error)
- func (c *Client) GetTags() (*TagsResponse, error)
- func (c *Client) GetTextDomains() (*DomainsResponse, error)
- func (c *Client) GetUsage() (*GetUsageResponse, error)
- func (c *Client) UpdateShortURL(request UpdateShortURLRequest) (*UpdateShortURLResponse, error)
- func (c *Client) UpdateText(req UpdateTextRequest) (*UpdateTextResponse, error)
- func (c *Client) UploadFile(req UploadFileRequest) (*UploadFileResponse, error)
- type Config
- type CreateShortURLRequest
- type CreateShortURLResponse
- type CreateTextRequest
- type CreateTextResponse
- type DeleteFileResponse
- type DeleteTextRequest
- type DeleteTextResponse
- type DeleteURLRequest
- type DeleteURLResponse
- type DomainsResponse
- type GetFileHistoryResponse
- type GetUsageResponse
- type Tag
- type TagsResponse
- type UpdateShortURLRequest
- type UpdateShortURLResponse
- type UpdateTextRequest
- type UpdateTextResponse
- type UploadFileData
- type UploadFileRequest
- type UploadFileResponse
Constants ¶
const DefaultBaseURL = "https://s.ee/api/v1"
const DefaultTimeout = 30 * time.Second
const UsageNoLimit = -1
UsageNoLimit represents unlimited usage.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents the SEE SDK client for short URL operations
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) DeleteFile ¶
func (c *Client) DeleteFile(deleteKey string) (*DeleteFileResponse, error)
DeleteFile deletes an uploaded file using its delete key.
func (*Client) DeleteShortURL ¶
func (c *Client) DeleteShortURL(request 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) 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) 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) GetUsage ¶ added in v1.1.0
func (c *Client) GetUsage() (*GetUsageResponse, error)
GetUsage retrieves the usage statistics of the account.
func (*Client) UpdateShortURL ¶
func (c *Client) UpdateShortURL(request 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.
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 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 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 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 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"`
} `json:"data"`
Message string `json:"message"`
}
GetUsageResponse represents the response containing usage statistics.
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 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"`
Page string `json:"page"`
Path string `json:"path"`
Size int `json:"size"`
Storename string `json:"storename"`
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.