db

package
v0.0.0-...-c5bc608 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Type    AnnotationType `json:"type"`
	Text    string         `json:"text"`
	StartX  int            `json:"startx"`
	StartY  int            `json:"starty"`
	EndX    int            `json:"endx"`
	EndY    int            `json:"endy"`
	Color   string         `json:"color"`
	Author  string         `json:"author"`
	Date    string         `json:"date"`
	Comment string         `json:"comment"`
}

func NewAnnotation

func NewAnnotation(t AnnotationType, text string, opts ...AnnotationOption) Annotation

type AnnotationOption

type AnnotationOption func(*Annotation)

func WithComment

func WithComment(comment string) AnnotationOption

func WithLocation

func WithLocation(startx, starty, endx, endy int) AnnotationOption

type AnnotationType

type AnnotationType string
const (
	AnnotationHighlight  AnnotationType = "Highlight"
	AnnotationUnderscore AnnotationType = "Underscore"
	AnnotationComment    AnnotationType = "Comment"
)

type DB

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

func NewDb

func NewDb(dbPath string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Commit

func (db *DB) Commit(annotation Annotation)

func (*DB) Run

func (db *DB) Run(title string) error

Jump to

Keyboard shortcuts

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