Documentation
¶
Overview ¶
Package sirv provides a Go SDK for the Sirv REST API.
Example usage:
client := sirv.NewClient(sirv.ClientConfig{
ClientID: "your-client-id",
ClientSecret: "your-client-secret",
})
ctx := context.Background()
token, err := client.Connect(ctx)
if err != nil {
log.Fatal(err)
}
account, err := client.GetAccountInfo(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println("CDN URL:", account.CdnURL)
Package sirv provides a Go SDK for the Sirv REST API.
Package sirv provides a Go SDK for the Sirv REST API.
Index ¶
- Constants
- func BoolPtr(b bool) *bool
- func Float64Ptr(f float64) *float64
- func Int64Ptr(i int64) *int64
- func IntPtr(i int) *int
- func IsAPIError(err error) bool
- func StringPtr(s string) *string
- func Version() string
- type APIError
- type AccountEvent
- type AccountInfo
- type AccountLimits
- type AccountUpdateOptions
- type AccountUser
- type AliasConfig
- type BatchDeleteItemResult
- type BatchDeleteResult
- type BatchZipParams
- type BatchZipResult
- type BillingPlan
- type Client
- func (c *Client) AddFileTags(ctx context.Context, filename string, tags []string) error
- func (c *Client) BatchDelete(ctx context.Context, filenames []string) (*BatchDeleteResult, error)
- func (c *Client) BatchZip(ctx context.Context, params *BatchZipParams) (*BatchZipResult, error)
- func (c *Client) Connect(ctx context.Context, expiresIn ...int) (*TokenResponse, error)
- func (c *Client) CopyFile(ctx context.Context, params *CopyParams) error
- func (c *Client) CreateFolder(ctx context.Context, dirname string) error
- func (c *Client) DeleteFile(ctx context.Context, filename string) error
- func (c *Client) DeletePointOfInterest(ctx context.Context, filename, name string) error
- func (c *Client) DownloadFile(ctx context.Context, filename string) ([]byte, error)
- func (c *Client) DownloadFileTo(ctx context.Context, filename, localPath string) error
- func (c *Client) ExportSpinToAmazon(ctx context.Context, params *ExportSpinParams) error
- func (c *Client) ExportSpinToGrainger(ctx context.Context, params *ExportSpinParams) error
- func (c *Client) ExportSpinToHomeDepot(ctx context.Context, params *ExportSpinParams) error
- func (c *Client) ExportSpinToLowes(ctx context.Context, params *ExportSpinParams) error
- func (c *Client) ExportSpinToWalmart(ctx context.Context, params *ExportSpinParams) error
- func (c *Client) FetchURL(ctx context.Context, params *FetchURLParams) error
- func (c *Client) GenerateJWT(ctx context.Context, params *JWTParams) (*JWTResponse, error)
- func (c *Client) GetAccessToken() string
- func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error)
- func (c *Client) GetAccountLimits(ctx context.Context) (*AccountLimits, error)
- func (c *Client) GetAccountUsers(ctx context.Context) ([]AccountUser, error)
- func (c *Client) GetApprovalFlag(ctx context.Context, filename string) (bool, error)
- func (c *Client) GetBatchDeleteStatus(ctx context.Context, jobID string) (*BatchDeleteResult, error)
- func (c *Client) GetBillingPlan(ctx context.Context) (*BillingPlan, error)
- func (c *Client) GetFileDescription(ctx context.Context, filename string) (string, error)
- func (c *Client) GetFileInfo(ctx context.Context, filename string) (*FileInfo, error)
- func (c *Client) GetFileMeta(ctx context.Context, filename string) (*FileMeta, error)
- func (c *Client) GetFileTags(ctx context.Context, filename string) ([]string, error)
- func (c *Client) GetFileTitle(ctx context.Context, filename string) (string, error)
- func (c *Client) GetFolderOptions(ctx context.Context, dirname string) (*FolderOptions, error)
- func (c *Client) GetHTTPStats(ctx context.Context, params *StatsParams) ([]HTTPStats, error)
- func (c *Client) GetPointsOfInterest(ctx context.Context, filename string) ([]PointOfInterest, error)
- func (c *Client) GetProductMeta(ctx context.Context, filename string) (*ProductMeta, error)
- func (c *Client) GetSpinViewsStats(ctx context.Context, params *StatsParams) ([]SpinViewStats, error)
- func (c *Client) GetStorageInfo(ctx context.Context) (*StorageInfo, error)
- func (c *Client) GetStorageStats(ctx context.Context, params *StatsParams) ([]StorageStats, error)
- func (c *Client) GetUserInfo(ctx context.Context, userID string) (*UserInfo, error)
- func (c *Client) GetZipStatus(ctx context.Context, jobID string) (*BatchZipResult, error)
- func (c *Client) IsConnected() bool
- func (c *Client) IterateFolderContents(ctx context.Context, dirname string) (<-chan FileInfo, <-chan error)
- func (c *Client) IterateSearchResults(ctx context.Context, params *SearchParams) (<-chan FileInfo, <-chan error)
- func (c *Client) MarkEventsSeen(ctx context.Context, eventIDs []string) error
- func (c *Client) ReadFolderContents(ctx context.Context, dirname string, continuation string) (*FolderContents, error)
- func (c *Client) RemoveFileTags(ctx context.Context, filename string, tags []string) error
- func (c *Client) RenameFile(ctx context.Context, params *RenameParams) error
- func (c *Client) ScrollSearch(ctx context.Context, scrollID string) (*SearchResult, error)
- func (c *Client) SearchEvents(ctx context.Context, params *EventSearchParams) ([]AccountEvent, error)
- func (c *Client) SearchFiles(ctx context.Context, params *SearchParams) (*SearchResult, error)
- func (c *Client) SetApprovalFlag(ctx context.Context, filename string, approved bool) error
- func (c *Client) SetFileDescription(ctx context.Context, filename, description string) error
- func (c *Client) SetFileMeta(ctx context.Context, filename string, meta *FileMeta) error
- func (c *Client) SetFileTitle(ctx context.Context, filename, title string) error
- func (c *Client) SetFolderOptions(ctx context.Context, dirname string, options *FolderOptions) error
- func (c *Client) SetPointOfInterest(ctx context.Context, filename string, poi *PointOfInterest) error
- func (c *Client) SetProductMeta(ctx context.Context, filename string, meta *ProductMeta) error
- func (c *Client) Spin2Video(ctx context.Context, params *SpinConvertParams) (string, error)
- func (c *Client) UpdateAccount(ctx context.Context, options *AccountUpdateOptions) error
- func (c *Client) UploadFile(ctx context.Context, targetPath string, content []byte, options *UploadOptions) error
- func (c *Client) UploadFileFromPath(ctx context.Context, targetPath, localPath string, options *UploadOptions) error
- func (c *Client) UploadFileFromReader(ctx context.Context, targetPath string, reader io.Reader, ...) error
- func (c *Client) Video2Spin(ctx context.Context, params *Video2SpinParams) (string, error)
- type ClientConfig
- type CopyParams
- type EventSearchParams
- type ExportSpinParams
- type FetchURLParams
- type FetchingOptions
- type FileInfo
- type FileMeta
- type FolderContents
- type FolderOptions
- type HTTPFetchingAuth
- type HTTPFetchingConfig
- type HTTPStats
- type JWTParams
- type JWTResponse
- type MinifyOptions
- type PlanPrice
- type PointOfInterest
- type ProductMeta
- type RateLimitInfo
- type RenameParams
- type SearchFilters
- type SearchParams
- type SearchResult
- type SortOptions
- type SpinConvertOptions
- type SpinConvertParams
- type SpinViewStats
- type StatsParams
- type StorageInfo
- type StorageStats
- type TokenResponse
- type UploadOptions
- type UserInfo
- type Video2SpinOptions
- type Video2SpinParams
Constants ¶
const ( // DefaultBaseURL is the default Sirv API base URL. DefaultBaseURL = "https://api.sirv.com" // DefaultTokenRefreshBuffer is the default seconds before token expiry to trigger refresh. DefaultTokenRefreshBuffer = 60 // DefaultTimeout is the default HTTP request timeout. DefaultTimeout = 30 * time.Second // DefaultMaxRetries is the default maximum number of retries for failed requests. DefaultMaxRetries = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"statusCode"`
ErrorCode string `json:"error,omitempty"`
Message string `json:"message"`
}
APIError represents an error returned by the Sirv API.
func GetAPIError ¶
GetAPIError returns the APIError if err is one, otherwise nil.
func NewAPIError ¶
NewAPIError creates a new API error.
type AccountEvent ¶
type AccountEvent struct {
ID string `json:"id"`
Module string `json:"module"`
Type string `json:"type"`
Level string `json:"level"`
Message string `json:"message"`
Filename string `json:"filename,omitempty"`
Timestamp string `json:"timestamp"`
Seen *bool `json:"seen,omitempty"`
}
AccountEvent represents an account event log entry.
type AccountInfo ¶
type AccountInfo struct {
Alias string `json:"alias"`
CdnURL string `json:"cdnURL"`
DateCreated string `json:"dateCreated,omitempty"`
Fetching *FetchingOptions `json:"fetching,omitempty"`
Minify *MinifyOptions `json:"minify,omitempty"`
Aliases map[string]*AliasConfig `json:"aliases,omitempty"`
FileSizeLimit int64 `json:"fileSizeLimit,omitempty"`
}
AccountInfo represents account information.
type AccountLimits ¶
type AccountLimits struct {
S3 *RateLimitInfo `json:"s3,omitempty"`
Rest *RateLimitInfo `json:"rest,omitempty"`
FTP *RateLimitInfo `json:"ftp,omitempty"`
}
AccountLimits represents API rate limits for different endpoint types.
type AccountUpdateOptions ¶
type AccountUpdateOptions struct {
Fetching *FetchingOptions `json:"fetching,omitempty"`
Minify *MinifyOptions `json:"minify,omitempty"`
Aliases []string `json:"aliases,omitempty"`
}
AccountUpdateOptions represents options for updating account settings.
type AccountUser ¶
type AccountUser struct {
UserID string `json:"userId"`
Email string `json:"email"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Role string `json:"role"`
DateCreated string `json:"dateCreated,omitempty"`
}
AccountUser represents account user information.
type AliasConfig ¶
type AliasConfig struct {
Prefix string `json:"prefix,omitempty"`
Cdn *bool `json:"cdn,omitempty"`
CustomDomain string `json:"customDomain,omitempty"`
}
AliasConfig represents alias configuration.
type BatchDeleteItemResult ¶
type BatchDeleteItemResult struct {
Filename string `json:"filename"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
BatchDeleteItemResult represents result for a single file in batch delete.
type BatchDeleteResult ¶
type BatchDeleteResult struct {
JobID string `json:"jobId,omitempty"`
Status string `json:"status,omitempty"`
Results []BatchDeleteItemResult `json:"results,omitempty"`
}
BatchDeleteResult represents batch delete operation result.
type BatchZipParams ¶
type BatchZipParams struct {
Filenames []string `json:"filenames"`
Filename string `json:"filename"`
}
BatchZipParams represents batch ZIP operation parameters.
type BatchZipResult ¶
type BatchZipResult struct {
JobID string `json:"jobId,omitempty"`
Status string `json:"status,omitempty"`
Filename string `json:"filename,omitempty"`
}
BatchZipResult represents batch ZIP operation result.
type BillingPlan ¶
type BillingPlan struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Period string `json:"period,omitempty"`
Storage int64 `json:"storage"`
DataTransferLimit *int64 `json:"dataTransferLimit,omitempty"`
Price *PlanPrice `json:"price,omitempty"`
DateActive string `json:"dateActive,omitempty"`
}
BillingPlan represents billing plan information.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Sirv REST API client.
func NewClient ¶
func NewClient(config ClientConfig) (*Client, error)
NewClient creates a new Sirv API client.
func (*Client) AddFileTags ¶
AddFileTags adds tags to file.
func (*Client) BatchDelete ¶
BatchDelete deletes multiple files/folders.
func (*Client) BatchZip ¶
func (c *Client) BatchZip(ctx context.Context, params *BatchZipParams) (*BatchZipResult, error)
BatchZip creates ZIP archive from multiple files.
func (*Client) Connect ¶
Connect authenticates and obtains a bearer token. expiresIn is optional - pass nil for default (1200 seconds/20 minutes). Valid range is 5-604800 seconds.
func (*Client) CopyFile ¶
func (c *Client) CopyFile(ctx context.Context, params *CopyParams) error
CopyFile copies a file.
func (*Client) CreateFolder ¶
CreateFolder creates a new folder.
func (*Client) DeleteFile ¶
DeleteFile deletes a file or empty folder.
func (*Client) DeletePointOfInterest ¶
DeletePointOfInterest deletes point of interest.
func (*Client) DownloadFile ¶
DownloadFile downloads a file and returns its content as bytes.
func (*Client) DownloadFileTo ¶
DownloadFileTo downloads a file to a local path.
func (*Client) ExportSpinToAmazon ¶
func (c *Client) ExportSpinToAmazon(ctx context.Context, params *ExportSpinParams) error
ExportSpinToAmazon exports spin to Amazon.
func (*Client) ExportSpinToGrainger ¶
func (c *Client) ExportSpinToGrainger(ctx context.Context, params *ExportSpinParams) error
ExportSpinToGrainger exports spin to Grainger.
func (*Client) ExportSpinToHomeDepot ¶
func (c *Client) ExportSpinToHomeDepot(ctx context.Context, params *ExportSpinParams) error
ExportSpinToHomeDepot exports spin to Home Depot.
func (*Client) ExportSpinToLowes ¶
func (c *Client) ExportSpinToLowes(ctx context.Context, params *ExportSpinParams) error
ExportSpinToLowes exports spin to Lowe's.
func (*Client) ExportSpinToWalmart ¶
func (c *Client) ExportSpinToWalmart(ctx context.Context, params *ExportSpinParams) error
ExportSpinToWalmart exports spin to Walmart.
func (*Client) FetchURL ¶
func (c *Client) FetchURL(ctx context.Context, params *FetchURLParams) error
FetchURL fetches file from external URL.
func (*Client) GenerateJWT ¶
GenerateJWT generates JWT protected URL.
func (*Client) GetAccessToken ¶
GetAccessToken returns the current token (useful for external integrations).
func (*Client) GetAccountInfo ¶
func (c *Client) GetAccountInfo(ctx context.Context) (*AccountInfo, error)
GetAccountInfo gets account information.
func (*Client) GetAccountLimits ¶
func (c *Client) GetAccountLimits(ctx context.Context) (*AccountLimits, error)
GetAccountLimits gets API rate limits.
func (*Client) GetAccountUsers ¶
func (c *Client) GetAccountUsers(ctx context.Context) ([]AccountUser, error)
GetAccountUsers gets all account users.
func (*Client) GetApprovalFlag ¶
GetApprovalFlag gets approval flag.
func (*Client) GetBatchDeleteStatus ¶
func (c *Client) GetBatchDeleteStatus(ctx context.Context, jobID string) (*BatchDeleteResult, error)
GetBatchDeleteStatus gets batch delete job status.
func (*Client) GetBillingPlan ¶
func (c *Client) GetBillingPlan(ctx context.Context) (*BillingPlan, error)
GetBillingPlan gets billing plan details.
func (*Client) GetFileDescription ¶
GetFileDescription gets file description.
func (*Client) GetFileInfo ¶
GetFileInfo gets file information.
func (*Client) GetFileMeta ¶
GetFileMeta gets all file metadata.
func (*Client) GetFileTags ¶
GetFileTags gets file tags.
func (*Client) GetFileTitle ¶
GetFileTitle gets file title.
func (*Client) GetFolderOptions ¶
GetFolderOptions gets folder options.
func (*Client) GetHTTPStats ¶
GetHTTPStats gets HTTP transfer statistics.
func (*Client) GetPointsOfInterest ¶
func (c *Client) GetPointsOfInterest(ctx context.Context, filename string) ([]PointOfInterest, error)
GetPointsOfInterest gets points of interest for a file.
func (*Client) GetProductMeta ¶
GetProductMeta gets product metadata.
func (*Client) GetSpinViewsStats ¶
func (c *Client) GetSpinViewsStats(ctx context.Context, params *StatsParams) ([]SpinViewStats, error)
GetSpinViewsStats gets spin views statistics (max 5-day range).
func (*Client) GetStorageInfo ¶
func (c *Client) GetStorageInfo(ctx context.Context) (*StorageInfo, error)
GetStorageInfo gets storage usage information.
func (*Client) GetStorageStats ¶
func (c *Client) GetStorageStats(ctx context.Context, params *StatsParams) ([]StorageStats, error)
GetStorageStats gets storage statistics.
func (*Client) GetUserInfo ¶
GetUserInfo gets user information. userID is optional - pass empty string to get current user.
func (*Client) GetZipStatus ¶
GetZipStatus gets ZIP job status.
func (*Client) IsConnected ¶
IsConnected checks if client is connected with a valid token.
func (*Client) IterateFolderContents ¶
func (c *Client) IterateFolderContents(ctx context.Context, dirname string) (<-chan FileInfo, <-chan error)
IterateFolderContents iterates through all items in a folder (handles pagination automatically). Returns a channel that yields FileInfo items.
func (*Client) IterateSearchResults ¶
func (c *Client) IterateSearchResults(ctx context.Context, params *SearchParams) (<-chan FileInfo, <-chan error)
IterateSearchResults iterates through all search results (handles pagination automatically). Returns a channel that yields FileInfo items.
func (*Client) MarkEventsSeen ¶
MarkEventsSeen marks events as seen.
func (*Client) ReadFolderContents ¶
func (c *Client) ReadFolderContents(ctx context.Context, dirname string, continuation string) (*FolderContents, error)
ReadFolderContents reads folder contents.
func (*Client) RemoveFileTags ¶
RemoveFileTags removes tags from file.
func (*Client) RenameFile ¶
func (c *Client) RenameFile(ctx context.Context, params *RenameParams) error
RenameFile renames or moves a file/folder.
func (*Client) ScrollSearch ¶
ScrollSearch continues paginated search.
func (*Client) SearchEvents ¶
func (c *Client) SearchEvents(ctx context.Context, params *EventSearchParams) ([]AccountEvent, error)
SearchEvents searches account events.
func (*Client) SearchFiles ¶
func (c *Client) SearchFiles(ctx context.Context, params *SearchParams) (*SearchResult, error)
SearchFiles searches files.
func (*Client) SetApprovalFlag ¶
SetApprovalFlag sets approval flag.
func (*Client) SetFileDescription ¶
SetFileDescription sets file description.
func (*Client) SetFileMeta ¶
SetFileMeta sets file metadata.
func (*Client) SetFileTitle ¶
SetFileTitle sets file title.
func (*Client) SetFolderOptions ¶
func (c *Client) SetFolderOptions(ctx context.Context, dirname string, options *FolderOptions) error
SetFolderOptions sets folder options.
func (*Client) SetPointOfInterest ¶
func (c *Client) SetPointOfInterest(ctx context.Context, filename string, poi *PointOfInterest) error
SetPointOfInterest sets point of interest.
func (*Client) SetProductMeta ¶
SetProductMeta sets product metadata.
func (*Client) Spin2Video ¶
Spin2Video converts spin to video.
func (*Client) UpdateAccount ¶
func (c *Client) UpdateAccount(ctx context.Context, options *AccountUpdateOptions) error
UpdateAccount updates account settings.
func (*Client) UploadFile ¶
func (c *Client) UploadFile(ctx context.Context, targetPath string, content []byte, options *UploadOptions) error
UploadFile uploads a file from bytes.
func (*Client) UploadFileFromPath ¶
func (c *Client) UploadFileFromPath(ctx context.Context, targetPath, localPath string, options *UploadOptions) error
UploadFileFromPath uploads a file from local path.
func (*Client) UploadFileFromReader ¶
func (c *Client) UploadFileFromReader(ctx context.Context, targetPath string, reader io.Reader, options *UploadOptions) error
UploadFileFromReader uploads a file from io.Reader.
func (*Client) Video2Spin ¶
Video2Spin converts video to spin.
type ClientConfig ¶
type ClientConfig struct {
// ClientID is your Sirv API client ID (required).
ClientID string
// ClientSecret is your Sirv API client secret (required).
ClientSecret string
// BaseURL is the base URL for API (default: https://api.sirv.com).
BaseURL string
// AutoRefreshToken enables automatic token refresh before expiry (default: true).
AutoRefreshToken *bool
// TokenRefreshBuffer is seconds before token expiry to trigger refresh (default: 60).
TokenRefreshBuffer int
// Timeout is the request timeout (default: 30s).
Timeout time.Duration
// MaxRetries is the maximum number of retries for failed requests (default: 3).
MaxRetries int
// HTTPClient allows using a custom HTTP client.
HTTPClient *http.Client
}
ClientConfig holds the configuration for the Sirv client.
type CopyParams ¶
CopyParams represents copy operation parameters.
type EventSearchParams ¶
type EventSearchParams struct {
Module string `json:"module,omitempty"`
Type string `json:"type,omitempty"`
Level string `json:"level,omitempty"`
Filename string `json:"filename,omitempty"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
}
EventSearchParams represents parameters for searching account events.
type ExportSpinParams ¶
type ExportSpinParams struct {
Filename string `json:"filename"`
ASIN string `json:"asin,omitempty"`
ProductID string `json:"productId,omitempty"`
}
ExportSpinParams represents spin export parameters.
type FetchURLParams ¶
type FetchURLParams struct {
URL string `json:"url"`
Filename string `json:"filename"`
Wait *bool `json:"wait,omitempty"`
}
FetchURLParams represents parameters for fetching file from URL.
type FetchingOptions ¶
type FetchingOptions struct {
Enabled *bool `json:"enabled,omitempty"`
Type string `json:"type,omitempty"`
HTTP *HTTPFetchingConfig `json:"http,omitempty"`
}
FetchingOptions represents HTTP fetching configuration.
type FileInfo ¶
type FileInfo struct {
Filename string `json:"filename"`
Dirname string `json:"dirname,omitempty"`
Basename string `json:"basename,omitempty"`
IsDirectory bool `json:"isDirectory"`
Size *int64 `json:"size,omitempty"`
Ctime string `json:"ctime,omitempty"`
Mtime string `json:"mtime,omitempty"`
ContentType string `json:"contentType,omitempty"`
Meta *FileMeta `json:"meta,omitempty"`
}
FileInfo represents file or folder information.
type FileMeta ¶
type FileMeta struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Approved *bool `json:"approved,omitempty"`
}
FileMeta represents file metadata.
type FolderContents ¶
type FolderContents struct {
Contents []FileInfo `json:"contents"`
Continuation string `json:"continuation,omitempty"`
}
FolderContents represents folder contents response.
type FolderOptions ¶
type FolderOptions struct {
ScanSpins *bool `json:"scanSpins,omitempty"`
AllowListing *bool `json:"allowListing,omitempty"`
}
FolderOptions represents folder options/settings.
type HTTPFetchingAuth ¶
type HTTPFetchingAuth struct {
Enabled bool `json:"enabled"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
HTTPFetchingAuth represents HTTP fetching authentication settings.
type HTTPFetchingConfig ¶
type HTTPFetchingConfig struct {
Auth *HTTPFetchingAuth `json:"auth,omitempty"`
URL string `json:"url,omitempty"`
}
HTTPFetchingConfig represents HTTP fetching configuration details.
type HTTPStats ¶
type HTTPStats struct {
Date string `json:"date"`
Transfer int64 `json:"transfer"`
Requests *int64 `json:"requests,omitempty"`
}
HTTPStats represents HTTP transfer statistics entry.
type JWTParams ¶
type JWTParams struct {
Filename string `json:"filename"`
ExpiresIn *int `json:"expiresIn,omitempty"`
SecureParams map[string]string `json:"secureParams,omitempty"`
}
JWTParams represents JWT generation parameters.
type JWTResponse ¶
JWTResponse represents JWT generation response.
type MinifyOptions ¶
type MinifyOptions struct {
Enabled *bool `json:"enabled,omitempty"`
}
MinifyOptions represents minification settings.
type PlanPrice ¶
type PlanPrice struct {
Month *float64 `json:"month,omitempty"`
Year *float64 `json:"year,omitempty"`
Quarter *float64 `json:"quarter,omitempty"`
}
PlanPrice represents plan price information.
type PointOfInterest ¶
type PointOfInterest struct {
Name string `json:"name"`
X float64 `json:"x"`
Y float64 `json:"y"`
Frame *int `json:"frame,omitempty"`
}
PointOfInterest represents a point of interest on a spin.
type ProductMeta ¶
type ProductMeta struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Brand string `json:"brand,omitempty"`
Category string `json:"category,omitempty"`
SKU string `json:"sku,omitempty"`
}
ProductMeta represents product-specific metadata.
type RateLimitInfo ¶
type RateLimitInfo struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset string `json:"reset,omitempty"`
Count int `json:"count"`
}
RateLimitInfo represents rate limit information for a specific endpoint type.
type RenameParams ¶
RenameParams represents rename/move operation parameters.
type SearchFilters ¶
type SearchFilters struct {
Dirname string `json:"dirname,omitempty"`
Filename string `json:"filename,omitempty"`
Basename string `json:"basename,omitempty"`
Extension interface{} `json:"extension,omitempty"` // string or []string
ContentType interface{} `json:"contentType,omitempty"` // string or []string
MinSize *int64 `json:"minSize,omitempty"`
MaxSize *int64 `json:"maxSize,omitempty"`
MinDate string `json:"minDate,omitempty"`
MaxDate string `json:"maxDate,omitempty"`
}
SearchFilters represents search filters.
type SearchParams ¶
type SearchParams struct {
Query string `json:"query,omitempty"`
From *int `json:"from,omitempty"`
Size *int `json:"size,omitempty"`
Sort *SortOptions `json:"sort,omitempty"`
Filters *SearchFilters `json:"filters,omitempty"`
}
SearchParams represents parameters for file search.
type SearchResult ¶
type SearchResult struct {
Hits []FileInfo `json:"hits"`
Total int64 `json:"total"`
ScrollID string `json:"scrollId,omitempty"`
}
SearchResult represents search results.
type SortOptions ¶
type SortOptions struct {
Field string `json:"field"`
Order string `json:"order"` // "asc" or "desc"
}
SortOptions represents sort options for search.
type SpinConvertOptions ¶
type SpinConvertOptions struct {
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
Loops *int `json:"loops,omitempty"`
Format string `json:"format,omitempty"`
}
SpinConvertOptions represents spin conversion options.
type SpinConvertParams ¶
type SpinConvertParams struct {
Filename string `json:"filename"`
Options *SpinConvertOptions `json:"options,omitempty"`
}
SpinConvertParams represents spin to video conversion parameters.
type SpinViewStats ¶
type SpinViewStats struct {
Date string `json:"date"`
Views int64 `json:"views"`
Spins *int64 `json:"spins,omitempty"`
Zooms *int64 `json:"zooms,omitempty"`
Fullscreens *int64 `json:"fullscreens,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Country string `json:"country,omitempty"`
}
SpinViewStats represents spin view statistics entry.
type StatsParams ¶
StatsParams represents date range parameters for statistics.
type StorageInfo ¶
type StorageInfo struct {
Allowance int64 `json:"allowance"`
Used int64 `json:"used"`
Files int64 `json:"files"`
Burstable *int64 `json:"burstable,omitempty"`
}
StorageInfo represents storage usage information.
type StorageStats ¶
type StorageStats struct {
Date string `json:"date"`
Storage int64 `json:"storage"`
Files *int64 `json:"files,omitempty"`
}
StorageStats represents storage statistics entry.
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
ExpiresIn int `json:"expiresIn"`
Scope []string `json:"scope"`
}
TokenResponse represents the authentication token response.
type UploadOptions ¶
type UploadOptions struct {
Filename string `json:"filename,omitempty"`
ContentType string `json:"contentType,omitempty"`
}
UploadOptions represents upload options.
type UserInfo ¶
type UserInfo struct {
UserID string `json:"userId"`
Email string `json:"email"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
DateCreated string `json:"dateCreated,omitempty"`
S3Key string `json:"s3Key,omitempty"`
S3Secret string `json:"s3Secret,omitempty"`
}
UserInfo represents user information.
type Video2SpinOptions ¶
type Video2SpinOptions struct {
Frames *int `json:"frames,omitempty"`
Start *float64 `json:"start,omitempty"`
Duration *float64 `json:"duration,omitempty"`
}
Video2SpinOptions represents video to spin conversion options.
type Video2SpinParams ¶
type Video2SpinParams struct {
Filename string `json:"filename"`
TargetFilename string `json:"targetFilename,omitempty"`
Options *Video2SpinOptions `json:"options,omitempty"`
}
Video2SpinParams represents video to spin conversion parameters.