repository

package
v0.0.0-...-fd3f659 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Common errors

Functions

This section is empty.

Types

type GroupRepository

type GroupRepository interface {
	FindTexts(ctx *context.Context, groupID, language string) ([]models.TranslatedText, error)
	Save(ctx *context.Context, group models.TextGroup) error
	AddTextToGroup(ctx *context.Context, textKey, groupID string) error
}

GroupRepository storage interface for translated texts.

func NewGroupRepository

func NewGroupRepository(db *sql.DB) GroupRepository

NewGroupRepository creates a new GroupRepository using the default implementation.

type LanguageRepository

type LanguageRepository interface {
	Find(ctx *context.Context, language string) (models.Language, error)
	Save(ctx *context.Context, language string) error
}

LanguageRepository storage interface for languages.

func NewLanguageRepository

func NewLanguageRepository(db *sql.DB) LanguageRepository

NewLanguageRepository creates a new LanguageRepository using the default implementation.

type TextRepository

type TextRepository interface {
	Find(ctx *context.Context, key, language string) (models.TranslatedText, error)
	Save(ctx *context.Context, text models.TranslatedText) error
}

TextRepository storage interface for translated texts.

func NewTextRepository

func NewTextRepository(db *sql.DB) TextRepository

NewTextRepository creates a new TextRepository using the default implementation.

Jump to

Keyboard shortcuts

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