mysql

package
v0.0.0-...-bdbfe35 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlConnection

func NewMysqlConnection() *sql.DB

Types

type CategoryCommand

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

func NewCategoryCommand

func NewCategoryCommand(connection *sql.DB) *CategoryCommand

func (*CategoryCommand) Create

func (c *CategoryCommand) Create(category domain.Category) error

func (*CategoryCommand) Delete

func (c *CategoryCommand) Delete(categoryId int64) error

func (*CategoryCommand) Update

func (c *CategoryCommand) Update(categoryId int64, category domain.Category) error

type CategoryQuery

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

func NewCategoryQuery

func NewCategoryQuery(connection *sql.DB) *CategoryQuery

func (*CategoryQuery) FindAll

func (c *CategoryQuery) FindAll() (*[]domain.Category, error)

func (*CategoryQuery) FindById

func (c *CategoryQuery) FindById(categoryId int64) (*domain.Category, error)

type CommentCommand

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

func NewCommentCommand

func NewCommentCommand(connection *sql.DB) *CommentCommand

func (*CommentCommand) Create

func (c *CommentCommand) Create(comment domain.Comment) error

func (*CommentCommand) Delete

func (c *CommentCommand) Delete(commentId int64) error

func (*CommentCommand) Update

func (c *CommentCommand) Update(commentId int64, comment domain.Comment) error

type CommentQuery

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

func NewCommentQuery

func NewCommentQuery(connection *sql.DB) *CommentQuery

func (*CommentQuery) FindAllByPost

func (q *CommentQuery) FindAllByPost(postId int64) ([]domain.Comment, error)

func (*CommentQuery) FindById

func (q *CommentQuery) FindById(commentId int64) (*domain.Comment, error)

type MysqlConfig

type MysqlConfig struct {
	User     string `json:"user"`
	PassWord string `json:"password"`
	Port     string `json:"port"`
	Database string `json:"db_name"`
	Host     string `json:"host"`
}

type MysqlConnection

type MysqlConnection struct {
	DbConnection *sql.DB
}

type PostCommand

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

func NewPostCommand

func NewPostCommand(connection *sql.DB) *PostCommand

func (*PostCommand) Create

func (c *PostCommand) Create(post domain.Post) error

func (*PostCommand) Delete

func (c *PostCommand) Delete(postId int64) error

func (*PostCommand) Update

func (c *PostCommand) Update(postId int64, post domain.Post) error

type PostQuery

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

func NewPostQuery

func NewPostQuery(connection *sql.DB) *PostQuery

func (*PostQuery) SearchById

func (q *PostQuery) SearchById(postId int64) (*domain.Post, error)

func (*PostQuery) SearchByUser

func (q *PostQuery) SearchByUser(userId int64) (*[]domain.Post, error)

type UserCommand

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

func NewUserCommand

func NewUserCommand(connection *sql.DB) *UserCommand

func (*UserCommand) Create

func (userCmd *UserCommand) Create(user domain.User) error

func (*UserCommand) Delete

func (userCmd *UserCommand) Delete(userId int64) error

func (*UserCommand) Update

func (userCmd *UserCommand) Update(userId int64, user domain.User) error

type UserQuery

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

func NewUserQuery

func NewUserQuery(connection *sql.DB) *UserQuery

func (*UserQuery) FindAll

func (usrQry *UserQuery) FindAll() (*[]domain.User, error)

func (*UserQuery) FindByEmail

func (usrQry *UserQuery) FindByEmail(email string) (domain.User, error)

func (*UserQuery) FindById

func (usrQry *UserQuery) FindById(userId int64) (domain.User, error)

Jump to

Keyboard shortcuts

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