storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2017 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 Question

type Question struct {
	ID         int    `json:"id"`
	Title      string `json:"title,omitempty"`
	Query      string `json:"query,omitempty"`
	DataSource string `json:"dataSource,omitempty"`
}

Question stores q&a

type Storage

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

Storage is a struct for deloominator own database

func NewStorage

func NewStorage(source string) (*Storage, error)

NewStorage initializes deloominator own storage using source

func (*Storage) AllQuestions

func (s *Storage) AllQuestions() (questions []*Question, err error)

func (*Storage) AutoUpgrade

func (s *Storage) AutoUpgrade() error

AutoUpgrade migrates the DB if needed

func (*Storage) Close

func (s *Storage) Close()

Close closes the underlining DB connection

func (*Storage) FindQuestion

func (s *Storage) FindQuestion(id int) (*Question, error)

func (*Storage) InsertQuestion

func (s *Storage) InsertQuestion(title, query, dataSource string) (*Question, error)

func (*Storage) String

func (s *Storage) String() string

Jump to

Keyboard shortcuts

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