gorm

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate added in v0.7.2

func AutoMigrate(db *gorm.DB) error

func NewAWSIntegrationRepository

func NewAWSIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.AWSIntegrationRepository

NewAWSIntegrationRepository returns a AWSIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewAuthCodeRepository

func NewAuthCodeRepository(db *gorm.DB) repository.AuthCodeRepository

NewAuthCodeRepository returns a AuthCodeRepository which uses gorm.DB for querying the database

func NewBasicIntegrationRepository

func NewBasicIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.BasicIntegrationRepository

NewBasicIntegrationRepository returns a BasicIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewClusterRepository

func NewClusterRepository(db *gorm.DB, key *[32]byte) repository.ClusterRepository

NewClusterRepository returns a ClusterRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewDNSRecordRepository

func NewDNSRecordRepository(db *gorm.DB) repository.DNSRecordRepository

NewDNSRecordRepository returns a DNSRecordRepository which uses gorm.DB for querying the database

func NewEventRepository added in v0.9.0

func NewEventRepository(db *gorm.DB) repository.EventRepository

NewEventRepository returns a EventRepository which uses gorm.DB for querying the database

func NewGCPIntegrationRepository

func NewGCPIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.GCPIntegrationRepository

NewGCPIntegrationRepository returns a GCPIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewGitActionConfigRepository

func NewGitActionConfigRepository(db *gorm.DB) repository.GitActionConfigRepository

NewGitActionConfigRepository returns a GitActionConfigRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewGitRepoRepository

func NewGitRepoRepository(db *gorm.DB, key *[32]byte) repository.GitRepoRepository

NewGitRepoRepository returns a GitRepoRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewGithubAppInstallationRepository added in v0.5.0

func NewGithubAppInstallationRepository(db *gorm.DB) repository.GithubAppInstallationRepository

NewGithubAppInstallationRepository creates a new GithubAppInstallationRepository

func NewGithubAppOAuthIntegrationRepository added in v0.5.0

func NewGithubAppOAuthIntegrationRepository(db *gorm.DB) repository.GithubAppOAuthIntegrationRepository

NewGithubAppOAuthIntegrationRepository creates a GithubAppOAuthIntegrationRepository

func NewHelmRepoRepository

func NewHelmRepoRepository(db *gorm.DB, key *[32]byte) repository.HelmRepoRepository

NewHelmRepoRepository returns a HelmRepoRepository which uses gorm.DB for querying the database

func NewInfraRepository

func NewInfraRepository(db *gorm.DB, key *[32]byte) repository.InfraRepository

NewInfraRepository returns a InfraRepository which uses gorm.DB for querying the database

func NewInviteRepository

func NewInviteRepository(db *gorm.DB) repository.InviteRepository

NewInviteRepository returns a InviteRepository which uses gorm.DB for querying the database

func NewKubeIntegrationRepository

func NewKubeIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.KubeIntegrationRepository

NewKubeIntegrationRepository returns a KubeIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewNotificationConfigRepository added in v0.8.0

func NewNotificationConfigRepository(db *gorm.DB) repository.NotificationConfigRepository

NewNotificationConfigRepository creates a new NotificationConfigRepository

func NewOAuthIntegrationRepository

func NewOAuthIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.OAuthIntegrationRepository

NewOAuthIntegrationRepository returns a OAuthIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewOIDCIntegrationRepository

func NewOIDCIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.OIDCIntegrationRepository

NewOIDCIntegrationRepository returns a OIDCIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewPWResetTokenRepository

func NewPWResetTokenRepository(db *gorm.DB) repository.PWResetTokenRepository

NewPWResetTokenRepository returns a PWResetTokenRepository which uses gorm.DB for querying the database

func NewProjectRepository

func NewProjectRepository(db *gorm.DB) repository.ProjectRepository

NewProjectRepository returns a ProjectRepository which uses gorm.DB for querying the database

func NewRegistryRepository

func NewRegistryRepository(db *gorm.DB, key *[32]byte) repository.RegistryRepository

NewRegistryRepository returns a RegistryRepository which uses gorm.DB for querying the database

func NewReleaseRepository

func NewReleaseRepository(db *gorm.DB) repository.ReleaseRepository

NewReleaseRepository returns a DefaultReleaseRepository which uses gorm.DB for querying the database

func NewRepository

func NewRepository(db *gorm.DB, key *[32]byte) repository.Repository

NewRepository returns a Repository which persists users in memory and accepts a parameter that can trigger read/write errors

func NewSessionRepository

func NewSessionRepository(db *gorm.DB) repository.SessionRepository

NewSessionRepository returns pointer to repo along with the db

func NewSlackIntegrationRepository added in v0.7.2

func NewSlackIntegrationRepository(
	db *gorm.DB,
	key *[32]byte,
) repository.SlackIntegrationRepository

NewSlackIntegrationRepository returns a SlackIntegrationRepository which uses gorm.DB for querying the database. It accepts an encryption key to encrypt sensitive data

func NewUserRepository

func NewUserRepository(db *gorm.DB) repository.UserRepository

NewUserRepository returns a DefaultUserRepository which uses gorm.DB for querying the database

Types

type AWSIntegrationRepository

type AWSIntegrationRepository struct {
	// contains filtered or unexported fields
}

AWSIntegrationRepository uses gorm.DB for querying the database

func (*AWSIntegrationRepository) CreateAWSIntegration

func (repo *AWSIntegrationRepository) CreateAWSIntegration(
	am *ints.AWSIntegration,
) (*ints.AWSIntegration, error)

CreateAWSIntegration creates a new aws auth mechanism

func (*AWSIntegrationRepository) DecryptAWSIntegrationData

func (repo *AWSIntegrationRepository) DecryptAWSIntegrationData(
	aws *ints.AWSIntegration,
	key *[32]byte,
) error

DecryptAWSIntegrationData will decrypt the aws integration data before returning it from the DB

func (*AWSIntegrationRepository) EncryptAWSIntegrationData

func (repo *AWSIntegrationRepository) EncryptAWSIntegrationData(
	aws *ints.AWSIntegration,
	key *[32]byte,
) error

EncryptAWSIntegrationData will encrypt the aws integration data before writing to the DB

func (*AWSIntegrationRepository) ListAWSIntegrationsByProjectID

func (repo *AWSIntegrationRepository) ListAWSIntegrationsByProjectID(
	projectID uint,
) ([]*ints.AWSIntegration, error)

ListAWSIntegrationsByProjectID finds all aws auth mechanisms for a given project id

func (*AWSIntegrationRepository) OverwriteAWSIntegration added in v0.4.0

func (repo *AWSIntegrationRepository) OverwriteAWSIntegration(
	am *ints.AWSIntegration,
) (*ints.AWSIntegration, error)

UpdateCluster modifies an existing Cluster in the database

func (*AWSIntegrationRepository) ReadAWSIntegration

func (repo *AWSIntegrationRepository) ReadAWSIntegration(
	projectID, id uint,
) (*ints.AWSIntegration, error)

ReadAWSIntegration finds a aws auth mechanism by id

type AuthCodeRepository

type AuthCodeRepository struct {
	// contains filtered or unexported fields
}

AuthCodeRepository uses gorm.DB for querying the database

func (*AuthCodeRepository) CreateAuthCode

func (repo *AuthCodeRepository) CreateAuthCode(a *models.AuthCode) (*models.AuthCode, error)

CreateAuthCode creates a new auth code

func (*AuthCodeRepository) ReadAuthCode

func (repo *AuthCodeRepository) ReadAuthCode(code string) (*models.AuthCode, error)

ReadAuthCode gets an invite specified by a unique token

type BasicIntegrationRepository

type BasicIntegrationRepository struct {
	// contains filtered or unexported fields
}

BasicIntegrationRepository uses gorm.DB for querying the database

func (*BasicIntegrationRepository) CreateBasicIntegration

func (repo *BasicIntegrationRepository) CreateBasicIntegration(
	am *ints.BasicIntegration,
) (*ints.BasicIntegration, error)

CreateBasicIntegration creates a new basic auth mechanism

func (*BasicIntegrationRepository) DecryptBasicIntegrationData

func (repo *BasicIntegrationRepository) DecryptBasicIntegrationData(
	basic *ints.BasicIntegration,
	key *[32]byte,
) error

DecryptBasicIntegrationData will decrypt the basic integration data before returning it from the DB

func (*BasicIntegrationRepository) EncryptBasicIntegrationData

func (repo *BasicIntegrationRepository) EncryptBasicIntegrationData(
	basic *ints.BasicIntegration,
	key *[32]byte,
) error

EncryptBasicIntegrationData will encrypt the basic integration data before writing to the DB

func (*BasicIntegrationRepository) ListBasicIntegrationsByProjectID

func (repo *BasicIntegrationRepository) ListBasicIntegrationsByProjectID(
	projectID uint,
) ([]*ints.BasicIntegration, error)

ListBasicIntegrationsByProjectID finds all basic auth mechanisms for a given project id

func (*BasicIntegrationRepository) ReadBasicIntegration

func (repo *BasicIntegrationRepository) ReadBasicIntegration(
	projectID, id uint,
) (*ints.BasicIntegration, error)

ReadBasicIntegration finds a basic auth mechanism by id

type ClusterRepository

type ClusterRepository struct {
	// contains filtered or unexported fields
}

ClusterRepository uses gorm.DB for querying the database

func (*ClusterRepository) CreateCluster

func (repo *ClusterRepository) CreateCluster(
	cluster *models.Cluster,
) (*models.Cluster, error)

CreateCluster creates a new cluster

func (*ClusterRepository) CreateClusterCandidate

func (repo *ClusterRepository) CreateClusterCandidate(
	cc *models.ClusterCandidate,
) (*models.ClusterCandidate, error)

CreateClusterCandidate creates a new cluster candidate

func (*ClusterRepository) DecryptClusterCandidateData

func (repo *ClusterRepository) DecryptClusterCandidateData(
	cc *models.ClusterCandidate,
	key *[32]byte,
) error

DecryptClusterCandidateData will decrypt the service account candidate data before returning it from the DB

func (*ClusterRepository) DecryptClusterData

func (repo *ClusterRepository) DecryptClusterData(
	cluster *models.Cluster,
	key *[32]byte,
) error

DecryptClusterData will decrypt the user's service account data before returning it from the DB

func (*ClusterRepository) DeleteCluster

func (repo *ClusterRepository) DeleteCluster(
	cluster *models.Cluster,
) error

DeleteCluster removes a cluster from the db

func (*ClusterRepository) EncryptClusterCandidateData

func (repo *ClusterRepository) EncryptClusterCandidateData(
	cc *models.ClusterCandidate,
	key *[32]byte,
) error

EncryptClusterCandidateData will encrypt the service account candidate data before writing to the DB

func (*ClusterRepository) EncryptClusterData

func (repo *ClusterRepository) EncryptClusterData(
	cluster *models.Cluster,
	key *[32]byte,
) error

EncryptClusterData will encrypt the user's service account data before writing to the DB

func (*ClusterRepository) ListClusterCandidatesByProjectID

func (repo *ClusterRepository) ListClusterCandidatesByProjectID(
	projectID uint,
) ([]*models.ClusterCandidate, error)

ListClusterCandidatesByProjectID finds all cluster candidates for a given project id

func (*ClusterRepository) ListClustersByProjectID

func (repo *ClusterRepository) ListClustersByProjectID(
	projectID uint,
) ([]*models.Cluster, error)

ListClustersByProjectID finds all clusters for a given project id

func (*ClusterRepository) ReadCluster

func (repo *ClusterRepository) ReadCluster(
	projectID, clusterID uint,
) (*models.Cluster, error)

ReadCluster finds a cluster by id

func (*ClusterRepository) ReadClusterCandidate

func (repo *ClusterRepository) ReadClusterCandidate(
	projectID, ccID uint,
) (*models.ClusterCandidate, error)

ReadClusterCandidate finds a cluster candidate by id

func (*ClusterRepository) UpdateCluster

func (repo *ClusterRepository) UpdateCluster(
	cluster *models.Cluster,
) (*models.Cluster, error)

UpdateCluster modifies an existing Cluster in the database

func (*ClusterRepository) UpdateClusterCandidateCreatedClusterID

func (repo *ClusterRepository) UpdateClusterCandidateCreatedClusterID(
	id uint,
	createdClusterID uint,
) (*models.ClusterCandidate, error)

UpdateClusterCandidateCreatedClusterID updates the CreatedClusterID for a candidate, after the candidate has been resolved.

func (*ClusterRepository) UpdateClusterTokenCache

func (repo *ClusterRepository) UpdateClusterTokenCache(
	tokenCache *ints.ClusterTokenCache,
) (*models.Cluster, error)

UpdateClusterTokenCache updates the token cache for a cluster

type DNSRecordRepository

type DNSRecordRepository struct {
	// contains filtered or unexported fields
}

DNSRecordRepository uses gorm.DB for querying the database

func (*DNSRecordRepository) CreateDNSRecord

func (repo *DNSRecordRepository) CreateDNSRecord(record *models.DNSRecord) (*models.DNSRecord, error)

CreateDNSRecord creates a new helm repo

type EventRepository added in v0.9.0

type EventRepository struct {
	// contains filtered or unexported fields
}

EventRepository holds both EventContainer and SubEvent models

func (EventRepository) AppendEvent added in v0.9.0

func (repo EventRepository) AppendEvent(container *models.EventContainer, event *models.SubEvent) error

AppendEvent will check if subevent with same (id, index) already exists if yes, overrite it, otherwise make a new subevent

func (EventRepository) CreateEventContainer added in v0.9.0

func (repo EventRepository) CreateEventContainer(am *models.EventContainer) (*models.EventContainer, error)

func (EventRepository) CreateSubEvent added in v0.9.0

func (repo EventRepository) CreateSubEvent(am *models.SubEvent) (*models.SubEvent, error)

func (EventRepository) ReadEventContainer added in v0.9.0

func (repo EventRepository) ReadEventContainer(id uint) (*models.EventContainer, error)

func (EventRepository) ReadEventsByContainerID added in v0.9.0

func (repo EventRepository) ReadEventsByContainerID(id uint) ([]*models.SubEvent, error)

func (EventRepository) ReadSubEvent added in v0.9.0

func (repo EventRepository) ReadSubEvent(id uint) (*models.SubEvent, error)

type GCPIntegrationRepository

type GCPIntegrationRepository struct {
	// contains filtered or unexported fields
}

GCPIntegrationRepository uses gorm.DB for querying the database

func (*GCPIntegrationRepository) CreateGCPIntegration

func (repo *GCPIntegrationRepository) CreateGCPIntegration(
	am *ints.GCPIntegration,
) (*ints.GCPIntegration, error)

CreateGCPIntegration creates a new gcp auth mechanism

func (*GCPIntegrationRepository) DecryptGCPIntegrationData

func (repo *GCPIntegrationRepository) DecryptGCPIntegrationData(
	gcp *ints.GCPIntegration,
	key *[32]byte,
) error

DecryptGCPIntegrationData will decrypt the gcp integration data before returning it from the DB

func (*GCPIntegrationRepository) EncryptGCPIntegrationData

func (repo *GCPIntegrationRepository) EncryptGCPIntegrationData(
	gcp *ints.GCPIntegration,
	key *[32]byte,
) error

EncryptGCPIntegrationData will encrypt the gcp integration data before writing to the DB

func (*GCPIntegrationRepository) ListGCPIntegrationsByProjectID

func (repo *GCPIntegrationRepository) ListGCPIntegrationsByProjectID(
	projectID uint,
) ([]*ints.GCPIntegration, error)

ListGCPIntegrationsByProjectID finds all gcp auth mechanisms for a given project id

func (*GCPIntegrationRepository) ReadGCPIntegration

func (repo *GCPIntegrationRepository) ReadGCPIntegration(
	projectID, id uint,
) (*ints.GCPIntegration, error)

ReadGCPIntegration finds a gcp auth mechanism by id

type GitActionConfigRepository

type GitActionConfigRepository struct {
	// contains filtered or unexported fields
}

GitActionConfigRepository uses gorm.DB for querying the database

func (*GitActionConfigRepository) CreateGitActionConfig

func (repo *GitActionConfigRepository) CreateGitActionConfig(ga *models.GitActionConfig) (*models.GitActionConfig, error)

CreateGitActionConfig creates a new git repo

func (*GitActionConfigRepository) ReadGitActionConfig

func (repo *GitActionConfigRepository) ReadGitActionConfig(id uint) (*models.GitActionConfig, error)

ReadGitActionConfig gets a git repo specified by a unique id

type GitRepoRepository

type GitRepoRepository struct {
	// contains filtered or unexported fields
}

GitRepoRepository uses gorm.DB for querying the database

func (*GitRepoRepository) CreateGitRepo

func (repo *GitRepoRepository) CreateGitRepo(gr *models.GitRepo) (*models.GitRepo, error)

CreateGitRepo creates a new git repo

func (*GitRepoRepository) DeleteGitRepo

func (repo *GitRepoRepository) DeleteGitRepo(
	gr *models.GitRepo,
) error

DeleteGitRepo removes a git repo from the db

func (*GitRepoRepository) ListGitReposByProjectID

func (repo *GitRepoRepository) ListGitReposByProjectID(
	projectID uint,
) ([]*models.GitRepo, error)

ListGitReposByProjectID finds all git repos for a given project id

func (*GitRepoRepository) ReadGitRepo

func (repo *GitRepoRepository) ReadGitRepo(id uint) (*models.GitRepo, error)

ReadGitRepo gets a git repo specified by a unique id

func (*GitRepoRepository) UpdateGitRepo

func (repo *GitRepoRepository) UpdateGitRepo(
	gr *models.GitRepo,
) (*models.GitRepo, error)

UpdateGitRepo modifies an existing GitRepo in the database

type GithubAppInstallationRepository added in v0.5.0

type GithubAppInstallationRepository struct {
	// contains filtered or unexported fields
}

GithubAppInstallationRepository implements repository.GithubAppInstallationRepository

func (*GithubAppInstallationRepository) CreateGithubAppInstallation added in v0.5.0

CreateGithubAppInstallation creates a new GithubAppInstallation instance

func (*GithubAppInstallationRepository) DeleteGithubAppInstallationByAccountID added in v0.5.0

func (repo *GithubAppInstallationRepository) DeleteGithubAppInstallationByAccountID(accountID int64) error

DeleteGithubAppInstallationByAccountID deletes a GithubAppInstallation given an account ID note that this deletion is done with db.Unscoped(), so the record is actually deleted

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByAccountID added in v0.5.0

func (repo *GithubAppInstallationRepository) ReadGithubAppInstallationByAccountID(accountID int64) (*ints.GithubAppInstallation, error)

ReadGithubAppInstallationByAccountID finds a GithubAppInstallation by an account ID

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByAccountIDs added in v0.5.0

func (repo *GithubAppInstallationRepository) ReadGithubAppInstallationByAccountIDs(accountIDs []int64) ([]*ints.GithubAppInstallation, error)

ReadGithubAppInstallationByAccountIDs finds all instances of GithubInstallations given a list of account IDs note that if there is not Installation for a given ID, no error will be generated

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByInstallationID added in v0.10.0

func (repo *GithubAppInstallationRepository) ReadGithubAppInstallationByInstallationID(gaID uint) (*ints.GithubAppInstallation, error)

ReadGithubAppInstallationByInstallationID finds a GithubAppInstallation by id

type GithubAppOAuthIntegrationRepository added in v0.5.0

type GithubAppOAuthIntegrationRepository struct {
	// contains filtered or unexported fields
}

GithubAppOAuthIntegrationRepository implements repository.GithubAppOAuthIntegrationRepository

func (*GithubAppOAuthIntegrationRepository) CreateGithubAppOAuthIntegration added in v0.5.0

CreateGithubAppOAuthIntegration creates a new GithubAppOAuthIntegration

func (*GithubAppOAuthIntegrationRepository) ReadGithubAppOauthIntegration added in v0.5.0

func (repo *GithubAppOAuthIntegrationRepository) ReadGithubAppOauthIntegration(id uint) (*ints.GithubAppOAuthIntegration, error)

ReadGithubAppOauthIntegration finds a GithubAppOauthIntegration by id

func (*GithubAppOAuthIntegrationRepository) UpdateGithubAppOauthIntegration added in v0.6.0

UpdateGithubAppOauthIntegration updates a GithubAppOauthIntegration

type GormRepository added in v0.10.0

type GormRepository struct {
	// contains filtered or unexported fields
}

func (*GormRepository) AWSIntegration added in v0.10.0

func (*GormRepository) AuthCode added in v0.10.0

func (*GormRepository) BasicIntegration added in v0.10.0

func (*GormRepository) Cluster added in v0.10.0

func (*GormRepository) DNSRecord added in v0.10.0

func (*GormRepository) Event added in v0.10.0

func (*GormRepository) GCPIntegration added in v0.10.0

func (*GormRepository) GitActionConfig added in v0.10.0

func (*GormRepository) GitRepo added in v0.10.0

func (*GormRepository) GithubAppInstallation added in v0.10.0

func (t *GormRepository) GithubAppInstallation() repository.GithubAppInstallationRepository

func (*GormRepository) GithubAppOAuthIntegration added in v0.10.0

func (t *GormRepository) GithubAppOAuthIntegration() repository.GithubAppOAuthIntegrationRepository

func (*GormRepository) HelmRepo added in v0.10.0

func (*GormRepository) Infra added in v0.10.0

func (*GormRepository) Invite added in v0.10.0

func (*GormRepository) KubeIntegration added in v0.10.0

func (*GormRepository) NotificationConfig added in v0.10.0

func (t *GormRepository) NotificationConfig() repository.NotificationConfigRepository

func (*GormRepository) OAuthIntegration added in v0.10.0

func (*GormRepository) OIDCIntegration added in v0.10.0

func (*GormRepository) PWResetToken added in v0.10.0

func (*GormRepository) Project added in v0.10.0

func (*GormRepository) Registry added in v0.10.0

func (*GormRepository) Release added in v0.10.0

func (*GormRepository) Session added in v0.10.0

func (*GormRepository) SlackIntegration added in v0.10.0

func (*GormRepository) User added in v0.10.0

type HelmRepoRepository

type HelmRepoRepository struct {
	// contains filtered or unexported fields
}

HelmRepoRepository uses gorm.DB for querying the database

func (*HelmRepoRepository) CreateHelmRepo

func (repo *HelmRepoRepository) CreateHelmRepo(hr *models.HelmRepo) (*models.HelmRepo, error)

CreateHelmRepo creates a new helm repo

func (*HelmRepoRepository) DecryptHelmRepoData

func (repo *HelmRepoRepository) DecryptHelmRepoData(
	hr *models.HelmRepo,
	key *[32]byte,
) error

DecryptHelmRepoData will decrypt the user's helm repo data before returning it from the DB

func (*HelmRepoRepository) DeleteHelmRepo

func (repo *HelmRepoRepository) DeleteHelmRepo(
	hr *models.HelmRepo,
) error

DeleteHelmRepo removes a registry from the db

func (*HelmRepoRepository) EncryptHelmRepoData

func (repo *HelmRepoRepository) EncryptHelmRepoData(
	hr *models.HelmRepo,
	key *[32]byte,
) error

EncryptHelmRepoData will encrypt the user's helm repo data before writing to the DB

func (*HelmRepoRepository) ListHelmReposByProjectID

func (repo *HelmRepoRepository) ListHelmReposByProjectID(
	projectID uint,
) ([]*models.HelmRepo, error)

ListHelmReposByProjectID finds all helm repos for a given project id

func (*HelmRepoRepository) ReadHelmRepo

func (repo *HelmRepoRepository) ReadHelmRepo(projectID, hrID uint) (*models.HelmRepo, error)

ReadHelmRepo gets a helm repo specified by a unique id

func (*HelmRepoRepository) UpdateHelmRepo

func (repo *HelmRepoRepository) UpdateHelmRepo(
	hr *models.HelmRepo,
) (*models.HelmRepo, error)

UpdateHelmRepo modifies an existing HelmRepo in the database

func (*HelmRepoRepository) UpdateHelmRepoTokenCache

func (repo *HelmRepoRepository) UpdateHelmRepoTokenCache(
	tokenCache *ints.HelmRepoTokenCache,
) (*models.HelmRepo, error)

UpdateHelmRepoTokenCache updates the helm repo for a registry

type InfraRepository

type InfraRepository struct {
	// contains filtered or unexported fields
}

InfraRepository uses gorm.DB for querying the database

func (*InfraRepository) CreateInfra

func (repo *InfraRepository) CreateInfra(infra *models.Infra) (*models.Infra, error)

CreateInfra creates a new aws infra

func (*InfraRepository) DecryptInfraData

func (repo *InfraRepository) DecryptInfraData(
	infra *models.Infra,
	key *[32]byte,
) error

DecryptInfraData will decrypt the user's infra data before returning it from the DB

func (*InfraRepository) EncryptInfraData

func (repo *InfraRepository) EncryptInfraData(
	infra *models.Infra,
	key *[32]byte,
) error

EncryptInfraData will encrypt the infra data before writing to the DB

func (*InfraRepository) ListInfrasByProjectID

func (repo *InfraRepository) ListInfrasByProjectID(
	projectID uint,
) ([]*models.Infra, error)

ListInfrasByProjectID finds all aws infras for a given project id

func (*InfraRepository) ReadInfra

func (repo *InfraRepository) ReadInfra(projectID, infraID uint) (*models.Infra, error)

ReadInfra gets a aws infra specified by a unique id

func (*InfraRepository) UpdateInfra

func (repo *InfraRepository) UpdateInfra(
	ai *models.Infra,
) (*models.Infra, error)

UpdateInfra modifies an existing Infra in the database

type InviteRepository

type InviteRepository struct {
	// contains filtered or unexported fields
}

InviteRepository uses gorm.DB for querying the database

func (*InviteRepository) CreateInvite

func (repo *InviteRepository) CreateInvite(invite *models.Invite) (*models.Invite, error)

CreateInvite creates a new invite

func (*InviteRepository) DeleteInvite

func (repo *InviteRepository) DeleteInvite(
	invite *models.Invite,
) error

DeleteInvite removes a registry from the db

func (*InviteRepository) ListInvitesByProjectID

func (repo *InviteRepository) ListInvitesByProjectID(
	projectID uint,
) ([]*models.Invite, error)

ListInvitesByProjectID finds all invites for a given project id

func (*InviteRepository) ReadInvite

func (repo *InviteRepository) ReadInvite(projectID, inviteID uint) (*models.Invite, error)

ReadInvite gets an invite specified by a unique id

func (*InviteRepository) ReadInviteByToken

func (repo *InviteRepository) ReadInviteByToken(token string) (*models.Invite, error)

ReadInviteByToken gets an invite specified by a unique token

func (*InviteRepository) UpdateInvite

func (repo *InviteRepository) UpdateInvite(
	invite *models.Invite,
) (*models.Invite, error)

UpdateInvite updates an invitation in the DB

type KubeIntegrationRepository

type KubeIntegrationRepository struct {
	// contains filtered or unexported fields
}

KubeIntegrationRepository uses gorm.DB for querying the database

func (*KubeIntegrationRepository) CreateKubeIntegration

func (repo *KubeIntegrationRepository) CreateKubeIntegration(
	am *ints.KubeIntegration,
) (*ints.KubeIntegration, error)

CreateKubeIntegration creates a new kube auth mechanism

func (*KubeIntegrationRepository) DecryptKubeIntegrationData

func (repo *KubeIntegrationRepository) DecryptKubeIntegrationData(
	ki *ints.KubeIntegration,
	key *[32]byte,
) error

DecryptKubeIntegrationData will decrypt the kube integration data before returning it from the DB

func (*KubeIntegrationRepository) EncryptKubeIntegrationData

func (repo *KubeIntegrationRepository) EncryptKubeIntegrationData(
	ki *ints.KubeIntegration,
	key *[32]byte,
) error

EncryptKubeIntegrationData will encrypt the kube integration data before writing to the DB

func (*KubeIntegrationRepository) ListKubeIntegrationsByProjectID

func (repo *KubeIntegrationRepository) ListKubeIntegrationsByProjectID(
	projectID uint,
) ([]*ints.KubeIntegration, error)

ListKubeIntegrationsByProjectID finds all kube auth mechanisms for a given project id

func (*KubeIntegrationRepository) ReadKubeIntegration

func (repo *KubeIntegrationRepository) ReadKubeIntegration(
	projectID, id uint,
) (*ints.KubeIntegration, error)

ReadKubeIntegration finds a kube auth mechanism by id

type NotificationConfigRepository added in v0.8.0

type NotificationConfigRepository struct {
	// contains filtered or unexported fields
}

func (NotificationConfigRepository) CreateNotificationConfig added in v0.8.0

CreateNotificationConfig creates a new NotificationConfig

func (NotificationConfigRepository) ReadNotificationConfig added in v0.8.0

func (repo NotificationConfigRepository) ReadNotificationConfig(id uint) (*models.NotificationConfig, error)

ReadNotificationConfig reads a NotificationConfig by ID

func (NotificationConfigRepository) UpdateNotificationConfig added in v0.8.0

UpdateNotificationConfig updates a given NotificationConfig

type OAuthIntegrationRepository

type OAuthIntegrationRepository struct {
	// contains filtered or unexported fields
}

OAuthIntegrationRepository uses gorm.DB for querying the database

func (*OAuthIntegrationRepository) CreateOAuthIntegration

func (repo *OAuthIntegrationRepository) CreateOAuthIntegration(
	am *ints.OAuthIntegration,
) (*ints.OAuthIntegration, error)

CreateOAuthIntegration creates a new oauth auth mechanism

func (*OAuthIntegrationRepository) DecryptOAuthIntegrationData

func (repo *OAuthIntegrationRepository) DecryptOAuthIntegrationData(
	oauth *ints.OAuthIntegration,
	key *[32]byte,
) error

DecryptOAuthIntegrationData will decrypt the oauth integration data before returning it from the DB

func (*OAuthIntegrationRepository) EncryptOAuthIntegrationData

func (repo *OAuthIntegrationRepository) EncryptOAuthIntegrationData(
	oauth *ints.OAuthIntegration,
	key *[32]byte,
) error

EncryptOAuthIntegrationData will encrypt the oauth integration data before writing to the DB

func (*OAuthIntegrationRepository) ListOAuthIntegrationsByProjectID

func (repo *OAuthIntegrationRepository) ListOAuthIntegrationsByProjectID(
	projectID uint,
) ([]*ints.OAuthIntegration, error)

ListOAuthIntegrationsByProjectID finds all oauth auth mechanisms for a given project id

func (*OAuthIntegrationRepository) ReadOAuthIntegration

func (repo *OAuthIntegrationRepository) ReadOAuthIntegration(
	projectID, id uint,
) (*ints.OAuthIntegration, error)

ReadOAuthIntegration finds a oauth auth mechanism by id

func (*OAuthIntegrationRepository) UpdateOAuthIntegration

func (repo *OAuthIntegrationRepository) UpdateOAuthIntegration(
	am *ints.OAuthIntegration,
) (*ints.OAuthIntegration, error)

UpdateOAuthIntegration modifies an existing oauth integration in the database

type OIDCIntegrationRepository

type OIDCIntegrationRepository struct {
	// contains filtered or unexported fields
}

OIDCIntegrationRepository uses gorm.DB for querying the database

func (*OIDCIntegrationRepository) CreateOIDCIntegration

func (repo *OIDCIntegrationRepository) CreateOIDCIntegration(
	am *ints.OIDCIntegration,
) (*ints.OIDCIntegration, error)

CreateOIDCIntegration creates a new oidc auth mechanism

func (*OIDCIntegrationRepository) DecryptOIDCIntegrationData

func (repo *OIDCIntegrationRepository) DecryptOIDCIntegrationData(
	oidc *ints.OIDCIntegration,
	key *[32]byte,
) error

DecryptOIDCIntegrationData will decrypt the kube integration data before returning it from the DB

func (*OIDCIntegrationRepository) EncryptOIDCIntegrationData

func (repo *OIDCIntegrationRepository) EncryptOIDCIntegrationData(
	oidc *ints.OIDCIntegration,
	key *[32]byte,
) error

EncryptOIDCIntegrationData will encrypt the oidc integration data before writing to the DB

func (*OIDCIntegrationRepository) ListOIDCIntegrationsByProjectID

func (repo *OIDCIntegrationRepository) ListOIDCIntegrationsByProjectID(
	projectID uint,
) ([]*ints.OIDCIntegration, error)

ListOIDCIntegrationsByProjectID finds all oidc auth mechanisms for a given project id

func (*OIDCIntegrationRepository) ReadOIDCIntegration

func (repo *OIDCIntegrationRepository) ReadOIDCIntegration(
	projectID, id uint,
) (*ints.OIDCIntegration, error)

ReadOIDCIntegration finds a oidc auth mechanism by id

type PWResetTokenRepository

type PWResetTokenRepository struct {
	// contains filtered or unexported fields
}

PWResetTokenRepository uses gorm.DB for querying the database

func (*PWResetTokenRepository) CreatePWResetToken

func (repo *PWResetTokenRepository) CreatePWResetToken(a *models.PWResetToken) (*models.PWResetToken, error)

CreatePWResetToken creates a new auth code

func (*PWResetTokenRepository) ReadPWResetToken

func (repo *PWResetTokenRepository) ReadPWResetToken(id uint) (*models.PWResetToken, error)

ReadPWResetToken gets an invite specified by a unique token

func (*PWResetTokenRepository) UpdatePWResetToken

func (repo *PWResetTokenRepository) UpdatePWResetToken(
	pwToken *models.PWResetToken,
) (*models.PWResetToken, error)

UpdatePWResetToken modifies an existing PWResetToken in the database

type ProjectRepository

type ProjectRepository struct {
	// contains filtered or unexported fields
}

ProjectRepository uses gorm.DB for querying the database

func (*ProjectRepository) CreateProject

func (repo *ProjectRepository) CreateProject(project *models.Project) (*models.Project, error)

CreateProject creates a new project

func (*ProjectRepository) CreateProjectRole

func (repo *ProjectRepository) CreateProjectRole(project *models.Project, role *models.Role) (*models.Role, error)

CreateProjectRole appends a role to the existing array of roles

func (*ProjectRepository) DeleteProject

func (repo *ProjectRepository) DeleteProject(project *models.Project) (*models.Project, error)

DeleteProject deletes a project (marking deleted in the db)

func (*ProjectRepository) DeleteProjectRole added in v0.5.0

func (repo *ProjectRepository) DeleteProjectRole(projID, userID uint) (*models.Role, error)

func (*ProjectRepository) ListProjectRoles added in v0.5.0

func (repo *ProjectRepository) ListProjectRoles(projID uint) ([]models.Role, error)

ReadProject gets a projects specified by a unique id

func (*ProjectRepository) ListProjectsByUserID

func (repo *ProjectRepository) ListProjectsByUserID(userID uint) ([]*models.Project, error)

ListProjectsByUserID lists projects where a user has an associated role

func (*ProjectRepository) ReadProject

func (repo *ProjectRepository) ReadProject(id uint) (*models.Project, error)

ReadProject gets a projects specified by a unique id

func (*ProjectRepository) ReadProjectRole added in v0.5.0

func (repo *ProjectRepository) ReadProjectRole(projID, userID uint) (*models.Role, error)

ReadProject gets a projects specified by a unique id

func (*ProjectRepository) UpdateProjectRole added in v0.5.0

func (repo *ProjectRepository) UpdateProjectRole(projID uint, role *models.Role) (*models.Role, error)

type RegistryRepository

type RegistryRepository struct {
	// contains filtered or unexported fields
}

RegistryRepository uses gorm.DB for querying the database

func (*RegistryRepository) CreateRegistry

func (repo *RegistryRepository) CreateRegistry(reg *models.Registry) (*models.Registry, error)

CreateRegistry creates a new registry

func (*RegistryRepository) DecryptRegistryData

func (repo *RegistryRepository) DecryptRegistryData(
	registry *models.Registry,
	key *[32]byte,
) error

DecryptRegistryData will decrypt the user's registry data before returning it from the DB

func (*RegistryRepository) DeleteRegistry

func (repo *RegistryRepository) DeleteRegistry(
	reg *models.Registry,
) error

DeleteRegistry removes a registry from the db

func (*RegistryRepository) EncryptRegistryData

func (repo *RegistryRepository) EncryptRegistryData(
	registry *models.Registry,
	key *[32]byte,
) error

EncryptRegistryData will encrypt the user's registry data before writing to the DB

func (*RegistryRepository) ListRegistriesByProjectID

func (repo *RegistryRepository) ListRegistriesByProjectID(
	projectID uint,
) ([]*models.Registry, error)

ListRegistriesByProjectID finds all registries for a given project id

func (*RegistryRepository) ReadRegistry

func (repo *RegistryRepository) ReadRegistry(projectID, regID uint) (*models.Registry, error)

ReadRegistry gets a registry specified by a unique id

func (*RegistryRepository) UpdateRegistry

func (repo *RegistryRepository) UpdateRegistry(
	reg *models.Registry,
) (*models.Registry, error)

UpdateRegistry modifies an existing Registry in the database

func (*RegistryRepository) UpdateRegistryTokenCache

func (repo *RegistryRepository) UpdateRegistryTokenCache(
	tokenCache *ints.RegTokenCache,
) (*models.Registry, error)

UpdateRegistryTokenCache updates the token cache for a registry

type ReleaseRepository

type ReleaseRepository struct {
	// contains filtered or unexported fields
}

ReleaseRepository uses gorm.DB for querying the database

func (*ReleaseRepository) CreateRelease

func (repo *ReleaseRepository) CreateRelease(release *models.Release) (*models.Release, error)

CreateRelease adds a new Release row to the Releases table in the database

func (*ReleaseRepository) DeleteRelease

func (repo *ReleaseRepository) DeleteRelease(release *models.Release) (*models.Release, error)

DeleteRelease deletes a single user using their unique name and namespace pair

func (*ReleaseRepository) ListReleasesByImageRepoURI added in v0.4.0

func (repo *ReleaseRepository) ListReleasesByImageRepoURI(clusterID uint, imageRepoURI string) ([]*models.Release, error)

ReadRelease finds a single release based on their unique name and namespace pair.

func (*ReleaseRepository) ReadRelease

func (repo *ReleaseRepository) ReadRelease(clusterID uint, name, namespace string) (*models.Release, error)

ReadRelease finds a single release based on their unique name and namespace pair.

func (*ReleaseRepository) ReadReleaseByWebhookToken

func (repo *ReleaseRepository) ReadReleaseByWebhookToken(token string) (*models.Release, error)

ReadReleaseByWebhookToken finds a single release based on their unique webhook token.

func (*ReleaseRepository) UpdateRelease

func (repo *ReleaseRepository) UpdateRelease(release *models.Release) (*models.Release, error)

UpdateRelease modifies an existing Release in the database

type SessionRepository

type SessionRepository struct {
	// contains filtered or unexported fields
}

SessionRepository uses gorm.DB for querying the database

func (*SessionRepository) CreateSession

func (s *SessionRepository) CreateSession(session *models.Session) (*models.Session, error)

CreateSession must take in Key, Data, and ExpiresAt as arguments.

func (*SessionRepository) DeleteSession

func (s *SessionRepository) DeleteSession(session *models.Session) (*models.Session, error)

DeleteSession deletes a session by Key

func (*SessionRepository) SelectSession

func (s *SessionRepository) SelectSession(session *models.Session) (*models.Session, error)

SelectSession returns a session with matching key

func (*SessionRepository) UpdateSession

func (s *SessionRepository) UpdateSession(session *models.Session) (*models.Session, error)

UpdateSession updates only the Data field using Key as selector.

type SlackIntegrationRepository added in v0.7.2

type SlackIntegrationRepository struct {
	// contains filtered or unexported fields
}

SlackIntegrationRepository uses gorm.DB for querying the database

func (*SlackIntegrationRepository) CreateSlackIntegration added in v0.7.2

func (repo *SlackIntegrationRepository) CreateSlackIntegration(
	slackInt *ints.SlackIntegration,
) (*ints.SlackIntegration, error)

CreateSlackIntegration creates a new kube auth mechanism

func (*SlackIntegrationRepository) DecryptSlackIntegrationData added in v0.7.2

func (repo *SlackIntegrationRepository) DecryptSlackIntegrationData(
	slackInt *ints.SlackIntegration,
	key *[32]byte,
) error

DecryptSlackIntegrationData will decrypt the slack integration data before returning it from the DB

func (*SlackIntegrationRepository) DeleteSlackIntegration added in v0.7.2

func (repo *SlackIntegrationRepository) DeleteSlackIntegration(
	integrationID uint,
) error

DeleteSlackIntegration deletes a slack integration by ID

func (*SlackIntegrationRepository) EncryptSlackIntegrationData added in v0.7.2

func (repo *SlackIntegrationRepository) EncryptSlackIntegrationData(
	slackInt *ints.SlackIntegration,
	key *[32]byte,
) error

EncryptSlackIntegrationData will encrypt the slack integration data before writing to the DB

func (*SlackIntegrationRepository) ListSlackIntegrationsByProjectID added in v0.7.2

func (repo *SlackIntegrationRepository) ListSlackIntegrationsByProjectID(
	projectID uint,
) ([]*ints.SlackIntegration, error)

ListSlackIntegrationsByProjectID finds all kube auth mechanisms for a given project id

type UserRepository

type UserRepository struct {
	// contains filtered or unexported fields
}

UserRepository uses gorm.DB for querying the database

func (*UserRepository) CheckPassword

func (repo *UserRepository) CheckPassword(id int, pwd string) (bool, error)

CheckPassword checks the input password is correct for the provided user id.

func (*UserRepository) CreateUser

func (repo *UserRepository) CreateUser(user *models.User) (*models.User, error)

CreateUser adds a new User row to the Users table in the database

func (*UserRepository) DeleteUser

func (repo *UserRepository) DeleteUser(user *models.User) (*models.User, error)

DeleteUser deletes a single user using their unique id

func (*UserRepository) ListUsersByIDs added in v0.5.0

func (repo *UserRepository) ListUsersByIDs(ids []uint) ([]*models.User, error)

ListUsersByIDs finds all users matching ids

func (*UserRepository) ReadUser

func (repo *UserRepository) ReadUser(id uint) (*models.User, error)

ReadUser finds a single user based on their unique id

func (*UserRepository) ReadUserByEmail

func (repo *UserRepository) ReadUserByEmail(email string) (*models.User, error)

ReadUserByEmail finds a single user based on their unique email

func (*UserRepository) ReadUserByGithubUserID

func (repo *UserRepository) ReadUserByGithubUserID(id int64) (*models.User, error)

ReadUserByGithubUserID finds a single user based on their github user id

func (*UserRepository) ReadUserByGoogleUserID added in v0.3.1

func (repo *UserRepository) ReadUserByGoogleUserID(id string) (*models.User, error)

ReadUserByGoogleUserID finds a single user based on their google user id

func (*UserRepository) UpdateUser

func (repo *UserRepository) UpdateUser(user *models.User) (*models.User, error)

UpdateUser modifies an existing User in the database

Jump to

Keyboard shortcuts

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