db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommentNotFound = errors.New("comment not found")

Functions

func CommentAnchor

func CommentAnchor(path, side string, line int) string

func IsCommentNotFound

func IsCommentNotFound(err error) bool

Types

type Comment

type Comment struct {
	Body         string
	Branch       string
	CreatedAt    time.Time
	ID           string
	Line         int
	Path         string
	Resolved     bool
	ResolvedBody string
	Side         string
	Slug         string
	UpdatedAt    time.Time
}

func (Comment) Anchor

func (c Comment) Anchor() string

type CommentStore

type CommentStore interface {
	AddComment(slug, branch, path, side string, line int, body string) (Comment, error)
	DeleteComment(slug, id string) error
	GetComment(slug, id string) (Comment, error)
	ListComments(slug, branch string) ([]Comment, error)
	SetCommentResolved(slug, id string, resolved bool, body string) (Comment, error)
	UpdateCommentBody(slug, id, body string) (Comment, error)
}

type DB

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

func New

func New(path string) (*DB, error)

func (*DB) AddComment

func (d *DB) AddComment(slug, branch, path, side string, line int, body string) (Comment, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) DeleteComment

func (d *DB) DeleteComment(slug, id string) error

func (*DB) GetComment

func (d *DB) GetComment(slug, id string) (Comment, error)

func (*DB) ListComments

func (d *DB) ListComments(slug, branch string) ([]Comment, error)

func (*DB) SetCommentResolved

func (d *DB) SetCommentResolved(slug, id string, resolved bool, body string) (Comment, error)

func (*DB) UpdateCommentBody

func (d *DB) UpdateCommentBody(slug, id, body string) (Comment, error)

type NopCommentStore

type NopCommentStore struct{}

func (NopCommentStore) AddComment

func (NopCommentStore) DeleteComment

func (NopCommentStore) DeleteComment(string, string) error

func (NopCommentStore) GetComment

func (NopCommentStore) GetComment(string, string) (Comment, error)

func (NopCommentStore) ListComments

func (NopCommentStore) ListComments(string, string) ([]Comment, error)

func (NopCommentStore) SetCommentResolved

func (NopCommentStore) SetCommentResolved(string, string, bool, string) (Comment, error)

func (NopCommentStore) UpdateCommentBody

func (NopCommentStore) UpdateCommentBody(string, string, string) (Comment, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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