persisters

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persister

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

func NewPersister

func NewPersister(pgaddr string) *Persister

func (*Persister) CloseTodo

func (p *Persister) CloseTodo(ctx context.Context, id int32, namespace string) error

func (*Persister) CreateActivity

func (p *Persister) CreateActivity(
	ctx context.Context,

	name string,
	date time.Time,
	description string,

	contactID int32,
	namespace string,
) (int32, error)

func (*Persister) CreateContact

func (p *Persister) CreateContact(
	ctx context.Context,
	firstName string,
	lastName string,
	nickname string,
	email string,
	pronouns string,
	namespace string,
) (int32, error)

func (*Persister) CreateDebt

func (p *Persister) CreateDebt(
	ctx context.Context,

	amount float64,
	currency,
	description string,

	contactID int32,
	namespace string,
) (int32, error)

func (*Persister) CreateJournalEntry

func (p *Persister) CreateJournalEntry(ctx context.Context, title, body string, rating int32, namespace string) (int32, error)

func (*Persister) CreateTodo

func (p *Persister) CreateTodo(ctx context.Context, name string, deadline time.Time, importance int32, namespace string) (int32, error)

func (*Persister) DeleteActivity

func (p *Persister) DeleteActivity(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,
) error

func (*Persister) DeleteContact

func (p *Persister) DeleteContact(ctx context.Context, id int32, namespace string) error

func (*Persister) DeleteJournalEntry

func (p *Persister) DeleteJournalEntry(ctx context.Context, id int32, namespace string) error

func (*Persister) DeleteTodo

func (p *Persister) DeleteTodo(ctx context.Context, id int32, namespace string) error

func (*Persister) GetActivities

func (p *Persister) GetActivities(
	ctx context.Context,

	contactID int32,
	namespace string,
) ([]models.GetActivitiesRow, error)

func (*Persister) GetActivityAndContact

func (p *Persister) GetActivityAndContact(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,
) (models.GetActivityAndContactRow, error)

func (*Persister) GetContact

func (p *Persister) GetContact(ctx context.Context, id int32, namespace string) (models.Contact, error)

func (*Persister) GetContacts

func (p *Persister) GetContacts(ctx context.Context, namespace string) ([]models.Contact, error)

func (*Persister) GetDebtAndContact

func (p *Persister) GetDebtAndContact(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,
) (models.GetDebtAndContactRow, error)

func (*Persister) GetDebts

func (p *Persister) GetDebts(
	ctx context.Context,

	contactID int32,
	namespace string,
) ([]models.GetDebtsRow, error)

func (*Persister) GetDoneTodos

func (p *Persister) GetDoneTodos(ctx context.Context, namespace string) ([]models.Todo, error)

func (*Persister) GetJournalEntries

func (p *Persister) GetJournalEntries(ctx context.Context, namespace string) ([]models.JournalEntry, error)

func (*Persister) GetJournalEntry

func (p *Persister) GetJournalEntry(ctx context.Context, id int32, namespace string) (models.JournalEntry, error)

func (*Persister) GetPendingTodos

func (p *Persister) GetPendingTodos(ctx context.Context, namespace string) ([]models.Todo, error)

func (*Persister) GetTodo

func (p *Persister) GetTodo(ctx context.Context, id int32, namespace string) (models.Todo, error)

func (*Persister) Init

func (p *Persister) Init() error

func (*Persister) SettleDebt

func (p *Persister) SettleDebt(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,
) error

func (*Persister) UpdateActivity

func (p *Persister) UpdateActivity(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,

	name string,
	date time.Time,
	description string,
) error

func (*Persister) UpdateContact

func (p *Persister) UpdateContact(
	ctx context.Context,
	id int32,
	firstName,
	lastName,
	nickname,
	email,
	pronouns,
	namespace string,
	birthday *time.Time,
	address,
	notes string,
) error

func (*Persister) UpdateDebt

func (p *Persister) UpdateDebt(
	ctx context.Context,

	id int32,

	contactID int32,
	namespace string,

	amount float64,
	currency,
	description string,
) error

func (*Persister) UpdateJournalEntry

func (p *Persister) UpdateJournalEntry(ctx context.Context, id int32, title, body string, rating int32, namespace string) error

func (*Persister) UpdateTodo

func (p *Persister) UpdateTodo(ctx context.Context, id int32, name string, deadline time.Time, importance int32, namespace string) error

Jump to

Keyboard shortcuts

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