postgres

package
v1.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountPostgreSQLRepository

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

AccountPostgreSQLRepository is a Postgresql-specific implementation of the AccountRepository.

func NewAccountPostgreSQLRepository

func NewAccountPostgreSQLRepository(pc *mpostgres.PostgresConnection) *AccountPostgreSQLRepository

NewAccountPostgreSQLRepository returns a new instance of AccountPostgreSQLRepository using the given Postgres connection.

func (*AccountPostgreSQLRepository) Create

func (r *AccountPostgreSQLRepository) Create(ctx context.Context, account *a.Account) (*a.Account, error)

Create a new account entity into Postgresql and returns it.

func (*AccountPostgreSQLRepository) Delete

func (r *AccountPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) error

Delete removes an Account entity from the database using the provided IDs.

func (*AccountPostgreSQLRepository) Find

func (r *AccountPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID) (*a.Account, error)

Find retrieves an Account entity from the database using the provided ID.

func (*AccountPostgreSQLRepository) FindAll

func (r *AccountPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID) ([]*a.Account, error)

FindAll retrieves an Account entities from the database.

func (*AccountPostgreSQLRepository) FindByAlias added in v1.1.0

func (r *AccountPostgreSQLRepository) FindByAlias(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, alias string) (bool, error)

FindByAlias find account from the database using Organization and Ledger id and Alias.

func (*AccountPostgreSQLRepository) ListByIDs

func (r *AccountPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID, portfolioID uuid.UUID, ids []uuid.UUID) ([]*a.Account, error)

ListByIDs retrieves Accounts entities from the database using the provided IDs.

func (*AccountPostgreSQLRepository) Update

func (r *AccountPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, portfolioID, id uuid.UUID, account *a.Account) (*a.Account, error)

Update an Account entity into Postgresql and returns the Account updated.

type InstrumentPostgreSQLRepository

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

InstrumentPostgreSQLRepository is a Postgresql-specific implementation of the InstrumentRepository.

func NewInstrumentPostgreSQLRepository

func NewInstrumentPostgreSQLRepository(pc *mpostgres.PostgresConnection) *InstrumentPostgreSQLRepository

NewInstrumentPostgreSQLRepository returns a new instance of InstrumentPostgreSQLRepository using the given Postgres connection.

func (*InstrumentPostgreSQLRepository) Create

func (r *InstrumentPostgreSQLRepository) Create(ctx context.Context, instrument *i.Instrument) (*i.Instrument, error)

Create a new instrument entity into Postgresql and returns it.

func (*InstrumentPostgreSQLRepository) Delete

func (r *InstrumentPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

Delete removes an Instrument entity from the database using the provided IDs.

func (*InstrumentPostgreSQLRepository) Find

func (r *InstrumentPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*i.Instrument, error)

Find retrieves an Instrument entity from the database using the provided ID.

func (*InstrumentPostgreSQLRepository) FindAll

func (r *InstrumentPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID) ([]*i.Instrument, error)

FindAll retrieves Instrument entities from the database.

func (*InstrumentPostgreSQLRepository) FindByNameOrCode added in v1.1.0

func (r *InstrumentPostgreSQLRepository) FindByNameOrCode(ctx context.Context, organizationID, ledgerID uuid.UUID, name, code string) (bool, error)

FindByNameOrCode retrieves Instrument entities by nam or code from the database.

func (*InstrumentPostgreSQLRepository) ListByIDs

func (r *InstrumentPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*i.Instrument, error)

ListByIDs retrieves Instruments entities from the database using the provided IDs.

func (*InstrumentPostgreSQLRepository) Update

func (r *InstrumentPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, instrument *i.Instrument) (*i.Instrument, error)

Update an Instrument entity into Postgresql and returns the Instrument updated.

type LedgerPostgreSQLRepository

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

LedgerPostgreSQLRepository is a Postgresql-specific implementation of the LedgerRepository.

func NewLedgerPostgreSQLRepository

func NewLedgerPostgreSQLRepository(pc *mpostgres.PostgresConnection) *LedgerPostgreSQLRepository

NewLedgerPostgreSQLRepository returns a new instance of LedgerPostgresRepository using the given Postgres connection.

func (*LedgerPostgreSQLRepository) Create

func (r *LedgerPostgreSQLRepository) Create(ctx context.Context, ledger *l.Ledger) (*l.Ledger, error)

Create a new Ledger entity into Postgresql and returns it.

func (*LedgerPostgreSQLRepository) Delete

func (r *LedgerPostgreSQLRepository) Delete(ctx context.Context, organizationID, id uuid.UUID) error

Delete removes a Ledger entity from the database using the provided ID.

func (*LedgerPostgreSQLRepository) Find

func (r *LedgerPostgreSQLRepository) Find(ctx context.Context, organizationID, id uuid.UUID) (*l.Ledger, error)

Find retrieves a Ledger entity from the database using the provided ID.

func (*LedgerPostgreSQLRepository) FindAll

func (r *LedgerPostgreSQLRepository) FindAll(ctx context.Context, organizationID uuid.UUID) ([]*l.Ledger, error)

FindAll retrieves Ledgers entities from the database.

func (*LedgerPostgreSQLRepository) ListByIDs

func (r *LedgerPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID uuid.UUID, ids []uuid.UUID) ([]*l.Ledger, error)

ListByIDs retrieves Ledgers entities from the database using the provided IDs.

func (*LedgerPostgreSQLRepository) Update

func (r *LedgerPostgreSQLRepository) Update(ctx context.Context, organizationID, id uuid.UUID, ledger *l.Ledger) (*l.Ledger, error)

Update a Ledger entity into Postgresql and returns the Ledger updated.

type OrganizationPostgreSQLRepository

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

OrganizationPostgreSQLRepository is a Postgresql-specific implementation of the OrganizationRepository.

func NewOrganizationPostgreSQLRepository

func NewOrganizationPostgreSQLRepository(pc *mpostgres.PostgresConnection) *OrganizationPostgreSQLRepository

NewOrganizationPostgreSQLRepository returns a new instance of OrganizationPostgresRepository using the given Postgres connection.

func (*OrganizationPostgreSQLRepository) Create

Create inserts a new Organization entity into Postgresql and returns the created Organization.

func (*OrganizationPostgreSQLRepository) Delete

Delete removes an Organization entity from the database using the provided ID.

func (*OrganizationPostgreSQLRepository) Find

Find retrieves an Organization entity from the database using the provided ID.

func (*OrganizationPostgreSQLRepository) FindAll

FindAll retrieves Organizations entities from the database.

func (*OrganizationPostgreSQLRepository) ListByIDs

ListByIDs retrieves Organizations entities from the database using the provided IDs.

func (*OrganizationPostgreSQLRepository) Update

Update an Organization entity into Postgresql and returns the Organization updated.

type PortfolioPostgreSQLRepository

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

PortfolioPostgreSQLRepository is a Postgresql-specific implementation of the PortfolioRepository.

func NewPortfolioPostgreSQLRepository

func NewPortfolioPostgreSQLRepository(pc *mpostgres.PostgresConnection) *PortfolioPostgreSQLRepository

NewPortfolioPostgreSQLRepository returns a new instance of PortfolioPostgreSQLRepository using the given Postgres connection.

func (*PortfolioPostgreSQLRepository) Create

func (r *PortfolioPostgreSQLRepository) Create(ctx context.Context, portfolio *p.Portfolio) (*p.Portfolio, error)

Create a new portfolio entity into Postgresql and returns it.

func (*PortfolioPostgreSQLRepository) Delete

func (r *PortfolioPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

Delete removes a Portfolio entity from the database using the provided IDs.

func (*PortfolioPostgreSQLRepository) Find

func (r *PortfolioPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*p.Portfolio, error)

Find retrieves a Portfolio entity from the database using the provided ID.

func (*PortfolioPostgreSQLRepository) FindAll

func (r *PortfolioPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID) ([]*p.Portfolio, error)

FindAll retrieves Portfolio entities from the database.

func (*PortfolioPostgreSQLRepository) FindByIDEntity

func (r *PortfolioPostgreSQLRepository) FindByIDEntity(ctx context.Context, organizationID, ledgerID, entityID uuid.UUID) (*p.Portfolio, error)

FindByIDEntity find portfolio from the database using the Entity id.

func (*PortfolioPostgreSQLRepository) ListByIDs

func (r *PortfolioPostgreSQLRepository) ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*p.Portfolio, error)

ListByIDs retrieves Portfolios entities from the database using the provided IDs.

func (*PortfolioPostgreSQLRepository) Update

func (r *PortfolioPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, portfolio *p.Portfolio) (*p.Portfolio, error)

Update a Portfolio entity into Postgresql and returns the Portfolio updated.

type ProductPostgreSQLRepository

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

ProductPostgreSQLRepository is a Postgresql-specific implementation of the Repository.

func NewProductPostgreSQLRepository

func NewProductPostgreSQLRepository(pc *mpostgres.PostgresConnection) *ProductPostgreSQLRepository

NewProductPostgreSQLRepository returns a new instance of ProductPostgreSQLRepository using the given Postgres connection.

func (*ProductPostgreSQLRepository) Create

func (p *ProductPostgreSQLRepository) Create(ctx context.Context, product *r.Product) (*r.Product, error)

Create a new product entity into Postgresql and returns it.

func (*ProductPostgreSQLRepository) Delete

func (p *ProductPostgreSQLRepository) Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error

Delete removes a Product entity from the database using the provided IDs.

func (*ProductPostgreSQLRepository) Find

func (p *ProductPostgreSQLRepository) Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*r.Product, error)

Find retrieves a Product entity from the database using the provided ID.

func (*ProductPostgreSQLRepository) FindAll

func (p *ProductPostgreSQLRepository) FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID) ([]*r.Product, error)

FindAll retrieves Product entities from the database.

func (*ProductPostgreSQLRepository) FindByIDs

func (p *ProductPostgreSQLRepository) FindByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*r.Product, error)

FindByIDs retrieves Products entities from the database using the provided IDs.

func (*ProductPostgreSQLRepository) FindByName

func (p *ProductPostgreSQLRepository) FindByName(ctx context.Context, organizationID, ledgerID uuid.UUID, name string) (bool, error)

FindByName find product from the database using Organization and Ledger id and Name.

func (*ProductPostgreSQLRepository) Update

func (p *ProductPostgreSQLRepository) Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, prd *r.Product) (*r.Product, error)

Update a Product entity into Postgresql and returns the Product updated.

Jump to

Keyboard shortcuts

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