pgdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDbParams

type PostgresDbParams struct {
	Host     string
	User     string
	Password string
	Db       string
	Port     string
	Ssl      string
	Timezone string
}

type ReactRolesDatabase

type ReactRolesDatabase struct {
	DB *gorm.DB
}

func GetDatabase

func GetDatabase(params PostgresDbParams) *ReactRolesDatabase

func (*ReactRolesDatabase) RoleAdd

func (db *ReactRolesDatabase) RoleAdd(id string, emoji string, name string)

func (*ReactRolesDatabase) RoleGetAll

func (db *ReactRolesDatabase) RoleGetAll() []Role

func (*ReactRolesDatabase) RoleGetById

func (db *ReactRolesDatabase) RoleGetById(id string) Role

func (*ReactRolesDatabase) RoleGetIdByEmoji

func (db *ReactRolesDatabase) RoleGetIdByEmoji(emoji string) string

func (*ReactRolesDatabase) RoleGetIdByName

func (db *ReactRolesDatabase) RoleGetIdByName(name string) string

func (*ReactRolesDatabase) RoleIsEmojiTaken

func (db *ReactRolesDatabase) RoleIsEmojiTaken(emoji string) bool

func (*ReactRolesDatabase) RoleIsNameTaken

func (db *ReactRolesDatabase) RoleIsNameTaken(name string) bool

func (*ReactRolesDatabase) RoleRemove

func (db *ReactRolesDatabase) RoleRemove(id string)

type Role

type Role struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time `gorm:"index"`
	ID        string    `gorm:"primarykey"`
	Name      string
	Emoji     string
}

Jump to

Keyboard shortcuts

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