Documentation ¶
Index ¶
- func InitRepositoryProvider(databaseProvider string)
- type Endpoint
- type PostgresCNSIRepository
- func (p *PostgresCNSIRepository) Delete(guid string) error
- func (p *PostgresCNSIRepository) Find(guid string) (interfaces.CNSIRecord, error)
- func (p *PostgresCNSIRepository) FindByAPIEndpoint(endpoint string) (interfaces.CNSIRecord, error)
- func (p *PostgresCNSIRepository) List() ([]*interfaces.CNSIRecord, error)
- func (p *PostgresCNSIRepository) ListByUser(userGUID string) ([]*interfaces.ConnectedEndpoint, error)
- func (p *PostgresCNSIRepository) Save(guid string, cnsi interfaces.CNSIRecord) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRepositoryProvider ¶
func InitRepositoryProvider(databaseProvider string)
InitRepositoryProvider - One time init for the given DB Provider
Types ¶
type PostgresCNSIRepository ¶
type PostgresCNSIRepository struct {
// contains filtered or unexported fields
}
PostgresCNSIRepository is a PostgreSQL-backed CNSI repository
func (*PostgresCNSIRepository) Delete ¶
func (p *PostgresCNSIRepository) Delete(guid string) error
Delete - Persist a CNSI Record to a datastore
func (*PostgresCNSIRepository) Find ¶
func (p *PostgresCNSIRepository) Find(guid string) (interfaces.CNSIRecord, error)
Find - Returns a single CNSI Record
func (*PostgresCNSIRepository) FindByAPIEndpoint ¶
func (p *PostgresCNSIRepository) FindByAPIEndpoint(endpoint string) (interfaces.CNSIRecord, error)
FindByAPIEndpoint - Returns a single CNSI Record
func (*PostgresCNSIRepository) List ¶
func (p *PostgresCNSIRepository) List() ([]*interfaces.CNSIRecord, error)
List - Returns a list of CNSI Records
func (*PostgresCNSIRepository) ListByUser ¶
func (p *PostgresCNSIRepository) ListByUser(userGUID string) ([]*interfaces.ConnectedEndpoint, error)
ListByUser - Returns a list of CNSIs registered by a user
func (*PostgresCNSIRepository) Save ¶
func (p *PostgresCNSIRepository) Save(guid string, cnsi interfaces.CNSIRecord) error
Save - Persist a CNSI Record to a datastore
type Repository ¶
type Repository interface { List() ([]*interfaces.CNSIRecord, error) ListByUser(userGUID string) ([]*interfaces.ConnectedEndpoint, error) Find(guid string) (interfaces.CNSIRecord, error) FindByAPIEndpoint(endpoint string) (interfaces.CNSIRecord, error) Delete(guid string) error Save(guid string, cnsiRecord interfaces.CNSIRecord) error }
Repository is an application of the repository pattern for storing CNSI Records
func NewPostgresCNSIRepository ¶
func NewPostgresCNSIRepository(dcp *sql.DB) (Repository, error)
NewPostgresCNSIRepository will create a new instance of the PostgresCNSIRepository
Click to show internal directories.
Click to hide internal directories.