repository

package
v0.0.0-...-be3f9aa Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemory

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

InMemory repository should NOT be used in production

func NewInMemoryRepo

func NewInMemoryRepo() InMemory

NewInMemoryRepo constructs an InMemory repository

func (InMemory) DeleteProperty

func (r InMemory) DeleteProperty(_ context.Context, id string) error

func (InMemory) GetProperty

func (r InMemory) GetProperty(_ context.Context, id string) (entity.Property, error)

func (InMemory) GetTenant

func (r InMemory) GetTenant(_ context.Context, id entity.ID) (*entity.Tenant, error)

func (InMemory) ListTenants

func (r InMemory) ListTenants(_ context.Context, _ ...filters.TenantFilter) ([]entity.Tenant, error)

func (InMemory) NewProperty

func (r InMemory) NewProperty(street, city, state, zip string) entity.Property

func (InMemory) PropertyList

func (r InMemory) PropertyList(_ context.Context, f usecase.PropertyFilter) ([]entity.Property, error)

func (InMemory) StoreProperty

func (r InMemory) StoreProperty(_ context.Context, property entity.Property) error

func (InMemory) StoreTenant

func (r InMemory) StoreTenant(_ context.Context, e entity.Tenant) error

func (InMemory) WithEntityErr

func (r InMemory) WithEntityErr(id string, err error) InMemory

type Postgres

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

Postgres repository should NOT be used in production

func NewPostgresRepo

func NewPostgresRepo(db *sql.DB) Postgres

NewPostgresRepo constructs a Postgres repository

func (Postgres) DeleteProperty

func (r Postgres) DeleteProperty(ctx context.Context, id string) error

func (Postgres) GetProperty

func (r Postgres) GetProperty(ctx context.Context, id string) (entity.Property, error)

func (Postgres) GetTenant

func (r Postgres) GetTenant(ctx context.Context, id entity.ID) (*entity.Tenant, error)

func (Postgres) ListTenants

func (r Postgres) ListTenants(ctx context.Context, filter ...filters.TenantFilter) ([]entity.Tenant, error)

func (Postgres) NewProperty

func (r Postgres) NewProperty(street, city, state, zip string) entity.Property

func (Postgres) PropertyList

func (r Postgres) PropertyList(ctx context.Context, f usecase.PropertyFilter) ([]entity.Property, error)

func (Postgres) StoreProperty

func (r Postgres) StoreProperty(ctx context.Context, property entity.Property) error

func (Postgres) StoreTenant

func (r Postgres) StoreTenant(ctx context.Context, tenant entity.Tenant) error

Jump to

Keyboard shortcuts

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