dao

package
v0.0.0-...-048cda6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB = connectDB()

Functions

This section is empty.

Types

type SentenceDao

type SentenceDao struct {
}

func (*SentenceDao) CreateSentence

func (d *SentenceDao) CreateSentence(sentence *model.Sentence) *model.Sentence

create a new sentence

func (*SentenceDao) GetSentence

func (d *SentenceDao) GetSentence(id string) *model.Sentence

GetSentence load sentence from db

func (*SentenceDao) GetSentenceByContentLang

func (d *SentenceDao) GetSentenceByContentLang(
	sentence *model.Sentence,
) *model.Sentence

func (*SentenceDao) GetSentences

func (d *SentenceDao) GetSentences() *model.Sentences

GetSentences load all sentences from db

func (*SentenceDao) GetSentencesByXPath

func (d *SentenceDao) GetSentencesByXPath(xpath string) *model.Sentences

GetSentences load all sentences from db matching a given XPath

func (*SentenceDao) GetSentencesByXPathFrom

func (d *SentenceDao) GetSentencesByXPathFrom(
	xpath string,
	startingFromID string,
) *model.Sentences

Paginated version of GetSentencesByXPath

func (*SentenceDao) GetSentencesFrom

func (d *SentenceDao) GetSentencesFrom(startingFromID string) *model.Sentences

func (*SentenceDao) GetTranslationSentences

func (d *SentenceDao) GetTranslationSentences(sourceId string) *map[string]model.Sentence

Load translation sentences

func (*SentenceDao) SetStructure

func (d *SentenceDao) SetStructure(
	id string,
	sentence *model.Sentence,
) (*model.Sentence, error)

func (*SentenceDao) UpdateSentence

func (d *SentenceDao) UpdateSentence(
	id string,
	sentence *model.Sentence,
) (*model.Sentence, error)

type TranslationDao

type TranslationDao struct {
}

func (*TranslationDao) AddAlignments

func (d *TranslationDao) AddAlignments(
	id string,
	translation *model.Translation,
) (*model.Translation, error)

add alignments data to an existing translation

func (*TranslationDao) CreateTranslation

func (d *TranslationDao) CreateTranslation(
	translation *model.Translation,
) *model.Translation

create a new translation

func (*TranslationDao) GetTranslation

func (d *TranslationDao) GetTranslation(id string) *model.Translation

GetTranslation load translation from db

func (*TranslationDao) GetTranslationBySourceDestId

func (d *TranslationDao) GetTranslationBySourceDestId(
	translation *model.Translation,
) *model.Translation

Get translation by source id and dest id

func (*TranslationDao) GetTranslations

func (d *TranslationDao) GetTranslations() *model.Translations

GetTranslations load all translations from db

Jump to

Keyboard shortcuts

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