Documentation ¶
Index ¶
- func Decrypt(ciphertext []byte, key *[32]byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte, key *[32]byte) (ciphertext []byte, err error)
- func GenerateRandomBytes(n int) (string, error)
- func NewEncryptionKey() *[32]byte
- type AWSIntegrationRepository
- type AuthCodeRepository
- type BasicIntegrationRepository
- type ClusterRepository
- type DNSRecordRepository
- type EventRepository
- type GCPIntegrationRepository
- type GitActionConfigRepository
- type GitRepoRepository
- type GithubAppInstallationRepository
- type GithubAppOAuthIntegrationRepository
- type HelmRepoRepository
- type InfraRepository
- type InviteRepository
- type KubeIntegrationRepository
- type NotificationConfigRepository
- type OAuthIntegrationRepository
- type OIDCIntegrationRepository
- type PWResetTokenRepository
- type ProjectRepository
- type RegistryRepository
- type ReleaseRepository
- type Repository
- type SessionRepository
- type SlackIntegrationRepository
- type UserRepository
- type WriteProject
- type WriteRelease
- type WriteUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.
func GenerateRandomBytes ¶
NewRandomString generates a random string. It panics if the source of randomness fails.
func NewEncryptionKey ¶
func NewEncryptionKey() *[32]byte
NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). It panics if the source of randomness fails.
Types ¶
type AWSIntegrationRepository ¶
type AWSIntegrationRepository interface { CreateAWSIntegration(am *ints.AWSIntegration) (*ints.AWSIntegration, error) OverwriteAWSIntegration(am *ints.AWSIntegration) (*ints.AWSIntegration, error) ReadAWSIntegration(projectID, id uint) (*ints.AWSIntegration, error) ListAWSIntegrationsByProjectID(projectID uint) ([]*ints.AWSIntegration, error) }
AWSIntegrationRepository represents the set of queries on the AWS auth mechanism
type AuthCodeRepository ¶
type AuthCodeRepository interface { CreateAuthCode(a *models.AuthCode) (*models.AuthCode, error) ReadAuthCode(code string) (*models.AuthCode, error) }
AuthCodeRepository represents the set of queries on the AuthCode model
type BasicIntegrationRepository ¶
type BasicIntegrationRepository interface { CreateBasicIntegration(am *ints.BasicIntegration) (*ints.BasicIntegration, error) ReadBasicIntegration(projectID, id uint) (*ints.BasicIntegration, error) ListBasicIntegrationsByProjectID(projectID uint) ([]*ints.BasicIntegration, error) }
BasicIntegrationRepository represents the set of queries on the "basic" auth mechanism
type ClusterRepository ¶
type ClusterRepository interface { CreateClusterCandidate(cc *models.ClusterCandidate) (*models.ClusterCandidate, error) ReadClusterCandidate(projectID, ccID uint) (*models.ClusterCandidate, error) ListClusterCandidatesByProjectID(projectID uint) ([]*models.ClusterCandidate, error) UpdateClusterCandidateCreatedClusterID(id uint, createdClusterID uint) (*models.ClusterCandidate, error) CreateCluster(cluster *models.Cluster) (*models.Cluster, error) ReadCluster(projectID, clusterID uint) (*models.Cluster, error) ListClustersByProjectID(projectID uint) ([]*models.Cluster, error) UpdateCluster(cluster *models.Cluster) (*models.Cluster, error) UpdateClusterTokenCache(tokenCache *ints.ClusterTokenCache) (*models.Cluster, error) DeleteCluster(cluster *models.Cluster) error }
ClusterRepository represents the set of queries on the Cluster model
type DNSRecordRepository ¶
type DNSRecordRepository interface {
CreateDNSRecord(record *models.DNSRecord) (*models.DNSRecord, error)
}
DNSRecordRepository represents the set of queries on the DNSRecord model
type EventRepository ¶ added in v0.9.0
type EventRepository interface { CreateEventContainer(am *models.EventContainer) (*models.EventContainer, error) CreateSubEvent(am *models.SubEvent) (*models.SubEvent, error) ReadEventsByContainerID(id uint) ([]*models.SubEvent, error) ReadEventContainer(id uint) (*models.EventContainer, error) ReadSubEvent(id uint) (*models.SubEvent, error) AppendEvent(container *models.EventContainer, event *models.SubEvent) error }
type GCPIntegrationRepository ¶
type GCPIntegrationRepository interface { CreateGCPIntegration(am *ints.GCPIntegration) (*ints.GCPIntegration, error) ReadGCPIntegration(projectID, id uint) (*ints.GCPIntegration, error) ListGCPIntegrationsByProjectID(projectID uint) ([]*ints.GCPIntegration, error) }
GCPIntegrationRepository represents the set of queries on the GCP auth mechanism
type GitActionConfigRepository ¶
type GitActionConfigRepository interface { CreateGitActionConfig(gr *models.GitActionConfig) (*models.GitActionConfig, error) ReadGitActionConfig(id uint) (*models.GitActionConfig, error) }
GitActionConfigRepository represents the set of queries on the GitActionConfig model
type GitRepoRepository ¶
type GitRepoRepository interface { CreateGitRepo(gr *models.GitRepo) (*models.GitRepo, error) ReadGitRepo(id uint) (*models.GitRepo, error) ListGitReposByProjectID(projectID uint) ([]*models.GitRepo, error) UpdateGitRepo(gr *models.GitRepo) (*models.GitRepo, error) DeleteGitRepo(gr *models.GitRepo) error }
GitRepoRepository represents the set of queries on the GitRepo model
type GithubAppInstallationRepository ¶ added in v0.5.0
type GithubAppInstallationRepository interface { CreateGithubAppInstallation(am *ints.GithubAppInstallation) (*ints.GithubAppInstallation, error) ReadGithubAppInstallationByInstallationID(gaID uint) (*ints.GithubAppInstallation, error) ReadGithubAppInstallationByAccountID(accountID int64) (*ints.GithubAppInstallation, error) ReadGithubAppInstallationByAccountIDs(accountIDs []int64) ([]*ints.GithubAppInstallation, error) DeleteGithubAppInstallationByAccountID(accountID int64) error }
GithubAppInstallationRepository represents the set of queries for github app installations
type GithubAppOAuthIntegrationRepository ¶ added in v0.5.0
type GithubAppOAuthIntegrationRepository interface { CreateGithubAppOAuthIntegration(am *ints.GithubAppOAuthIntegration) (*ints.GithubAppOAuthIntegration, error) ReadGithubAppOauthIntegration(id uint) (*ints.GithubAppOAuthIntegration, error) UpdateGithubAppOauthIntegration(am *ints.GithubAppOAuthIntegration) (*ints.GithubAppOAuthIntegration, error) }
GithubAppOAuthIntegrationRepository represents the set of queries on the oauth mechanism
type HelmRepoRepository ¶
type HelmRepoRepository interface { CreateHelmRepo(repo *models.HelmRepo) (*models.HelmRepo, error) ReadHelmRepo(projectID, hrID uint) (*models.HelmRepo, error) ListHelmReposByProjectID(projectID uint) ([]*models.HelmRepo, error) UpdateHelmRepo(repo *models.HelmRepo) (*models.HelmRepo, error) UpdateHelmRepoTokenCache(tokenCache *ints.HelmRepoTokenCache) (*models.HelmRepo, error) DeleteHelmRepo(repo *models.HelmRepo) error }
HelmRepoRepository represents the set of queries on the HelmRepo model
type InfraRepository ¶
type InfraRepository interface { CreateInfra(repo *models.Infra) (*models.Infra, error) ReadInfra(projectID, infraID uint) (*models.Infra, error) ListInfrasByProjectID(projectID uint) ([]*models.Infra, error) UpdateInfra(repo *models.Infra) (*models.Infra, error) }
InfraRepository represents the set of queries on the Infra model
type InviteRepository ¶
type InviteRepository interface { CreateInvite(invite *models.Invite) (*models.Invite, error) ReadInvite(projectID, inviteID uint) (*models.Invite, error) ReadInviteByToken(token string) (*models.Invite, error) ListInvitesByProjectID(projectID uint) ([]*models.Invite, error) UpdateInvite(invite *models.Invite) (*models.Invite, error) DeleteInvite(invite *models.Invite) error }
InviteRepository represents the set of queries on the Invite model
type KubeIntegrationRepository ¶
type KubeIntegrationRepository interface { CreateKubeIntegration(am *ints.KubeIntegration) (*ints.KubeIntegration, error) ReadKubeIntegration(projectID, id uint) (*ints.KubeIntegration, error) ListKubeIntegrationsByProjectID(projectID uint) ([]*ints.KubeIntegration, error) }
KubeIntegrationRepository represents the set of queries on the OIDC auth mechanism
type NotificationConfigRepository ¶ added in v0.8.0
type NotificationConfigRepository interface { CreateNotificationConfig(am *models.NotificationConfig) (*models.NotificationConfig, error) ReadNotificationConfig(id uint) (*models.NotificationConfig, error) UpdateNotificationConfig(am *models.NotificationConfig) (*models.NotificationConfig, error) }
type OAuthIntegrationRepository ¶
type OAuthIntegrationRepository interface { CreateOAuthIntegration(am *ints.OAuthIntegration) (*ints.OAuthIntegration, error) ReadOAuthIntegration(projectID, id uint) (*ints.OAuthIntegration, error) ListOAuthIntegrationsByProjectID(projectID uint) ([]*ints.OAuthIntegration, error) UpdateOAuthIntegration(am *ints.OAuthIntegration) (*ints.OAuthIntegration, error) }
OAuthIntegrationRepository represents the set of queries on the oauth mechanism
type OIDCIntegrationRepository ¶
type OIDCIntegrationRepository interface { CreateOIDCIntegration(am *ints.OIDCIntegration) (*ints.OIDCIntegration, error) ReadOIDCIntegration(projectID, id uint) (*ints.OIDCIntegration, error) ListOIDCIntegrationsByProjectID(projectID uint) ([]*ints.OIDCIntegration, error) }
OIDCIntegrationRepository represents the set of queries on the OIDC auth mechanism
type PWResetTokenRepository ¶
type PWResetTokenRepository interface { CreatePWResetToken(pwToken *models.PWResetToken) (*models.PWResetToken, error) ReadPWResetToken(id uint) (*models.PWResetToken, error) UpdatePWResetToken(pwToken *models.PWResetToken) (*models.PWResetToken, error) }
PWResetTokenRepository represents the set of queries on the PWResetToken model
type ProjectRepository ¶
type ProjectRepository interface { CreateProject(project *models.Project) (*models.Project, error) CreateProjectRole(project *models.Project, role *models.Role) (*models.Role, error) UpdateProjectRole(projID uint, role *models.Role) (*models.Role, error) ReadProject(id uint) (*models.Project, error) ReadProjectRole(projID, userID uint) (*models.Role, error) ListProjectRoles(projID uint) ([]models.Role, error) ListProjectsByUserID(userID uint) ([]*models.Project, error) DeleteProject(project *models.Project) (*models.Project, error) DeleteProjectRole(projID, userID uint) (*models.Role, error) }
ProjectRepository represents the set of queries on the Project model
type RegistryRepository ¶
type RegistryRepository interface { CreateRegistry(reg *models.Registry) (*models.Registry, error) ReadRegistry(projectID, regID uint) (*models.Registry, error) ListRegistriesByProjectID(projectID uint) ([]*models.Registry, error) UpdateRegistry(reg *models.Registry) (*models.Registry, error) UpdateRegistryTokenCache(tokenCache *ints.RegTokenCache) (*models.Registry, error) DeleteRegistry(reg *models.Registry) error }
RegistryRepository represents the set of queries on the Registry model
type ReleaseRepository ¶
type ReleaseRepository interface { CreateRelease(release *models.Release) (*models.Release, error) ReadRelease(clusterID uint, name, namespace string) (*models.Release, error) ReadReleaseByWebhookToken(token string) (*models.Release, error) ListReleasesByImageRepoURI(clusterID uint, imageRepoURI string) ([]*models.Release, error) UpdateRelease(release *models.Release) (*models.Release, error) DeleteRelease(release *models.Release) (*models.Release, error) }
ReleaseRepository represents the set of queries on the Release model
type Repository ¶
type Repository interface { User() UserRepository Project() ProjectRepository Release() ReleaseRepository Session() SessionRepository GitRepo() GitRepoRepository Cluster() ClusterRepository HelmRepo() HelmRepoRepository Registry() RegistryRepository Infra() InfraRepository GitActionConfig() GitActionConfigRepository Invite() InviteRepository AuthCode() AuthCodeRepository DNSRecord() DNSRecordRepository PWResetToken() PWResetTokenRepository KubeIntegration() KubeIntegrationRepository BasicIntegration() BasicIntegrationRepository OIDCIntegration() OIDCIntegrationRepository OAuthIntegration() OAuthIntegrationRepository GCPIntegration() GCPIntegrationRepository AWSIntegration() AWSIntegrationRepository GithubAppInstallation() GithubAppInstallationRepository GithubAppOAuthIntegration() GithubAppOAuthIntegrationRepository SlackIntegration() SlackIntegrationRepository NotificationConfig() NotificationConfigRepository Event() EventRepository }
type SessionRepository ¶
type SessionRepository interface { CreateSession(session *models.Session) (*models.Session, error) UpdateSession(session *models.Session) (*models.Session, error) DeleteSession(session *models.Session) (*models.Session, error) SelectSession(session *models.Session) (*models.Session, error) }
SessionRepository represents the set of queries on the Session model
type SlackIntegrationRepository ¶ added in v0.7.2
type SlackIntegrationRepository interface { CreateSlackIntegration(slackInt *ints.SlackIntegration) (*ints.SlackIntegration, error) ListSlackIntegrationsByProjectID(projectID uint) ([]*ints.SlackIntegration, error) DeleteSlackIntegration(integrationID uint) error }
SlackIntegrationRepository represents the set of queries on a Slack integration
type UserRepository ¶
type UserRepository interface { CreateUser(user *models.User) (*models.User, error) CheckPassword(id int, pwd string) (bool, error) ReadUser(id uint) (*models.User, error) ReadUserByEmail(email string) (*models.User, error) ReadUserByGithubUserID(id int64) (*models.User, error) ReadUserByGoogleUserID(id string) (*models.User, error) ListUsersByIDs(ids []uint) ([]*models.User, error) UpdateUser(user *models.User) (*models.User, error) DeleteUser(user *models.User) (*models.User, error) }
UserRepository represents the set of queries on the User model
type WriteProject ¶
WriteProject is the function type for all Project write operations
type WriteRelease ¶
WriteRelease is the function type for all Release write operations