cnsis

package
v0.0.0-...-10da5ee Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT 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) (api.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) (api.CNSIRecord, error)

Find - Returns a single CNSI Record

func (*PostgresCNSIRepository) FindByAPIEndpoint

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

FindByAPIEndpoint - Returns a single CNSI Record

func (*PostgresCNSIRepository) List

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

List - Returns a list of CNSI Records

func (*PostgresCNSIRepository) ListByAPIEndpoint

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

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

func (*PostgresCNSIRepository) ListByCreator

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

ListByCreator - Returns a list of CNSIs created by a user

func (*PostgresCNSIRepository) ListByUser

func (p *PostgresCNSIRepository) ListByUser(userGUID string) ([]*api.ConnectedEndpoint, error)

ListByUser - Returns a list of CNSIs registered by a user

func (*PostgresCNSIRepository) Save

func (p *PostgresCNSIRepository) Save(guid string, cnsi api.CNSIRecord, encryptionKey []byte) error

Save will persist a CNSI Record to a datastore

func (*PostgresCNSIRepository) SaveOrUpdate

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

SaveOrUpdate - Creates or Updates CNSI Record

func (*PostgresCNSIRepository) Update

func (p *PostgresCNSIRepository) Update(endpoint api.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