repository

package
v0.0.0-...-5b668fc Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(url string) error

Init initializes a repository from scratch.

func Migrate

func Migrate(url string) error

Types

type Repository

type Repository interface {
	io.Closer
	Read() error
	Write() error
	Config() *types.Config

	// Accounts returns a list of accounts that maches the Id.
	// The ID can be either an ID or a Name.
	Accounts(id ...string) []*types.Account

	// Clients returns a list of clients that maches the Id.
	// The ID can be either an ID or a Name.
	Clients(id ...string) []*types.Client

	// Projects returns a list of projects that maches the Id.
	// The ID can be either an ID or a Name.
	Projects(id ...string) []*types.Project

	Invoices(id ...string) []*types.Invoice
	InvoicesCount(id ...string) int
	Templates(id ...string) []*types.Template

	SetConfig(*types.Config) error
	SetAccount(*types.Account) error
	SetClient(*types.Client) error
	SetProject(*types.Project) error
	SetInvoice(*types.Invoice) error
	SetTemplate(*types.Template) error

	DelAccount(*types.Account) error
	DelClient(*types.Client) error
	DelProject(*types.Project) error
	DelInvoice(*types.Invoice) error
	DelTemplate(*types.Template) error

	FS() fs.FS
}

func New

func New(url string) (rep Repository, err error)

New returns a new repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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