bd

package
v0.0.0-...-eb4ed60 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ListID int
	Name   string
	UserID int
}

type Chat

type Chat struct {
	ChatID int64
	Title  string
}

type DB

type DB struct {
	DB *gorm.DB
}

func InitBD

func InitBD(dbType, path string) (DB, error)

func (DB) AddIfNotExistDefaultChat

func (C DB) AddIfNotExistDefaultChat()

func (DB) AddIfNotExistDefaultWelcome

func (C DB) AddIfNotExistDefaultWelcome()

WELCOME

func (DB) AddIfNotExistRules

func (C DB) AddIfNotExistRules()

RULES

func (DB) AddOrEditChat

func (C DB) AddOrEditChat(chat Chat)

func (DB) AddOrEditRules

func (C DB) AddOrEditRules(chatID int64, title, rule string)

func (DB) AddOrEditUsers

func (C DB) AddOrEditUsers(userID int64, name string, w int)

func (DB) AddOrEditWelcome

func (C DB) AddOrEditWelcome(chatID int64, rule string)

func (DB) GetChats

func (C DB) GetChats() []Chat

func (DB) GetName

func (C DB) GetName(userID int64) string

func (DB) GetRules

func (C DB) GetRules(chatID int64) string

func (DB) GetTitle

func (C DB) GetTitle(chatID int64) string

func (DB) GetWarns

func (C DB) GetWarns(userID int64) int

func (DB) GetWelcome

func (C DB) GetWelcome(chatID int64) string

type Rules

type Rules struct {
	ChatID int64
	Rule   string
	Title  string
}

type User

type User struct {
	UserID int64
	Name   string
	Warn   int
}

type Welcome

type Welcome struct {
	ChatID  int64
	Welcome string
}

Jump to

Keyboard shortcuts

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