data

package
v0.0.0-...-6a91072 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 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