data

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 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 Cockroach

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

func NewCockroachConnection

func NewCockroachConnection(connectionString string, ctx context.Context) (*Cockroach, error)

func (*Cockroach) AddComment

func (c *Cockroach) AddComment(path string, author string, body string) (*models.Comment, error)

func (*Cockroach) Close

func (c *Cockroach) Close() error

func (*Cockroach) GetPost

func (c *Cockroach) GetPost(path string) (*models.Post, error)

TODO: may need to switch back to using two queries here if we ever want to get info frm the posts table since a post may have no comments

func (*Cockroach) ReconnectIfClosed added in v0.1.1

func (c *Cockroach) ReconnectIfClosed() error

type DataMock

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

mock implementation of the data interface for testing

func NewDataMock

func NewDataMock() *DataMock

func (*DataMock) AddComment

func (d *DataMock) AddComment(p string, author string, body string) (models.Comment, error)

func (*DataMock) GetPost

func (d *DataMock) GetPost(path string) (models.Post, error)

type Repo

type Repo interface {
	GetPost(path string) (*models.Post, error)
	AddComment(string, string, string) (*models.Comment, error)
}

Jump to

Keyboard shortcuts

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