pbehaviorcomment

package
v0.0.0-...-d841f61 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Create(c *gin.Context)
	Delete(c *gin.Context)
}

func NewApi

func NewApi(
	transformer ModelTransformer,
	store Store,
) API

type ModelTransformer

type ModelTransformer interface {
	TransformRequestToModel(request *Request) *pbehavior.Comment
}

func NewModelTransformer

func NewModelTransformer() ModelTransformer

type Request

type Request struct {
	Pbehavior string `json:"pbehavior" binding:"required"`
	Author    string `json:"author" swaggerignore:"true"`
	Message   string `json:"message" binding:"required,max=255"`
}

type Store

type Store interface {
	Insert(pbehaviorID string, model *pbehavior.Comment) (bool, error)
	Delete(id string) (bool, error)
}

func NewStore

func NewStore(dbClient mongo.DbClient) Store

Jump to

Keyboard shortcuts

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