replace

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySysDict

func ApplySysDict(msg string) string

Types

type DbController

type DbController interface {
	Add(dict *UserDictInput) error
	Delete(dictId uint) (Dict, error)
	ApplyUserDict(msg string) (string, error)
	SetGuildId(guildId string)
	Dump(limits uint) ([]Dict, error)
	DumpAtoB(from, to uint) ([]Dict, error)
}

type Dict

type Dict struct {
	Props
	UserDictInput
}

type Dicts

type Dicts []Dict

func (*Dicts) GetStringSlice

func (ds *Dicts) GetStringSlice() []string

type Props

type Props struct {
	ID        uint      `db:"id, primarykey, autoincrement"`
	CreatedAt time.Time `db:"created_at, notnull"`
	UpdatedAt time.Time `db:"updated_at, notnull"`
}

type Replacer

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

func NewReplacer

func NewReplacer(db *sql.DB, dialect gorp.Dialect) (*Replacer, error)

func (*Replacer) Add

func (rs *Replacer) Add(dict *UserDictInput) error

func (*Replacer) ApplyUserDict

func (rs *Replacer) ApplyUserDict(msg string) (string, error)

func (*Replacer) Delete

func (rs *Replacer) Delete(dictId uint) (Dict, error)

func (*Replacer) Dump

func (rs *Replacer) Dump(limit uint) ([]Dict, error)

func (*Replacer) DumpAtoB

func (rs *Replacer) DumpAtoB(from, to uint) ([]Dict, error)

func (*Replacer) SetGuildId

func (rs *Replacer) SetGuildId(guildId string)

type UserDictInput

type UserDictInput struct {
	Word          string `db:"word, notnull"`
	Yomi          string `db:"yomi, notnull"`
	ChangedUserId string `db:"changed_user_id, notnull"`
	GuildId       string `db:"guild_id, notnull"`
}

Jump to

Keyboard shortcuts

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