service

package
v0.0.0-...-04b3042 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTatoebaLinkAlreadyExists = errors.New("tatoebaLink already exists")
View Source
var ErrTatoebaLinkSourceNotFound = errors.New("tatoebaLink source not found")
View Source
var ErrTatoebaSentenceAlreadyExists = errors.New("tatoebaSentence already exists")
View Source
var ErrTatoebaSentenceNotFound = errors.New("tatoebaSentence not found")

Functions

This section is empty.

Types

type RepositoryFactory

type RepositoryFactory interface {
	NewTatoebaLinkRepository(ctx context.Context) TatoebaLinkRepository

	NewTatoebaSentenceRepository(ctx context.Context) TatoebaSentenceRepository
}

type RepositoryFactoryFunc

type RepositoryFactoryFunc func(ctx context.Context, db *gorm.DB) (RepositoryFactory, error)

type TatoebaLinkAddParameter

type TatoebaLinkAddParameter interface {
	GetFrom() int
	GetTo() int
}

func NewTatoebaLinkAddParameter

func NewTatoebaLinkAddParameter(from, to int) (TatoebaLinkAddParameter, error)

type TatoebaLinkAddParameterIterator

type TatoebaLinkAddParameterIterator interface {
	Next(ctx context.Context) (TatoebaLinkAddParameter, error)
}

type TatoebaLinkRepository

type TatoebaLinkRepository interface {
	Add(ctx context.Context, param TatoebaLinkAddParameter) error
}

type TatoebaSentence

type TatoebaSentence interface {
	GetSentenceNumber() int
	GetLang3() domain.Lang3
	GetText() string
	GetAuthor() string
	GetUpdatedAt() time.Time
}

func NewTatoebaSentence

func NewTatoebaSentence(sentenceNumber int, lang3 domain.Lang3, text, author string, updatedAt time.Time) (TatoebaSentence, error)

type TatoebaSentenceAddParameter

type TatoebaSentenceAddParameter interface {
	GetSentenceNumber() int
	GetLang3() domain.Lang3
	GetText() string
	GetAuthor() string
	GetUpdatedAt() time.Time
}

func NewTatoebaSentenceAddParameter

func NewTatoebaSentenceAddParameter(sentenceNumber int, lang3 domain.Lang3, text, author string, updatedAt time.Time) (TatoebaSentenceAddParameter, error)

type TatoebaSentenceAddParameterIterator

type TatoebaSentenceAddParameterIterator interface {
	Next(ctx context.Context) (TatoebaSentenceAddParameter, error)
}

type TatoebaSentencePair

type TatoebaSentencePair interface {
	GetSrc() TatoebaSentence
	GetDst() TatoebaSentence
}

func NewTatoebaSentencePair

func NewTatoebaSentencePair(src, dst TatoebaSentence) (TatoebaSentencePair, error)

type TatoebaSentencePairSearchResult

type TatoebaSentencePairSearchResult interface {
	GetTotalCount() int
	GetResults() []TatoebaSentencePair
}

func NewTatoebaSentencePairSearchResult

func NewTatoebaSentencePairSearchResult(totalCount int, results []TatoebaSentencePair) TatoebaSentencePairSearchResult

type TatoebaSentenceRepository

type TatoebaSentenceRepository interface {
	FindTatoebaSentencePairs(ctx context.Context, param TatoebaSentenceSearchCondition) (TatoebaSentencePairSearchResult, error)

	FindTatoebaSentenceBySentenceNumber(ctx context.Context, sentenceNumber int) (TatoebaSentence, error)

	Add(ctx context.Context, param TatoebaSentenceAddParameter) error

	ContainsSentenceBySentenceNumber(ctx context.Context, sentenceNumber int) (bool, error)
}

type TatoebaSentenceSearchCondition

type TatoebaSentenceSearchCondition interface {
	GetPageNo() int
	GetPageSize() int
	GetKeyword() string
	IsRandom() bool
}

func NewTatoebaSentenceSearchCondition

func NewTatoebaSentenceSearchCondition(pageNo, pageSize int, keyword string, random bool) (TatoebaSentenceSearchCondition, error)

type Transaction

type Transaction interface {
	Do(ctx context.Context, fn func(rf RepositoryFactory) error) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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