model

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: MIT Imports: 13 Imported by: 6

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 (c *ProjectConfig) FilePath(filename string) string

func (*ProjectConfig) FileURI

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

func (*ProjectConfig) LocaleFor

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

func (*ProjectConfig) Merge

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

func (*ProjectConfig) SaveAllFiles

func (c *ProjectConfig) SaveAllFiles(files []*File, resource *ProjectResource)

func (*ProjectConfig) SaveFile

func (c *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) LimitFiles

func (r *ProjectResource) LimitFiles(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