data

package
v0.0.0-...-c4f823d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT, MIT Imports: 12 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewArticleRepo

func NewArticleRepo(data *Data, logger log.Logger) biz.ArticleRepo

NewArticleRepo .

func NewCommentRepo

func NewCommentRepo(data *Data, logger log.Logger) biz.CommentRepo

NewCommentRepo .

func NewDB

func NewDB(c *conf.Data) *gorm.DB

func NewKafkaProducer

func NewKafkaProducer(conf *conf.Data) *kafka.Writer

Types

type Article

type Article struct {
	gorm.Model
	Title   string `json:"title"`
	Content string `json:"content"`
}

type Comment

type Comment struct {
	gorm.Model
	UserId    int64  `json:"user_id"`
	ArticleId int64  `json:"article_id"`
	Content   string `json:"content"`
}

type Data

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

Data .

func NewData

func NewData(c *conf.Data, logger log.Logger, db *gorm.DB, kp *kafka.Writer) (*Data, func(), error)

NewData .

Jump to

Keyboard shortcuts

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