pbehaviorcomment

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 12 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(
	store Store,
) API

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 Response

type Response struct {
	ID        string           `bson:"_id" json:"_id"`
	Author    *author.Author   `bson:"author" json:"author"`
	Timestamp datetime.CpsTime `bson:"ts" json:"ts" swaggertype:"integer"`
	Message   string           `bson:"message" json:"message"`
}

type Store

type Store interface {
	Insert(ctx context.Context, r Request) (*Response, error)
	Delete(ctx context.Context, id string) (bool, error)
}

func NewStore

func NewStore(dbClient mongo.DbClient, authorProvider author.Provider) Store

Jump to

Keyboard shortcuts

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