model

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2016 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DirectivePrefix = "smartling."

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	AccessToken  string `json:"accessToken" yaml:"AccessToken,omitempty"`
	RefreshToken string `json:"refreshToken" yaml:"-"`
}

type DirectiveMap

type DirectiveMap map[string]string

func (DirectiveMap) WithPrefix

func (d DirectiveMap) WithPrefix() map[string]string

type File

type File struct {
	Path     string
	Content  []byte
	LocaleID string
}

type FileStats

type FileStats struct {
	OverWritten bool   `json:"overWritten"`
	StringCount uint64 `json:"stringCount"`
	WordCount   uint64 `json:"wordCount"`
}

type Project

type Project struct {
	ID    string `yaml:"ProjectId,omitempty"`
	Alias string `yaml:"ProjectAlias,omitempty"`
}

type ProjectConfig

type ProjectConfig struct {
	UserToken `yaml:",inline"`
	Project   `yaml:",inline"`
	AuthToken `yaml:",inline"`
	Resources []ProjectResource `yaml:"Files,omitempty"`
	Locales   map[string]string `yaml:"Locales,omitempty"`
}

func (*ProjectConfig) FilePath

func (p *ProjectConfig) FilePath(filename string) string

func (*ProjectConfig) FileURI

func (p *ProjectConfig) FileURI(filename string) string

func (*ProjectConfig) LocaleFor

func (p *ProjectConfig) LocaleFor(localeID string) string

func (*ProjectConfig) Merge

func (c *ProjectConfig) Merge(delta *ProjectConfig) error

func (*ProjectConfig) SaveFile

func (p *ProjectConfig) SaveFile(file *File, resource *ProjectResource) error

type ProjectResource

type ProjectResource struct {
	Type             string       `yaml:"Type"`
	PathGlob         string       `yaml:"PathGlob"`
	PathExpression   string       `yaml:"PathExpression"`
	PathExclude      []string     `yaml:"PathExclude,omitempty"`
	AuthorizeContent bool         `yaml:"AuthorizeContent"`
	Directives       DirectiveMap `yaml:"Directives,omitempty"`
}

func (*ProjectResource) Files

func (r *ProjectResource) Files() []string

func (*ProjectResource) PartialFiles added in v0.3.0

func (r *ProjectResource) PartialFiles(limit int) [][]string

func (*ProjectResource) PathFor

func (r *ProjectResource) PathFor(filename string, locale string) (string, error)

type UserToken

type UserToken struct {
	ID     string `json:"userIdentifier" yaml:"UserId,omitempty"`
	Secret string `json:"userSecret" yaml:"UserSecret,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL