Version: v2.0.0-beta-001+incomp... Latest Latest

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 0




This section is empty.


This section is empty.


func InitRepositoryProvider

func InitRepositoryProvider(databaseProvider string)

InitRepositoryProvider - One time init for the given DB Provider


type Endpoint

type Endpoint interface {

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

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

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

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

Jump to

Keyboard shortcuts

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