Documentation ¶
Index ¶
- type AWSDataAction
- type ActionResolver
- type ClientCertDataAction
- type ClientKeyDataAction
- type ClusterCADataAction
- type CreateProjectForm
- type CreateProjectRoleForm
- type CreateServiceAccountCandidatesForm
- type CreateUserForm
- type DeleteUserForm
- type GCPKeyDataAction
- type GetReleaseForm
- type K8sForm
- type ListReleaseForm
- type ListReleaseHistoryForm
- type LoginUserForm
- type OIDCIssuerDataAction
- type ReleaseForm
- type RollbackReleaseForm
- type ServiceAccountActionResolver
- type TokenDataAction
- type UpgradeReleaseForm
- type WriteProjectForm
- type WriteUserForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSDataAction ¶
type AWSDataAction struct { *ServiceAccountActionResolver AWSAccessKeyID string `json:"aws_access_key_id" form:"required"` AWSSecretAccessKey string `json:"aws_secret_access_key" form:"required"` AWSClusterID string `json:"aws_cluster_id" form:"required"` }
AWSDataAction contains the AWS data (access id, key)
func (*AWSDataAction) PopulateServiceAccount ¶
func (akda *AWSDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add GCP key data to a ServiceAccount
type ActionResolver ¶
type ActionResolver interface {
PopulateServiceAccount(repo repository.ServiceAccountRepository) error
}
ActionResolver exposes an interface for resolving an action as a ServiceAccount. So that actions can be chained together, a pointer to a serviceAccount can be used -- if this points to nil, a new service account is created
type ClientCertDataAction ¶
type ClientCertDataAction struct { *ServiceAccountActionResolver ClientCertData string `json:"client_cert_data" form:"required"` }
ClientCertDataAction contains the base64 encoded cluster cert data
func (*ClientCertDataAction) PopulateServiceAccount ¶
func (ccda *ClientCertDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add client CA data to a ServiceAccount
type ClientKeyDataAction ¶
type ClientKeyDataAction struct { *ServiceAccountActionResolver ClientKeyData string `json:"client_key_data" form:"required"` }
ClientKeyDataAction contains the base64 encoded cluster key data
func (*ClientKeyDataAction) PopulateServiceAccount ¶
func (ckda *ClientKeyDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add client CA data to a ServiceAccount
type ClusterCADataAction ¶
type ClusterCADataAction struct { *ServiceAccountActionResolver ClusterCAData string `json:"cluster_ca_data" form:"required"` }
ClusterCADataAction contains the base64 encoded cluster CA data
func (*ClusterCADataAction) PopulateServiceAccount ¶
func (cda *ClusterCADataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add cluster ca data to a cluster in the ServiceAccount's list of clusters
type CreateProjectForm ¶
type CreateProjectForm struct { WriteProjectForm Name string `json:"name" form:"required"` }
CreateProjectForm represents the accepted values for creating a project
func (*CreateProjectForm) ToProject ¶
func (cpf *CreateProjectForm) ToProject(_ repository.ProjectRepository) (*models.Project, error)
ToProject converts the project to a gorm project model
type CreateProjectRoleForm ¶
type CreateProjectRoleForm struct { WriteProjectForm ID uint `json:"project_id" form:"required"` Roles []models.Role `json:"roles"` }
CreateProjectRoleForm represents the accepted values for creating a project role
func (*CreateProjectRoleForm) ToProject ¶
func (cprf *CreateProjectRoleForm) ToProject(_ repository.ProjectRepository) (*models.Project, error)
ToProject converts the form to a gorm project model
type CreateServiceAccountCandidatesForm ¶
type CreateServiceAccountCandidatesForm struct { ProjectID uint `json:"project_id"` Kubeconfig string `json:"kubeconfig"` }
CreateServiceAccountCandidatesForm represents the accepted values for creating a list of ServiceAccountCandidates from a kubeconfig
func (*CreateServiceAccountCandidatesForm) ToServiceAccountCandidates ¶
func (csa *CreateServiceAccountCandidatesForm) ToServiceAccountCandidates() ([]*models.ServiceAccountCandidate, error)
ToServiceAccountCandidates creates a ServiceAccountCandidate from the kubeconfig and project id
type CreateUserForm ¶
type CreateUserForm struct { WriteUserForm Email string `json:"email" form:"required,max=255,email"` Password string `json:"password" form:"required,max=255"` }
CreateUserForm represents the accepted values for creating a user
func (*CreateUserForm) ToUser ¶
func (cuf *CreateUserForm) ToUser(_ repository.UserRepository) (*models.User, error)
ToUser converts a CreateUserForm to models.User
type DeleteUserForm ¶
type DeleteUserForm struct { WriteUserForm ID uint `form:"required"` Password string `json:"password" form:"required,max=255"` }
DeleteUserForm represents the accepted values for deleting a user
func (*DeleteUserForm) ToUser ¶
func (uuf *DeleteUserForm) ToUser(_ repository.UserRepository) (*models.User, error)
ToUser converts a DeleteUserForm to models.User using the user ID
type GCPKeyDataAction ¶
type GCPKeyDataAction struct { *ServiceAccountActionResolver GCPKeyData string `json:"gcp_key_data" form:"required"` }
GCPKeyDataAction contains the GCP key data
func (*GCPKeyDataAction) PopulateServiceAccount ¶
func (gkda *GCPKeyDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add GCP key data to a ServiceAccount
type GetReleaseForm ¶
type GetReleaseForm struct { *ReleaseForm Name string `json:"name" form:"required"` Revision int `json:"revision"` }
GetReleaseForm represents the accepted values for getting a single Helm release
type K8sForm ¶
type K8sForm struct {
*kubernetes.OutOfClusterConfig
}
K8sForm is the generic base type for CRUD operations on k8s objects
func (*K8sForm) PopulateK8sOptionsFromQueryParams ¶
func (kf *K8sForm) PopulateK8sOptionsFromQueryParams( vals url.Values, repo repository.ServiceAccountRepository, ) error
PopulateK8sOptionsFromQueryParams populates fields in the ReleaseForm using the passed url.Values (the parsed query params)
type ListReleaseForm ¶
type ListReleaseForm struct { *ReleaseForm *helm.ListFilter }
ListReleaseForm represents the accepted values for listing Helm releases
func (*ListReleaseForm) PopulateListFromQueryParams ¶
func (lrf *ListReleaseForm) PopulateListFromQueryParams( vals url.Values, _ repository.ServiceAccountRepository, ) error
PopulateListFromQueryParams populates fields in the ListReleaseForm using the passed url.Values (the parsed query params)
type ListReleaseHistoryForm ¶
type ListReleaseHistoryForm struct { *ReleaseForm Name string `json:"name" form:"required"` }
ListReleaseHistoryForm represents the accepted values for getting a single Helm release
type LoginUserForm ¶
type LoginUserForm struct { WriteUserForm ID uint `form:"required"` Email string `json:"email" form:"required,max=255,email"` Password string `json:"password" form:"required,max=255"` }
LoginUserForm represents the accepted values for logging a user in
func (*LoginUserForm) ToUser ¶
func (luf *LoginUserForm) ToUser(_ repository.UserRepository) (*models.User, error)
ToUser converts a LoginUserForm to models.User
type OIDCIssuerDataAction ¶
type OIDCIssuerDataAction struct { *ServiceAccountActionResolver OIDCIssuerCAData string `json:"oidc_idp_issuer_ca_data" form:"required"` }
OIDCIssuerDataAction contains the base64 encoded IDP issuer CA data
func (*OIDCIssuerDataAction) PopulateServiceAccount ¶
func (oida *OIDCIssuerDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add OIDC issuer CA data to a ServiceAccount
type ReleaseForm ¶
ReleaseForm is the generic base type for CRUD operations on releases
func (*ReleaseForm) PopulateHelmOptionsFromQueryParams ¶
func (rf *ReleaseForm) PopulateHelmOptionsFromQueryParams( vals url.Values, repo repository.ServiceAccountRepository, ) error
PopulateHelmOptionsFromQueryParams populates fields in the ReleaseForm using the passed url.Values (the parsed query params)
type RollbackReleaseForm ¶
type RollbackReleaseForm struct { *ReleaseForm Name string `json:"name" form:"required"` Revision int `json:"revision" form:"required"` }
RollbackReleaseForm represents the accepted values for getting a single Helm release
type ServiceAccountActionResolver ¶
type ServiceAccountActionResolver struct { ServiceAccountCandidateID uint `json:"sa_candidate_id" form:"required"` SA *models.ServiceAccount SACandidate *models.ServiceAccountCandidate }
ServiceAccountActionResolver is the base type for resolving a ServiceAccountAction that belongs to a given ServiceAccountCandidate
func (*ServiceAccountActionResolver) PopulateServiceAccount ¶
func (sar *ServiceAccountActionResolver) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will create a service account if it does not exist, or will append a new cluster given by a ServiceAccountCandidate to the ServiceAccount
type TokenDataAction ¶
type TokenDataAction struct { *ServiceAccountActionResolver TokenData string `json:"token_data" form:"required"` }
TokenDataAction contains the token data to use
func (*TokenDataAction) PopulateServiceAccount ¶
func (tda *TokenDataAction) PopulateServiceAccount( repo repository.ServiceAccountRepository, ) error
PopulateServiceAccount will add bearer token data to a ServiceAccount
type UpgradeReleaseForm ¶
type UpgradeReleaseForm struct { *ReleaseForm Name string `json:"name" form:"required"` Values string `json:"values" form:"required"` }
UpgradeReleaseForm represents the accepted values for updating a Helm release
type WriteProjectForm ¶
type WriteProjectForm interface {
ToProject(repo repository.ProjectRepository) (*models.Project, error)
}
WriteProjectForm is a generic form for write operations to the Project model
type WriteUserForm ¶
type WriteUserForm interface {
ToUser(repo repository.UserRepository) (*models.User, error)
}
WriteUserForm is a generic form for write operations to the User model