repo

package
v0.0.0-...-a53e0fd Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

type Accounts struct {
	DB kvs.DB
	// contains filtered or unexported fields
}

func (Accounts) Close

func (r Accounts) Close()

func (*Accounts) GetAll

func (r *Accounts) GetAll() ([]models.Account, error)

func (*Accounts) GetByID

func (r *Accounts) GetByID(rowID uint32) (models.Account, error)

func (*Accounts) Save

func (r *Accounts) Save(user *models.Account) error

type Emails

type Emails struct {
	DB kvs.DB
	// contains filtered or unexported fields
}

func (*Emails) Close

func (r *Emails) Close()

func (*Emails) GetAll

func (r *Emails) GetAll(accountID uint32) ([]models.Email, error)

TODO:(tauraamui) really all of the generic "Getters" and "Setters" methods of these repos are identical thanks to using the kvs backend so should move each of these into using Go generics rather than copying them for each type.

func (*Emails) GetByID

func (r *Emails) GetByID(rowID uint32) (models.Email, error)

func (*Emails) Save

func (r *Emails) Save(accountID uint32, email *models.Email) error

type GenericRepo

type GenericRepo struct {
	TableName string
	DB        kvs.DB
	// contains filtered or unexported fields
}

func (*GenericRepo) Close

func (r *GenericRepo) Close()

func (*GenericRepo) Save

func (r *GenericRepo) Save(ownerID uint32, v Value) error

type Mailboxes

type Mailboxes struct {
	DB kvs.DB
	// contains filtered or unexported fields
}

TODO:(tauraamui): this mailboxes repo should also be in charge of saving and loading

messages, when saving a message it would just simply set the owner
ID to be the mailboxes' ID

func (*Mailboxes) Close

func (r *Mailboxes) Close()

func (*Mailboxes) GetAll

func (r *Mailboxes) GetAll(accountID uint32) ([]models.Mailbox, error)

func (*Mailboxes) GetByID

func (r *Mailboxes) GetByID(rowID uint32) (models.Mailbox, error)

func (*Mailboxes) Save

func (r *Mailboxes) Save(accountID uint32, mailbox *models.Mailbox) error

type Value

type Value interface {
	SetID(id uint32)
	Ref() interface{}
}

Jump to

Keyboard shortcuts

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