store

package
v0.0.0-...-d6efe1e Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePost

type CreatePost struct {
	UserID      string
	Title       string
	IsAnon      bool
	Description string
	TypeID      int
}

type DB

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

func NewDB

func NewDB(ctx context.Context, uri string) (*DB, error)

func (*DB) Close

func (d *DB) Close()

func (*DB) CreateNewPost

func (d *DB) CreateNewPost(ctx context.Context, post CreatePost) (Post, error)

func (*DB) CreateUser

func (d *DB) CreateUser(ctx context.Context, usr UserInfo) error

func (*DB) GetPosts

func (d *DB) GetPosts(ctx context.Context) ([]Post, error)

func (*DB) GetUserByID

func (d *DB) GetUserByID(ctx context.Context, userID string) (User, error)

type Post

type Post struct {
	ID          int
	UserID      string
	Title       string
	IsAnon      bool
	Description string
	TypeID      int
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type User

type User struct {
	ID    string
	Email string
}

type UserInfo

type UserInfo struct {
	UserId    string
	Email     string
	FirstName string
	LastName  string
}

Jump to

Keyboard shortcuts

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