Documentation
¶
Index ¶
- type BaseResource
- type Client
- func (c *Client) AddLanguage(lang string, coord ...string) (err error)
- func (c *Client) CreateResource(u UploadResourceRequest) (r Response, err error)
- func (c *Client) DeleteResource(slug string) (err error)
- func (c *Client) GetStrings(slug, lang string) (r []ResourceString, err error)
- func (c *Client) GetTranslation(slug, lang string) (r map[string]interface{}, err error)
- func (c *Client) GetTranslationFile(slug, lang string) (b []byte, err error)
- func (c *Client) Languages() (langs []Language, err error)
- func (c *Client) ListResources() (r []Resource, err error)
- func (c *Client) Project() (p Project, err error)
- func (c *Client) ResourceDetail(slug string) (r ResourceDetail, err error)
- func (c *Client) SetStringTags(slug, hash string, tags ...string) (err error)
- func (c *Client) SetTicker(t *time.Ticker)
- func (c *Client) TranslateString(slug, hash, lang, value string) (err error)
- func (c *Client) UpdateName(slug, name string) (err error)
- func (c *Client) UpdateResource(slug, content string) (r Response, err error)
- func (c *Client) UpdateTranslation(slug, lang, content string) (r Response, err error)
- type ErrResponse
- type Language
- type Project
- type Resource
- type ResourceDetail
- type ResourceString
- type Response
- type Stat
- type UploadResourceRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResource ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateResource ¶
func (c *Client) CreateResource(u UploadResourceRequest) (r Response, err error)
func (*Client) DeleteResource ¶
func (*Client) GetStrings ¶
func (c *Client) GetStrings(slug, lang string) (r []ResourceString, err error)
func (*Client) GetTranslation ¶
func (*Client) GetTranslationFile ¶
func (*Client) ListResources ¶
func (*Client) ResourceDetail ¶
func (c *Client) ResourceDetail(slug string) (r ResourceDetail, err error)
func (*Client) SetStringTags ¶
func (*Client) TranslateString ¶
func (*Client) UpdateName ¶
func (*Client) UpdateResource ¶
type ErrResponse ¶
type ErrResponse struct { ErrorCode string `json:"error_code,omitempty"` Detail string `json:"detail,omitempty"` Priority []string `json:"priority,omitempty"` }
func (ErrResponse) Error ¶
func (e ErrResponse) Error() string
type Project ¶
type Project struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Tags []interface{} `json:"tags"` Languages []struct { Code string `json:"code"` Name string `json:"name"` } `json:"languages"` TotalResources int `json:"total_resources"` SourceLanguage struct { Code string `json:"code"` Name string `json:"name"` } `json:"source_language"` Type string `json:"type"` LogoURL string `json:"logo_url"` Description string `json:"description"` Stringcount int `json:"stringcount"` Wordcount int `json:"wordcount"` LongDescription string `json:"long_description"` WebsiteURL string `json:"website_url"` Maintainers []string `json:"maintainers"` Created time.Time `json:"created"` LastUpdate time.Time `json:"last_update"` Private bool `json:"private"` RepositoryURL string `json:"repository_url"` Archived bool `json:"archived"` Team struct { Name string `json:"name"` ID int `json:"id"` } `json:"team"` Stats map[string]map[string]Stat `json:"stats"` }
type Resource ¶
type Resource struct { BaseResource SourceLanguage string `json:"source_language_code"` }
type ResourceDetail ¶
type ResourceString ¶
type ResourceString struct { Comment string `json:"comment"` Context string `json:"context"` Key string `json:"key"` StringHash string `json:"string_hash"` Reviewed bool `json:"reviewed"` Pluralized bool `json:"pluralized"` SourceString string `json:"source_string"` Translation string `json:"translation"` }
type Response ¶
type Response struct { Added int `json:"strings_added"` Updated int `json:"strings_updated"` Deleted int `json:"strings_delete"` }
func (*Response) UnmarshalJSON ¶
type UploadResourceRequest ¶
type UploadResourceRequest struct { BaseResource Content string `json:"content"` AcceptTranslations bool `json:"accept_translations"` }
Click to show internal directories.
Click to hide internal directories.