domain

package
v0.0.0-...-128b944 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListWordsParams

type ListWordsParams struct {
	IDs []int
}

ListWordsParams holds a list of attributes that words can be filtered by.

type Word

type Word struct {
	ID   int
	Word string
}

Word holds the attributes of a word.

type WordRepository

type WordRepository interface {
	AddWord(ctx context.Context, word string) (*Word, error)
	ListWords(ctx context.Context, params ListWordsParams) ([]Word, error)
	RandomWord(ctx context.Context) (*Word, error)

	Close() error
}

WordRepository abstracts away the storage adapter.

type WordSearchRepository

type WordSearchRepository interface {
	IndexWord(ctx context.Context, word Word) error
	SearchWordsByPrefix(ctx context.Context, prefix string) ([]int, error)

	Close() error
}

WordSearchRepository abstracts away the search adapter.

Jump to

Keyboard shortcuts

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