Documentation
¶
Index ¶
- func WithBaseURL(baseURL string) func(*Client)
- func WithCustomHttpClient(httpClient *http.Client) func(*Client)
- type CSS
- type Client
- func (c *Client) GetPage(ctx context.Context, pageID string) (Page, error)
- func (c *Client) GetPageExport(ctx context.Context, pageID string) (PageExport, error)
- func (c *Client) GetPageFull(ctx context.Context, pageID string) (PageFull, error)
- func (c *Client) GetPageFullExport(ctx context.Context, pageID string) (PageExport, error)
- func (c *Client) GetProjectInfo(ctx context.Context, projectID string) (Project, error)
- func (c *Client) GetProjectPages(ctx context.Context, projectID string) ([]Page, error)
- func (c *Client) GetProjectsList(ctx context.Context) ([]Project, error)
- type Config
- type DateTime
- type Image
- type JS
- type Page
- type PageExport
- type PageFull
- type Project
- type ProjectInfo
- type TildaError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBaseURL ¶
WithBaseURL option allows to set custom base url (if you use proxy, for example)
func WithCustomHttpClient ¶
WithCustomHttpClient option allows to set custom http client
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetPageExport ¶
GetPageExport returns detailed page information for export with body HTML code
func (*Client) GetPageFull ¶
GetPageFull returns detailed page information without images, js and css but with full HTML code
func (*Client) GetPageFullExport ¶
GetPageFullExport returns detailed page information for export with full HTML code
func (*Client) GetProjectInfo ¶
GetProjectInfo returns detailed project information
func (*Client) GetProjectPages ¶
GetProjectPages returns the list of pages for the project
type DateTime ¶
DateTime is a custom type for time.Time that allows to unmarshal JSON with a specific format
func (*DateTime) UnmarshalJSON ¶
type Page ¶
type Page struct {
ID string `json:"id"`
ProjectID string `json:"projectid"`
Title string `json:"title"`
Description string `json:"descr"`
Img string `json:"img"`
FeatureImg string `json:"featureimg"`
Alias string `json:"alias"`
Date DateTime `json:"date"`
Sort int `json:"sort,string"`
Published int `json:"published,string"`
HTML string `json:"html"`
Filename string `json:"filename"`
JS []string `json:"js"`
CSS []string `json:"css"`
}
Page represents information about page with body HTML code
type PageExport ¶
type PageExport struct {
ID string `json:"id"`
ProjectID string `json:"projectid"`
Date DateTime `json:"date"`
Title string `json:"title"`
Description string `json:"descr"`
Img string `json:"img"`
Sort int `json:"sort,string"`
Published int `json:"published,string"`
FeatureImg string `json:"featureimg"`
Alias string `json:"alias"`
Filename string `json:"filename"`
ExportJSPath string `json:"export_jspath"`
ExportCSSPath string `json:"export_csspath"`
ExportImgPath string `json:"export_imgpath"`
ExportBasePath string `json:"export_basepath"`
ProjectAlias string `json:"project_alias"`
PageAlias string `json:"page_alias"`
ProjectDomain string `json:"project_domain"`
HTML string `json:"html"`
Images []Image `json:"images"`
JS []JS `json:"js"`
CSS []CSS `json:"css"`
}
PageExport represents information about page for export
type PageFull ¶
type PageFull struct {
ID string `json:"id"`
ProjectID string `json:"projectid"`
Title string `json:"title"`
Description string `json:"descr"`
Img string `json:"img"`
FeatureImg string `json:"featureimg"`
Alias string `json:"alias"`
Date DateTime `json:"date"`
Sort int `json:"sort,string"`
Published int `json:"published,string"`
HTML string `json:"html"`
Filename string `json:"filename"`
}
PageFull represents information about page without images, js and css but with full HTML code
type Project ¶
type Project struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"descr"`
}
Project represents short information about project in the projects list
type ProjectInfo ¶
type ProjectInfo struct {
ID string `json:"id"`
UserID string `json:"userid"`
Date time.Time `json:"date"`
Title string `json:"title"`
Description string `json:"descr"`
Img string `json:"img"`
Sort string `json:"sort"`
Alias string `json:"alias"`
IndexpageID string `json:"indexpageid"`
HeaderpageID string `json:"headerpageid"`
HeadlineFont string `json:"headlinefont"`
TextFont string `json:"textfont"`
HeadlineColor string `json:"headlinecolor"`
TextColor string `json:"textcolor"`
LinkColor string `json:"linkcolor"`
LinkFontWeight string `json:"linkfontweight"`
LinkLineColor string `json:"linklinecolor"`
LinkLineHeight string `json:"linklineheight"`
LineColor string `json:"linecolor"`
BgColor string `json:"bgcolor"`
GoogleAnalyticsID string `json:"googleanalyticsid"`
GoogleTmID string `json:"googletmid"`
CustomDomain string `json:"customdomain"`
URL string `json:"url"`
IsExample string `json:"isexample"`
TextFontSize string `json:"textfontsize"`
TextFontWeight string `json:"textfontweight"`
HeadlineFontWeight string `json:"headlinefontweight"`
NoSearch string `json:"nosearch"`
YandexMetrikaID string `json:"yandexmetrikaid"`
ExportImgPath string `json:"export_imgpath"`
ExportCssPath string `json:"export_csspath"`
ExportJsPath string `json:"export_jspath"`
ExportBasePath string `json:"export_basepath"`
ViewLogin string `json:"viewlogin"`
ViewPassword string `json:"viewpassword"`
ViewIPs string `json:"viewips"`
Copyright string `json:"copyright"`
Headcode string `json:"headcode"`
UserPayment string `json:"userpayment"`
FormsKey string `json:"formskey"`
InfoType string `json:"info_type"`
InfoTags string `json:"info_tags"`
Page404ID string `json:"page404id"`
MyfontsJSON string `json:"myfonts_json"`
IsEmail string `json:"is_email"`
Kind string `json:"kind"`
Blocked string `json:"blocked"`
Trash string `json:"trash"`
CntFolders string `json:"cnt_folders"`
CntCollabs string `json:"cnt_collabs"`
Collabs string `json:"collabs"`
DesignerIDn string `json:"designeridn"`
Changed string `json:"changed"`
Images []Image `json:"images"`
}
ProjectInfo represents information about project
type TildaError ¶
type TildaError struct {
HttpCode int // HTTP status code (https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
Url string // URL of Tilda endpoint associated with callable function
Body string // Raw body of response
Err error // Error
}
TildaError represents information about errors