test

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateProjectMethod        string = "create_project_0"
	CreateProjectRoleMethod    string = "create_project_role_0"
	ReadProjectMethod          string = "read_project_0"
	ListProjectsByUserIDMethod string = "list_projects_by_user_id_0"
)
View Source
const (
	CreateSessionMethod string = "create_session_0"
	SelectSessionMethod string = "select_session_0"
)
View Source
const (
	CreateUserMethod      string = "create_user_0"
	ReadUserMethod        string = "read_user_0"
	ReadUserByEmailMethod string = "read_user_by_email_0"
	DeleteUserMethod      string = "delete_user_0"
)

Variables

This section is empty.

Functions

func NewAWSIntegrationRepository

func NewAWSIntegrationRepository(canQuery bool) repository.AWSIntegrationRepository

NewAWSIntegrationRepository will return errors if canQuery is false

func NewAuthCodeRepository

func NewAuthCodeRepository(canQuery bool) repository.AuthCodeRepository

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

func NewBasicIntegrationRepository

func NewBasicIntegrationRepository(canQuery bool) repository.BasicIntegrationRepository

NewBasicIntegrationRepository will return errors if canQuery is false

func NewClusterRepository

func NewClusterRepository(canQuery bool) repository.ClusterRepository

NewClusterRepository will return errors if canQuery is false

func NewDNSRecordRepository

func NewDNSRecordRepository(canQuery bool) repository.DNSRecordRepository

NewDNSRecordRepository will return errors if canQuery is false

func NewEventRepository

func NewEventRepository(canQuery bool) repository.EventRepository

func NewGCPIntegrationRepository

func NewGCPIntegrationRepository(canQuery bool) repository.GCPIntegrationRepository

NewGCPIntegrationRepository will return errors if canQuery is false

func NewGitActionConfigRepository

func NewGitActionConfigRepository(canQuery bool) repository.GitActionConfigRepository

func NewGitRepoRepository

func NewGitRepoRepository(canQuery bool) repository.GitRepoRepository

NewGitRepoRepository will return errors if canQuery is false

func NewGithubAppInstallationRepository

func NewGithubAppInstallationRepository(canQuery bool) repository.GithubAppInstallationRepository

func NewGithubAppOAuthIntegrationRepository

func NewGithubAppOAuthIntegrationRepository(canQuery bool) repository.GithubAppOAuthIntegrationRepository

func NewHelmRepoRepository

func NewHelmRepoRepository(canQuery bool) repository.HelmRepoRepository

NewHelmRepoRepository will return errors if canQuery is false

func NewInfraRepository

func NewInfraRepository(canQuery bool) repository.InfraRepository

NewInfraRepository will return errors if canQuery is false

func NewInviteRepository

func NewInviteRepository(canQuery bool) repository.InviteRepository

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

func NewKubeIntegrationRepository

func NewKubeIntegrationRepository(canQuery bool) repository.KubeIntegrationRepository

NewKubeIntegrationRepository will return errors if canQuery is false

func NewNotificationConfigRepository

func NewNotificationConfigRepository(canQuery bool) repository.NotificationConfigRepository

func NewOAuthIntegrationRepository

func NewOAuthIntegrationRepository(canQuery bool) repository.OAuthIntegrationRepository

NewOAuthIntegrationRepository will return errors if canQuery is false

func NewOIDCIntegrationRepository

func NewOIDCIntegrationRepository(canQuery bool) repository.OIDCIntegrationRepository

NewOIDCIntegrationRepository will return errors if canQuery is false

func NewPWResetTokenRepository

func NewPWResetTokenRepository(canQuery bool) repository.PWResetTokenRepository

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

func NewProjectRepository

func NewProjectRepository(canQuery bool, failingMethods ...string) repository.ProjectRepository

NewProjectRepository will return errors if canQuery is false

func NewRegistryRepository

func NewRegistryRepository(canQuery bool) repository.RegistryRepository

NewRegistryRepository will return errors if canQuery is false

func NewReleaseRepository

func NewReleaseRepository(canQuery bool) repository.ReleaseRepository

NewReleaseRepository will return errors if canQuery is false

func NewRepository

func NewRepository(canQuery bool, failingMethods ...string) 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(canQuery bool, failingMethods ...string) repository.SessionRepository

NewSessionRepository returns pointer to repo along with the db

func NewSlackIntegrationRepository

func NewSlackIntegrationRepository(canQuery bool) repository.SlackIntegrationRepository

func NewUserRepository

func NewUserRepository(canQuery bool, failingMethods ...string) repository.UserRepository

NewUserRepository will return errors if canQuery is false

Types

type AWSIntegrationRepository

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

AWSIntegrationRepository implements repository.AWSIntegrationRepository

func (*AWSIntegrationRepository) CreateAWSIntegration

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

CreateAWSIntegration creates a new aws auth mechanism

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

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

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 invite

func (*AuthCodeRepository) ReadAuthCode

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

ReadAuthCode gets an auth code object specified by the unique code

type BasicIntegrationRepository

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

BasicIntegrationRepository implements repository.BasicIntegrationRepository

func (*BasicIntegrationRepository) CreateBasicIntegration

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

CreateBasicIntegration creates a new basic auth mechanism

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 implements repository.ClusterRepository

func (*ClusterRepository) CreateCluster

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

CreateCluster creates a new servicea account

func (*ClusterRepository) CreateClusterCandidate

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

CreateClusterCandidate creates a new cluster candidate

func (*ClusterRepository) DeleteCluster

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

DeleteCluster removes a cluster from the array by setting it to nil

func (*ClusterRepository) ListClusterCandidatesByProjectID

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

ListClusterCandidatesByProjectID finds all service account candidates for a given project id

func (*ClusterRepository) ListClustersByProjectID

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

ListClustersByProjectID finds all service accounts for a given project id

func (*ClusterRepository) ReadCluster

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

ReadCluster finds a service account by id

func (*ClusterRepository) ReadClusterCandidate

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

ReadClusterCandidate finds a service account 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 implements repository.DNSRecordRepository

func (*DNSRecordRepository) CreateDNSRecord

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

CreateDNSRecord creates a new repoistry

type EventRepository

type EventRepository struct{}

func (*EventRepository) AppendEvent

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

func (*EventRepository) CreateEventContainer

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

func (*EventRepository) CreateSubEvent

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

func (*EventRepository) ReadEventContainer

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

func (*EventRepository) ReadEventsByContainerID

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

func (*EventRepository) ReadSubEvent

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

type GCPIntegrationRepository

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

GCPIntegrationRepository implements repository.GCPIntegrationRepository

func (*GCPIntegrationRepository) CreateGCPIntegration

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

CreateGCPIntegration creates a new gcp auth mechanism

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(gac *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 implements repository.GitRepoRepository

func (*GitRepoRepository) CreateGitRepo

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

CreateGitRepo creates a new repo client and appends it to the in-memory list

func (*GitRepoRepository) DeleteGitRepo

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

DeleteGitRepo removes a repoistry from the array by setting it to nil

func (*GitRepoRepository) ListGitReposByProjectID

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

ListGitReposByProjectID returns a list of repo clients that match a project id

func (*GitRepoRepository) ReadGitRepo

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

ReadGitRepo returns a repo client by id

func (*GitRepoRepository) UpdateGitRepo

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

UpdateGitRepo modifies an existing GitRepo in the database

type GithubAppInstallationRepository

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

GithubAppInstallationRepository implements repository.GithubAppInstallationRepository

func (*GithubAppInstallationRepository) CreateGithubAppInstallation

func (*GithubAppInstallationRepository) DeleteGithubAppInstallationByAccountID

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

func (*GithubAppInstallationRepository) ReadGithubAppInstallation

func (repo *GithubAppInstallationRepository) ReadGithubAppInstallation(projectID, id uint) (*ints.GithubAppInstallation, error)

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByAccountID

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

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByAccountIDs

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

func (*GithubAppInstallationRepository) ReadGithubAppInstallationByInstallationID

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

type GithubAppOAuthIntegrationRepository

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

func (*GithubAppOAuthIntegrationRepository) CreateGithubAppOAuthIntegration

func (*GithubAppOAuthIntegrationRepository) ReadGithubAppOauthIntegration

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

func (*GithubAppOAuthIntegrationRepository) UpdateGithubAppOauthIntegration

type HelmRepoRepository

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

HelmRepoRepository implements repository.HelmRepoRepository

func (*HelmRepoRepository) CreateHelmRepo

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

CreateHelmRepo creates a new repoistry

func (*HelmRepoRepository) DeleteHelmRepo

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

DeleteHelmRepo removes a repoistry from the array by setting it to nil

func (*HelmRepoRepository) ListHelmReposByProjectID

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

ListHelmReposByProjectID finds all repoistries for a given project id

func (*HelmRepoRepository) ReadHelmRepo

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

ReadHelmRepo finds a repoistry by 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 token cache for a repoistry

type InfraRepository

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

InfraRepository implements repository.InfraRepository

func (*InfraRepository) CreateInfra

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

CreateInfra creates a new aws infra

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,
	id uint,
) (*models.Infra, error)

ReadInfra finds a aws infra by 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, id 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 implements repository.KubeIntegrationRepository

func (*KubeIntegrationRepository) CreateKubeIntegration

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

CreateKubeIntegration creates a new kube auth mechanism

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

type NotificationConfigRepository struct{}

func (*NotificationConfigRepository) CreateNotificationConfig

func (*NotificationConfigRepository) ReadNotificationConfig

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

func (*NotificationConfigRepository) UpdateNotificationConfig

type OAuthIntegrationRepository

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

OAuthIntegrationRepository implements repository.OAuthIntegrationRepository

func (*OAuthIntegrationRepository) CreateOAuthIntegration

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

CreateOAuthIntegration creates a new o auth mechanism

func (*OAuthIntegrationRepository) ListOAuthIntegrationsByProjectID

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

ListOAuthIntegrationsByProjectID finds all o auth mechanisms for a given project id

func (*OAuthIntegrationRepository) ReadOAuthIntegration

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

ReadOAuthIntegration finds a o auth mechanism by id

func (*OAuthIntegrationRepository) UpdateOAuthIntegration

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

UpdateOAuthIntegration updates an oauth integration in the DB

type OIDCIntegrationRepository

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

OIDCIntegrationRepository implements repository.OIDCIntegrationRepository

func (*OIDCIntegrationRepository) CreateOIDCIntegration

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

CreateOIDCIntegration creates a new oidc auth mechanism

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 invite

func (*PWResetTokenRepository) ReadPWResetToken

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

ReadPWResetToken gets an auth code object specified by the unique code

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 will return errors on queries if canQuery is false and only stores a small set of projects in-memory that are indexed by their array index + 1

func (*ProjectRepository) CreateProject

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

CreateProject appends a new project to the in-memory projects array

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 removes a project

func (*ProjectRepository) DeleteProjectRole

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

func (*ProjectRepository) ListProjectRoles

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

ListProjectRoles returns a list of roles for the project

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

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

ReadProject gets a projects specified by a unique id

func (*ProjectRepository) UpdateProjectRole

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

CreateProjectRole appends a role to the existing array of roles

type RegistryRepository

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

RegistryRepository implements repository.RegistryRepository

func (*RegistryRepository) CreateRegistry

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

CreateRegistry creates a new registry

func (*RegistryRepository) DeleteRegistry

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

DeleteRegistry removes a registry from the array by setting it to nil

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 finds a registry by 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 implements repository.ReleaseRepository

func (*ReleaseRepository) CreateRelease

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

CreateRelease creates a new release

func (*ReleaseRepository) DeleteRelease

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

DeleteRelease removes a release from the array by setting it to nil

func (*ReleaseRepository) ListReleasesByImageRepoURI

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

ListReleasesByProjectID finds all releases for a given project id

func (*ReleaseRepository) ReadRelease

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

ReadRelease finds a release by id

func (*ReleaseRepository) ReadReleaseByWebhookToken

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

ReadRelease finds a release by id

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 (repo *SessionRepository) CreateSession(session *models.Session) (*models.Session, error)

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

func (*SessionRepository) DeleteSession

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

DeleteSession deletes a session by Key

func (*SessionRepository) SelectSession

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

SelectSession returns a session with matching key

func (*SessionRepository) UpdateSession

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

UpdateSession updates only the Data field using Key as selector.

type SlackIntegrationRepository

type SlackIntegrationRepository struct{}

func (*SlackIntegrationRepository) CreateSlackIntegration

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

func (*SlackIntegrationRepository) DeleteSlackIntegration

func (s *SlackIntegrationRepository) DeleteSlackIntegration(integrationID uint) error

func (*SlackIntegrationRepository) ListSlackIntegrationsByProjectID

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

type TestRepository

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

func (*TestRepository) AWSIntegration

func (*TestRepository) AuthCode

func (*TestRepository) BasicIntegration

func (*TestRepository) Cluster

func (*TestRepository) DNSRecord

func (*TestRepository) Event

func (*TestRepository) GCPIntegration

func (*TestRepository) GitActionConfig

func (*TestRepository) GitRepo

func (*TestRepository) GithubAppInstallation

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

func (*TestRepository) GithubAppOAuthIntegration

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

func (*TestRepository) HelmRepo

func (*TestRepository) Infra

func (*TestRepository) Invite

func (*TestRepository) KubeIntegration

func (*TestRepository) NotificationConfig

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

func (*TestRepository) OAuthIntegration

func (*TestRepository) OIDCIntegration

func (*TestRepository) PWResetToken

func (*TestRepository) Project

func (*TestRepository) Registry

func (*TestRepository) Release

func (*TestRepository) Session

func (*TestRepository) SlackIntegration

func (*TestRepository) User

type UserRepository

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

UserRepository will return errors on queries if canQuery is false and only stores a small set of users in-memory that are indexed by their array index + 1

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 array memory

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

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

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 id field

func (*UserRepository) ReadUserByGoogleUserID

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

ReadUserByGoogleUserID finds a single user based on their github id field

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