cnsis

package
v0.0.0-...-f34f428 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func NewPostgresCNSIRepository

func NewPostgresCNSIRepository(dcp *sql.DB) (interfaces.EndpointRepository, error)

NewPostgresCNSIRepository will create a new instance of the PostgresCNSIRepository

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 will delete a CNSI Record from the datastore

func (*PostgresCNSIRepository) Find

func (p *PostgresCNSIRepository) Find(guid string, encryptionKey []byte) (interfaces.CNSIRecord, error)

Find - Returns a single CNSI Record

func (*PostgresCNSIRepository) FindByAPIEndpoint

func (p *PostgresCNSIRepository) FindByAPIEndpoint(endpoint string, encryptionKey []byte) (interfaces.CNSIRecord, error)

FindByAPIEndpoint - Returns a single CNSI Record

func (*PostgresCNSIRepository) List

func (p *PostgresCNSIRepository) List(encryptionKey []byte) ([]*interfaces.CNSIRecord, error)

List - Returns a list of CNSI Records

func (*PostgresCNSIRepository) ListByAPIEndpoint

func (p *PostgresCNSIRepository) ListByAPIEndpoint(endpoint string, encryptionKey []byte) ([]*interfaces.CNSIRecord, error)

ListByAPIEndpoint - Returns a a list of CNSIs with the same APIEndpoint

func (*PostgresCNSIRepository) ListByCreator

func (p *PostgresCNSIRepository) ListByCreator(userGUID string, encryptionKey []byte) ([]*interfaces.CNSIRecord, error)

ListByCreator - Returns a list of CNSIs created by a user

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, encryptionKey []byte) error

Save will persist a CNSI Record to a datastore

func (*PostgresCNSIRepository) SaveOrUpdate

func (p *PostgresCNSIRepository) SaveOrUpdate(endpoint interfaces.CNSIRecord, encryptionKey []byte) error

SaveOrUpdate - Creates or Updates CNSI Record

func (*PostgresCNSIRepository) Update

func (p *PostgresCNSIRepository) Update(endpoint interfaces.CNSIRecord, encryptionKey []byte) error

Update - Update an endpoint's data

func (*PostgresCNSIRepository) UpdateMetadata

func (p *PostgresCNSIRepository) UpdateMetadata(guid string, metadata string) error

UpdateMetadata - Update an endpoint's metadata

Jump to

Keyboard shortcuts

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