data

package
v0.0.0-...-f3e824b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogDoc

type BlogDoc struct {
	Slug  string `bson:"slug" json:"slug"`
	Views int64  `bson:"views" json:"views"`
}

type MongoDB

type MongoDB struct {
	Client  *mongo.Client
	Blog    *mongo.Collection
	Timeout time.Duration
}

func (*MongoDB) Connect

func (mdb *MongoDB) Connect(connString string) error

func (*MongoDB) GetBlog

func (mdb *MongoDB) GetBlog(slug string) (BlogDoc, error)

GetBlog will give the BlogDoc upon a slug

func (*MongoDB) UpdateBlog

func (mdb *MongoDB) UpdateBlog(slug string) error

UpdateBlog will update the blog

Jump to

Keyboard shortcuts

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