repo

package
v0.0.0-...-b3df9b4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a queried item is not found
	ErrNotFound = errors.New("Item not found")
)

Functions

This section is empty.

Types

type Repo

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

func New

func New(dbFile string) (r *Repo, err error)

New repo

func (*Repo) AddRule

func (r *Repo) AddRule(rule *domain.Rule) error

AddRule to the db

func (*Repo) Close

func (r *Repo) Close() error

Close the repo

func (*Repo) RemoveRule

func (r *Repo) RemoveRule(rule *domain.Rule) error

RemoveRule from the db

func (*Repo) Rules

func (r *Repo) Rules() (rules []*domain.Rule, err error)

Rules returned from the DB

func (*Repo) SaveUser

func (r *Repo) SaveUser(u *domain.User) error

SaveUser in the DB

func (*Repo) User

func (r *Repo) User(username string) (u *domain.User, err error)

User retrieval

Jump to

Keyboard shortcuts

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