Documentation ¶
Overview ¶
Package onesky is go utils for working with OneSky translation service Copyright (c) 2015 Sebastian Czoch <sebastian@czoch.eu>. All rights reserved. Use of this source code is governed by a GNU v2 license found in the LICENSE file.
Index ¶
- Constants
- type Client
- func (c *Client) DeleteFile(fileName string) error
- func (c *Client) DownloadFile(fileName, locale string) (string, error)
- func (c *Client) GetLanguages() ([]Language, error)
- func (c *Client) GetTranslationsStatus(fileName, locale string) (TranslationsStatus, error)
- func (c *Client) ImportTask(importID int64) (TaskData, error)
- func (c *Client) ImportTasks(params map[string]interface{}) ([]TaskData, error)
- func (c *Client) ListFiles(page, perPage int) ([]FileData, error)
- func (c *Client) UploadFile(file, fileFormat, locale string, keepStrings bool) (UploadData, error)
- type FileData
- type ImportTaskResponse
- type ImportTasksResponse
- type Language
- type LastImport
- type TaskData
- type TaskFile
- type TranslationsStatus
- type UploadData
- type UploadResponse
Constants ¶
const APIAddress = "https://platform.api.onesky.io"
APIAddress is https address to OneSky API
const APIVersion = "1"
APIVersion is OneSky API version which will be used
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is basics struct for this package contains Secret, APIKey and ProjectID which is needed to authorize in OneSky service
func (*Client) DeleteFile ¶
DeleteFile is method on Client struct which remove file from OneSky service
func (*Client) DownloadFile ¶
DownloadFile is method on Client struct which download form OneSky service choosen file as string
func (*Client) GetLanguages ¶
GetLanguages is method on Client struct which download from OneSky service information about available languages in project
func (*Client) GetTranslationsStatus ¶
func (c *Client) GetTranslationsStatus(fileName, locale string) (TranslationsStatus, error)
GetTranslationsStatus returns information about a project's translation status
func (*Client) ImportTask ¶
ImportTask : Show an import task. Parameters: import_id
func (*Client) ImportTasks ¶
ImportTasks : List import tasks. Parameters: page: 1, per_page: 50, status: [all|completed|in-progress|failed] tasks, err := onesky.ImportTasks(map[string]interface{}{"per_page": 50, "status": "in-progress"})
func (*Client) ListFiles ¶
ListFiles is method on Client struct which download form OneSky service informations about uploaded files
func (*Client) UploadFile ¶
func (c *Client) UploadFile(file, fileFormat, locale string, keepStrings bool) (UploadData, error)
UploadFile is method on Client struct which upload file to OneSky service
type FileData ¶
type FileData struct { Name string `json:"name"` FileName string `json:"file_name"` StringCount int `json:"string_count"` LastImport LastImport `json:"last_import"` UpoladedAt string `json:"uploaded_at"` UpoladedAtTimestamp int `json:"uploaded_at_timestamp"` }
FileData is a struct which contains informations about file uploaded to OneSky service
type ImportTaskResponse ¶
type ImportTaskResponse struct {
Data TaskData `json:"data"`
}
ImportTaskResponse is a struct which contains informations about the response from show an import task API
type ImportTasksResponse ¶
type ImportTasksResponse struct {
Data []TaskData `json:"data"`
}
ImportTasksResponse is a struct which contains informations about the response from list import tasks API
type Language ¶
type Language struct { Code string `json:"code"` EnglishName string `json:"english_name"` LocalName string `json:"local_name"` CustomLocale string `json:"custom_locale"` Locale string `json:"locale"` Region string `json:"region"` TranslationProgress string `json:"translation_progress"` }
Language is a struct which contains informations about locale
type LastImport ¶
LastImport is a struct which contains informations about last upload
type TaskData ¶
type TaskData struct { ID int64 OriginalID interface{} `json:"id"` File TaskFile `json:"file"` StringCount int `json:"string_count"` WordCount int `json:"word_count"` Status string `json:"status"` CreateddAt string `json:"created_at"` CreateddAtTimestamp int `json:"created_at_timestamp"` }
TaskData is a struct which contains informations about import task
type TaskFile ¶
type TaskFile struct { Name string `json:"name"` Format string `json:"format"` Locale Language `json:"locale"` }
TaskFile is a struct which contains informations about file of import task
type TranslationsStatus ¶
type TranslationsStatus struct { FileName string `json:"file_name"` Locale Language `json:"locale"` Progress string `json:"progress"` StringCount int64 `json:"string_count"` WordCount int64 `json:"word_count"` }
TranslationsStatus is a struct which contains information about a project's translation status
type UploadData ¶
type UploadData struct { Name string `json:"name"` Format string `json:"format"` Language Language `json:"language"` Import TaskData `json:"import"` }
UploadData is a struct which contains informations about uploaded file
type UploadResponse ¶
type UploadResponse struct {
Data UploadData `json:"data"`
}
UploadResponse is a struct which contains informations about the response from upload file API
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/github.com/jarcoal/httpmock
HTTPmock provides tools for mocking HTTP responses.
|
HTTPmock provides tools for mocking HTTP responses. |
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
|
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. |