gorm

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCertificateAuthorityExist = errors.New("CA already exists")

ErrCertificateAuthorityExist means new CA cannot be created due to the existence of the same-name CA

View Source
var ErrEndpointExist = errors.New("endpoint already exists")

ErrEndpointExist means new endpoint cannot be created due to the existence of the same-name endpoint

View Source
var ErrFederationExist = errors.New("federation already exists")

ErrFederationExist means new federation cannot be created due to the existence of the same-name federation

View Source
var ErrParticipantExist = errors.New("participant already exists")

ErrParticipantExist means new participant cannot be created due to name conflicts

View Source
var ErrTokenExist = errors.New("token already exists")

ErrTokenExist means new token cannot be created due to name conflicts

View Source
var ErrUserExist = errors.New("user already exists")

ErrUserExist means new user cannot be created due to the existence of the same-name user

Functions

func InitDB

func InitDB() error

InitDB initialize the connection to the PostgresSql db

Types

type CertificateAuthorityRepo

type CertificateAuthorityRepo struct{}

CertificateAuthorityRepo is the implementation of the repo.CertificateAuthorityRepository interface

func (*CertificateAuthorityRepo) Create

func (r *CertificateAuthorityRepo) Create(instance interface{}) error

func (*CertificateAuthorityRepo) GetFirst

func (r *CertificateAuthorityRepo) GetFirst() (interface{}, error)

func (*CertificateAuthorityRepo) InitTable

func (r *CertificateAuthorityRepo) InitTable()

InitTable makes sure the table is created in the db

func (*CertificateAuthorityRepo) UpdateByUUID

func (r *CertificateAuthorityRepo) UpdateByUUID(instance interface{}) error

type CertificateBindingRepo

type CertificateBindingRepo struct{}

CertificateBindingRepo is the implementation of the repo.CertificateBindingRepository interface

func (*CertificateBindingRepo) Create

func (r *CertificateBindingRepo) Create(instance interface{}) error

func (*CertificateBindingRepo) DeleteByParticipantUUID

func (r *CertificateBindingRepo) DeleteByParticipantUUID(participantUUID string) error

func (*CertificateBindingRepo) InitTable

func (r *CertificateBindingRepo) InitTable()

InitTable makes sure the table is created in the db

func (*CertificateBindingRepo) ListByCertificateUUID

func (r *CertificateBindingRepo) ListByCertificateUUID(certificateUUID string) (interface{}, error)

func (*CertificateBindingRepo) ListByParticipantUUID

func (r *CertificateBindingRepo) ListByParticipantUUID(participantUUID string) (interface{}, error)

type CertificateRepo

type CertificateRepo struct{}

CertificateRepo is the implementation of the repo.CertificateRepository interface

func (*CertificateRepo) Create

func (r *CertificateRepo) Create(instance interface{}) error

func (*CertificateRepo) DeleteByUUID

func (r *CertificateRepo) DeleteByUUID(uuid string) error

func (*CertificateRepo) GetBySerialNumber

func (r *CertificateRepo) GetBySerialNumber(serialNumberStr string) (interface{}, error)

func (*CertificateRepo) GetByUUID

func (r *CertificateRepo) GetByUUID(uuid string) (interface{}, error)

func (*CertificateRepo) InitTable

func (r *CertificateRepo) InitTable()

InitTable makes sure the table is created in the db

func (*CertificateRepo) List

func (r *CertificateRepo) List() (interface{}, error)

type ChartMockRepo

type ChartMockRepo struct{}

ChartMockRepo is the implementation of the repo.ChartRepository interface The data is hard-coded for now as the template to generate the final yaml content is hard to be customized by the end users.

func (*ChartMockRepo) Create

func (r *ChartMockRepo) Create(instance interface{}) error

func (*ChartMockRepo) DeleteByUUID

func (r *ChartMockRepo) DeleteByUUID(uuid string) error

func (*ChartMockRepo) GetByNameAndVersion added in v0.3.0

func (r *ChartMockRepo) GetByNameAndVersion(chartName, version string) (interface{}, error)

func (*ChartMockRepo) GetByUUID

func (r *ChartMockRepo) GetByUUID(uuid string) (interface{}, error)

func (*ChartMockRepo) List

func (r *ChartMockRepo) List() (interface{}, error)

func (*ChartMockRepo) ListByType

func (r *ChartMockRepo) ListByType(instance interface{}) (interface{}, error)

type EndpointKubeFATERepo

type EndpointKubeFATERepo struct{}

EndpointKubeFATERepo is the implementation of the repo.EndpointRepository interface

func (*EndpointKubeFATERepo) Create

func (r *EndpointKubeFATERepo) Create(instance interface{}) error

func (*EndpointKubeFATERepo) DeleteByUUID

func (r *EndpointKubeFATERepo) DeleteByUUID(uuid string) error

func (*EndpointKubeFATERepo) GetByUUID

func (r *EndpointKubeFATERepo) GetByUUID(uuid string) (interface{}, error)

func (*EndpointKubeFATERepo) InitTable

func (r *EndpointKubeFATERepo) InitTable()

InitTable makes sure the table is created in the db

func (*EndpointKubeFATERepo) List

func (r *EndpointKubeFATERepo) List() (interface{}, error)

func (*EndpointKubeFATERepo) ListByInfraProviderUUID

func (r *EndpointKubeFATERepo) ListByInfraProviderUUID(infraUUID string) (interface{}, error)

func (*EndpointKubeFATERepo) ListByInfraProviderUUIDAndNamespace added in v0.2.0

func (r *EndpointKubeFATERepo) ListByInfraProviderUUIDAndNamespace(infraUUID string, namespace string) (interface{}, error)

func (*EndpointKubeFATERepo) UpdateInfoByUUID

func (r *EndpointKubeFATERepo) UpdateInfoByUUID(instance interface{}) error

func (*EndpointKubeFATERepo) UpdateStatusByUUID

func (r *EndpointKubeFATERepo) UpdateStatusByUUID(instance interface{}) error

type EventRepo

type EventRepo struct{}

EventRepo is the implementation of the repo.EventRepository interface

func (*EventRepo) Create

func (r *EventRepo) Create(instance interface{}) error

func (*EventRepo) InitTable

func (r *EventRepo) InitTable()

InitTable makes sure the table is created in the db

func (*EventRepo) ListByEntityUUID

func (r *EventRepo) ListByEntityUUID(EntityUUID string) (interface{}, error)

type FederationFATERepo

type FederationFATERepo struct{}

FederationFATERepo implements the repo.FederationRepository interface

func (*FederationFATERepo) Create

func (r *FederationFATERepo) Create(instance interface{}) error

func (*FederationFATERepo) DeleteByUUID

func (r *FederationFATERepo) DeleteByUUID(uuid string) error

func (*FederationFATERepo) GetByUUID

func (r *FederationFATERepo) GetByUUID(uuid string) (interface{}, error)

func (*FederationFATERepo) InitTable

func (r *FederationFATERepo) InitTable()

InitTable makes sure the table is created in the db

func (*FederationFATERepo) List

func (r *FederationFATERepo) List() (interface{}, error)

type FederationOpenFLRepo

type FederationOpenFLRepo struct{}

FederationOpenFLRepo implements the repo.FederationRepository interface

func (*FederationOpenFLRepo) Create

func (r *FederationOpenFLRepo) Create(instance interface{}) error

func (*FederationOpenFLRepo) DeleteByUUID

func (r *FederationOpenFLRepo) DeleteByUUID(uuid string) error

func (*FederationOpenFLRepo) GetByUUID

func (r *FederationOpenFLRepo) GetByUUID(uuid string) (interface{}, error)

func (*FederationOpenFLRepo) InitTable

func (r *FederationOpenFLRepo) InitTable()

InitTable makes sure the table is created in the db

func (*FederationOpenFLRepo) List

func (r *FederationOpenFLRepo) List() (interface{}, error)

type InfraProviderKubernetesRepo

type InfraProviderKubernetesRepo struct{}

InfraProviderKubernetesRepo is the implementation of the repo.InfraProviderRepository interface

func (*InfraProviderKubernetesRepo) Create

func (r *InfraProviderKubernetesRepo) Create(instance interface{}) error

Create creates a record in the DB

func (*InfraProviderKubernetesRepo) DeleteByUUID

func (r *InfraProviderKubernetesRepo) DeleteByUUID(uuid string) error

DeleteByUUID deletes records using the specified uuid

func (*InfraProviderKubernetesRepo) GetByConfigSHA256 added in v0.2.0

func (r *InfraProviderKubernetesRepo) GetByConfigSHA256(sha256 string) (interface{}, error)

func (*InfraProviderKubernetesRepo) GetByUUID

func (r *InfraProviderKubernetesRepo) GetByUUID(uuid string) (interface{}, error)

GetByUUID returns the specified provider

func (*InfraProviderKubernetesRepo) InitTable

func (r *InfraProviderKubernetesRepo) InitTable()

InitTable makes sure the table is created in the db

func (*InfraProviderKubernetesRepo) List

func (r *InfraProviderKubernetesRepo) List() (interface{}, error)

List returns provider list

func (*InfraProviderKubernetesRepo) ProviderExists

func (r *InfraProviderKubernetesRepo) ProviderExists(instance interface{}) error

ProviderExists checks if a provider already exists in database according to provider's name and config_sha256

func (*InfraProviderKubernetesRepo) UpdateByUUID

func (r *InfraProviderKubernetesRepo) UpdateByUUID(instance interface{}) error

type ParticipantFATERepo

type ParticipantFATERepo struct{}

ParticipantFATERepo implements the repo.ParticipantFATERepository interface

func (*ParticipantFATERepo) Create

func (r *ParticipantFATERepo) Create(instance interface{}) error

func (*ParticipantFATERepo) DeleteByUUID

func (r *ParticipantFATERepo) DeleteByUUID(uuid string) error

func (*ParticipantFATERepo) GetByUUID

func (r *ParticipantFATERepo) GetByUUID(uuid string) (interface{}, error)

func (*ParticipantFATERepo) GetExchangeByFederationUUID

func (r *ParticipantFATERepo) GetExchangeByFederationUUID(uuid string) (interface{}, error)

func (*ParticipantFATERepo) InitTable

func (r *ParticipantFATERepo) InitTable()

InitTable makes sure the table is created in the db

func (*ParticipantFATERepo) IsConflictedByFederationUUIDAndPartyID

func (r *ParticipantFATERepo) IsConflictedByFederationUUIDAndPartyID(federationUUID string, partyID int) (bool, error)

func (*ParticipantFATERepo) IsExchangeCreatedByFederationUUID

func (r *ParticipantFATERepo) IsExchangeCreatedByFederationUUID(uuid string) (bool, error)

func (*ParticipantFATERepo) List

func (r *ParticipantFATERepo) List() (interface{}, error)

func (*ParticipantFATERepo) ListByEndpointUUID

func (r *ParticipantFATERepo) ListByEndpointUUID(endpointUUID string) (interface{}, error)

func (*ParticipantFATERepo) ListByFederationUUID

func (r *ParticipantFATERepo) ListByFederationUUID(federationUUID string) (interface{}, error)

func (*ParticipantFATERepo) UpdateDeploymentYAMLByUUID

func (r *ParticipantFATERepo) UpdateDeploymentYAMLByUUID(instance interface{}) error

func (*ParticipantFATERepo) UpdateInfoByUUID

func (r *ParticipantFATERepo) UpdateInfoByUUID(instance interface{}) error

func (*ParticipantFATERepo) UpdateStatusByUUID

func (r *ParticipantFATERepo) UpdateStatusByUUID(instance interface{}) error

type ParticipantOpenFLRepo

type ParticipantOpenFLRepo struct{}

ParticipantOpenFLRepo implements repo.ParticipantOpenFLRepository interface

func (*ParticipantOpenFLRepo) CountByTokenUUID

func (r *ParticipantOpenFLRepo) CountByTokenUUID(uuid string) (int, error)

func (*ParticipantOpenFLRepo) Create

func (r *ParticipantOpenFLRepo) Create(instance interface{}) error

func (*ParticipantOpenFLRepo) DeleteByUUID

func (r *ParticipantOpenFLRepo) DeleteByUUID(uuid string) error

func (*ParticipantOpenFLRepo) GetByUUID

func (r *ParticipantOpenFLRepo) GetByUUID(uuid string) (interface{}, error)

func (*ParticipantOpenFLRepo) GetDirectorByFederationUUID

func (r *ParticipantOpenFLRepo) GetDirectorByFederationUUID(uuid string) (interface{}, error)

func (*ParticipantOpenFLRepo) InitTable

func (r *ParticipantOpenFLRepo) InitTable()

InitTable makes sure the table is created in the db

func (*ParticipantOpenFLRepo) IsDirectorCreatedByFederationUUID

func (r *ParticipantOpenFLRepo) IsDirectorCreatedByFederationUUID(uuid string) (bool, error)

func (*ParticipantOpenFLRepo) List

func (r *ParticipantOpenFLRepo) List() (interface{}, error)

func (*ParticipantOpenFLRepo) ListByEndpointUUID

func (r *ParticipantOpenFLRepo) ListByEndpointUUID(endpointUUID string) (interface{}, error)

func (*ParticipantOpenFLRepo) ListByFederationUUID

func (r *ParticipantOpenFLRepo) ListByFederationUUID(federationUUID string) (interface{}, error)

func (*ParticipantOpenFLRepo) UpdateDeploymentYAMLByUUID

func (r *ParticipantOpenFLRepo) UpdateDeploymentYAMLByUUID(instance interface{}) error

func (*ParticipantOpenFLRepo) UpdateInfoByUUID

func (r *ParticipantOpenFLRepo) UpdateInfoByUUID(instance interface{}) error

func (*ParticipantOpenFLRepo) UpdateStatusByUUID

func (r *ParticipantOpenFLRepo) UpdateStatusByUUID(instance interface{}) error

type RegistrationTokenOpenFLRepo

type RegistrationTokenOpenFLRepo struct{}

RegistrationTokenOpenFLRepo implements repo.RegistrationTokenRepository interface

func (*RegistrationTokenOpenFLRepo) Create

func (r *RegistrationTokenOpenFLRepo) Create(instance interface{}) error

func (*RegistrationTokenOpenFLRepo) DeleteByFederation

func (r *RegistrationTokenOpenFLRepo) DeleteByFederation(federationUUID string) error

func (*RegistrationTokenOpenFLRepo) DeleteByUUID

func (r *RegistrationTokenOpenFLRepo) DeleteByUUID(uuid string) error

func (*RegistrationTokenOpenFLRepo) GetByUUID

func (r *RegistrationTokenOpenFLRepo) GetByUUID(uuid string) (interface{}, error)

func (*RegistrationTokenOpenFLRepo) InitTable

func (r *RegistrationTokenOpenFLRepo) InitTable()

InitTable makes sure the table is created in the db

func (*RegistrationTokenOpenFLRepo) ListByFederation

func (r *RegistrationTokenOpenFLRepo) ListByFederation(federationUUID string) (interface{}, error)

func (*RegistrationTokenOpenFLRepo) LoadByTypeAndStr

func (r *RegistrationTokenOpenFLRepo) LoadByTypeAndStr(instance interface{}) error

type UserRepo

type UserRepo struct{}

UserRepo implements repo.UserRepository using gorm and PostgreSQL

func (*UserRepo) CreateUser

func (r *UserRepo) CreateUser(instance interface{}) error

CreateUser creates a new user

func (*UserRepo) GetByName

func (r *UserRepo) GetByName(name string) (*entity.User, error)

GetByName returns the user info indexed by the name

func (*UserRepo) InitData

func (r *UserRepo) InitData()

InitData inserts a default users information

func (*UserRepo) InitTable

func (r *UserRepo) InitTable()

InitTable makes sure the table is created in the db

func (*UserRepo) LoadById

func (r *UserRepo) LoadById(instance interface{}) error

LoadById loads the user info by id

func (*UserRepo) LoadByName

func (r *UserRepo) LoadByName(instance interface{}) error

LoadByName loads the user info by name

func (*UserRepo) UpdateByName

func (r *UserRepo) UpdateByName(updatedUser *entity.User) error

UpdateByName changes the specified user's info

func (*UserRepo) UpdatePasswordById

func (r *UserRepo) UpdatePasswordById(id uint, hashedPassword string) error

UpdatePasswordById changes the user's hashed password

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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