data

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Noun is a noun placeholder.
	Noun = 1
	// Verb is a verb placeholder.
	Verb = 2
	// Adjective is an adjective placeholder.
	Adjective = 3
	// Adverb is an adverb placeholder.
	Adverb = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides all actions with the database.

func New

func New() *Service

New is a Service's constructor.

func (*Service) Gen

func (s *Service) Gen(l int, c int, i int) (string, error)

Gen returns an i-th word with the length l in category c.

func (*Service) Init

func (s *Service) Init(cfg *config.DBConfig) error

Init initialize the database connection.

func (*Service) Len

func (s *Service) Len(l int, c int) (int, error)

Len returns the number of words with the length l in category c.

func (*Service) Stop

func (s *Service) Stop() error

Stop closes the database connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL