database

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

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPostDatabase

type IPostDatabase interface {
	GetPost(string) (*model.Post, error)
}

type IUserDatabase

type IUserDatabase interface {
	GetUser(string) (*model.User, error)
}

type RedisDB

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

func NewRedisDB

func NewRedisDB(addr, password string, db int) (*RedisDB, error)

func (*RedisDB) GetPost

func (rdb *RedisDB) GetPost(postID string) (*model.Post, error)

func (*RedisDB) SetPost

func (rdb *RedisDB) SetPost(post *model.Post) error

type UserDB

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

func NewUserDB

func NewUserDB(connString string) *UserDB

func (*UserDB) GetUser

func (db *UserDB) GetUser(id string) (*model.User, error)

Jump to

Keyboard shortcuts

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