dao

package
v0.0.0-...-8f28ad5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dao contains all the data access object used in the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arweave

type Arweave interface {
	Upload(ctx context.Context, data []byte,
		opts ...arweave.UploadOption) (fileID string, err error)
}

type Blog

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

Blog dao type

func New

func New(logger glog.Logger,
	db mongo.DB,
	arweave Arweave,
) *Blog

New create new dao

func (*Blog) GetCategoriesCol

func (d *Blog) GetCategoriesCol() *mongoLib.Collection

GetCategoriesCol get categories collection

func (*Blog) GetPostSeriesCol

func (d *Blog) GetPostSeriesCol() *mongoLib.Collection

GetPostSeriesCol get post series collection

func (*Blog) GetPostsCol

func (d *Blog) GetPostsCol() *mongoLib.Collection

GetPostsCol get posts collection

func (*Blog) GetUsersCol

func (d *Blog) GetUsersCol() *mongoLib.Collection

GetUsersCol get users collection

func (*Blog) PostTagsCol

func (d *Blog) PostTagsCol() *mongoLib.Collection

PostTagsCol get post tags collection

func (*Blog) SaveToArweave

func (d *Blog) SaveToArweave(ctx context.Context, data any) (fileID string, err error)

SaveToArweave save data to arweave

func (*Blog) ValidateLogin

func (d *Blog) ValidateLogin(ctx context.Context, account, rawPassword string) (u *model.User, err error)

ValidateLogin validate user login

Jump to

Keyboard shortcuts

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