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) GetTags() (*TagsResponse, error)
- func (c *Client) GetTextDomains() (*DomainsResponse, error)
- func (c *Client) UpdateShortURL(request UpdateShortURLRequest) (*UpdateShortURLResponse, error)
- func (c *Client) UpdateText(req UpdateTextRequest) (*UpdateTextResponse, error)
- func (c *Client) UploadFile(filename string, file io.Reader) (*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 Tag
- type TagsResponse
- type UpdateShortURLRequest
- type UpdateShortURLResponse
- type UpdateTextRequest
- type UpdateTextResponse
- type UploadFileResponse
Constants ¶
const DefaultBaseURL = "https://s.ee/api/v1"
const DefaultTimeout = 30 * time.Second
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) 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) 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 ¶
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 struct {
Tags []struct {
Id int `json:"id"`
Name string `json:"name"`
}
} `json:"data"`
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 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 struct {
Tags []struct {
Id int `json:"id"`
Name string `json:"name"`
}
} `json:"data"`
Message string `json:"message"`
}
UpdateTextResponse represents the response from updating a text.
type UploadFileResponse ¶
type UploadFileResponse struct {
Code int `json:"code"`
Data struct {
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"`
} `json:"data"`
Message string `json:"message"`
}
UploadFileResponse represents the response from uploading a file.