types

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EventStatusSuccess    EventStatus = 1
	EventStatusInProgress             = 2
	EventStatusFailed                 = 3
)
View Source
const RequestScopeCtxKey = "requestscopes"
View Source
const (
	URLParamInviteToken = "token"
)
View Source
const (
	URLParamSlackIntegrationID = "slack_integration_id"
)

Variables

View Source
var AdminPolicy = []*PolicyDocument{
	{
		Scope: ProjectScope,
		Verbs: ReadWriteVerbGroup(),
	},
}
View Source
var ClusterResolverInfos = map[ClusterResolverName]ClusterResolverInfo{
	ClusterCAData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "cluster_ca_data",
	},
	ClusterLocalhost: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "cluster_hostname",
	},
	ClientCertData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "client_cert_data",
	},
	ClientKeyData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "client_key_data",
	},
	OIDCIssuerData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "oidc_idp_issuer_ca_data",
	},
	TokenData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "token_data",
	},
	GCPKeyData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "gcp_key_data",
	},
	AWSData: {
		Docs:   "https://github.com/porter-dev/porter",
		Fields: "aws_access_key_id,aws_secret_access_key,aws_cluster_id",
	},
}

ClusterResolverInfos is a map of the information for actions to be performed in order to initialize a cluster

View Source
var DeveloperPolicy = []*PolicyDocument{
	{
		Scope: ProjectScope,
		Verbs: ReadWriteVerbGroup(),
		Children: map[PermissionScope]*PolicyDocument{
			SettingsScope: {
				Scope: SettingsScope,
				Verbs: ReadVerbGroup(),
			},
		},
	},
}
View Source
var PorterClusterIntegrations = []PorterIntegration{
	{
		AuthMechanism: "gcp",
		Category:      "cluster",
		Service:       string(GKE),
	},
	{
		AuthMechanism: "aws",
		Category:      "cluster",
		Service:       string(EKS),
	},
	{
		AuthMechanism: "kube",
		Category:      "cluster",
		Service:       string(Kube),
	},
}

PorterClusterIntegrations are the supported cluster integrations

View Source
var PorterHelmRepoIntegrations = []PorterIntegration{
	{
		AuthMechanism: "basic",
		Category:      "helm",
		Service:       "helmrepo",
	},
}

PorterHelmRepoIntegrations are the supported helm repo integrations

View Source
var PorterRegistryIntegrations = []PorterIntegration{
	{
		AuthMechanism: "gcp",
		Category:      "registry",
		Service:       string(GCR),
	},
	{
		AuthMechanism: "aws",
		Category:      "registry",
		Service:       string(ECR),
	},
	{
		AuthMechanism: "basic",
		Category:      "registry",
		Service:       string(DockerHub),
	},
}

PorterRegistryIntegrations are the supported registry integrations

ScopeHeirarchy describes the tree of scopes, i.e. Cluster, Registry, and Settings

are children of Project, Namespace is a child of Cluster, etc.

View Source
var ViewerPolicy = []*PolicyDocument{
	{
		Scope: ProjectScope,
		Verbs: ReadVerbGroup(),
		Children: map[PermissionScope]*PolicyDocument{
			SettingsScope: {
				Scope: SettingsScope,
				Verbs: []APIVerb{},
			},
		},
	},
}

Functions

This section is empty.

Types

type APIRequestMetadata added in v0.10.0

type APIRequestMetadata struct {
	Verb           APIVerb
	Method         HTTPVerb
	Path           *Path
	Scopes         []PermissionScope
	ShouldRedirect bool

	// Whether the endpoint should log
	Quiet bool
}

type APIVerb

type APIVerb string
const (
	APIVerbGet    APIVerb = "get"
	APIVerbCreate APIVerb = "create"
	APIVerbList   APIVerb = "list"
	APIVerbUpdate APIVerb = "update"
	APIVerbDelete APIVerb = "delete"
)

type APIVerbGroup

type APIVerbGroup []APIVerb

func ReadVerbGroup

func ReadVerbGroup() APIVerbGroup

func ReadWriteVerbGroup

func ReadWriteVerbGroup() APIVerbGroup

type AWSIntegration added in v0.10.0

type AWSIntegration struct {
	ID uint `json:"id"`

	// The id of the user that linked this auth mechanism
	UserID uint `json:"user_id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// The AWS arn this is integration is linked to
	AWSArn string `json:"aws_arn"`
}

type BasicIntegration added in v0.10.0

type BasicIntegration struct {
	ID uint `json:"id"`

	// The id of the user that linked this auth mechanism
	UserID uint `json:"user_id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`
}

type CLILoginExchangeRequest added in v0.10.0

type CLILoginExchangeRequest struct {
	AuthorizationCode string `json:"authorization_code" form:"required"`
}

type CLILoginExchangeResponse added in v0.10.0

type CLILoginExchangeResponse struct {
	Token string `json:"token" form:"required"`
}

type CLILoginUserRequest added in v0.10.0

type CLILoginUserRequest struct {
	Redirect string `schema:"redirect" form:"required"`
}

type Cluster added in v0.10.0

type Cluster struct {
	ID uint `json:"id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// Name of the cluster
	Name string `json:"name"`

	// Server endpoint for the cluster
	Server string `json:"server"`

	// The integration service for this cluster
	Service ClusterService `json:"service"`

	// The infra id, if cluster was provisioned with Porter
	InfraID uint `json:"infra_id"`

	// (optional) The aws integration id, if available
	AWSIntegrationID uint `json:"aws_integration_id"`
}

type ClusterCandidate added in v0.10.0

type ClusterCandidate struct {
	ID uint `json:"id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// CreatedClusterID is the ID of the cluster that's eventually
	// created
	CreatedClusterID uint `json:"created_cluster_id"`

	// Name of the cluster
	Name string `json:"name"`

	// Server endpoint for the cluster
	Server string `json:"server"`

	// Name of the context that this was created from, if it exists
	ContextName string `json:"context_name"`

	// Resolvers are the list of resolvers: once all resolvers are "resolved," the
	// cluster will be created
	Resolvers []ClusterResolver `json:"resolvers"`

	// The best-guess for the AWSClusterID, which is required by aws auth mechanisms
	// See https://github.com/kubernetes-sigs/aws-iam-authenticator#what-is-a-cluster-id
	AWSClusterIDGuess string `json:"aws_cluster_id_guess"`
}

type ClusterGetResponse added in v0.10.0

type ClusterGetResponse struct {
	*Cluster

	// The NGINX Ingress IP to access the cluster
	IngressIP string `json:"ingress_ip"`

	// Error displayed in case couldn't get the IP
	IngressError error `json:"ingress_error"`
}

type ClusterResolver added in v0.10.0

type ClusterResolver struct {
	ID uint `json:"id"`

	// The ClusterCandidate that this is resolving
	ClusterCandidateID uint `json:"cluster_candidate_id"`

	// One of the ClusterResolverNames
	Name ClusterResolverName `json:"name"`

	// Resolved is true if this has been resolved, false otherwise
	Resolved bool `json:"resolved"`

	// Docs is a link to documentation that helps resolve this manually
	Docs string `json:"docs"`

	// Fields is a list of fields that must be sent with the resolving request
	Fields string `json:"fields"`

	// Data is additional data for resolving the action, for example a file name,
	// context name, etc
	Data ClusterResolverData `json:"data,omitempty"`
}

type ClusterResolverAll added in v0.10.0

type ClusterResolverAll struct {
	ClusterCAData      string `json:"cluster_ca_data,omitempty"`
	ClusterHostname    string `json:"cluster_hostname,omitempty"`
	ClientCertData     string `json:"client_cert_data,omitempty"`
	ClientKeyData      string `json:"client_key_data,omitempty"`
	OIDCIssuerCAData   string `json:"oidc_idp_issuer_ca_data,omitempty"`
	TokenData          string `json:"token_data,omitempty"`
	GCPKeyData         string `json:"gcp_key_data,omitempty"`
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
	AWSClusterID       string `json:"aws_cluster_id"`
}

ClusterResolverAll is a helper type that contains the fields for all possible resolvers, so that raw bytes can be unmarshaled in a single read

type ClusterResolverData added in v0.10.0

type ClusterResolverData map[string]string

ClusterResolverData is a map of key names to fields, which gets marshaled from the raw JSON bytes stored in the ClusterResolver

type ClusterResolverInfo added in v0.10.0

type ClusterResolverInfo struct {
	// Docs is a link to documentation that helps resolve this manually
	Docs string `json:"docs"`

	// a comma-separated list of required fields to send in an action request
	Fields string `json:"fields"`
}

ClusterResolverInfo contains the information for actions to be performed in order to initialize a cluster

type ClusterResolverName added in v0.10.0

type ClusterResolverName string

ClusterResolverName is the name for a cluster resolve

const (
	ClusterCAData    ClusterResolverName = "upload-cluster-ca-data"
	ClusterLocalhost ClusterResolverName = "rewrite-cluster-localhost"
	ClientCertData   ClusterResolverName = "upload-client-cert-data"
	ClientKeyData    ClusterResolverName = "upload-client-key-data"
	OIDCIssuerData   ClusterResolverName = "upload-oidc-idp-issuer-ca-data"
	TokenData        ClusterResolverName = "upload-token-data"
	GCPKeyData       ClusterResolverName = "upload-gcp-key-data"
	AWSData          ClusterResolverName = "upload-aws-data"
)

Options for the cluster resolver names

type ClusterService added in v0.10.0

type ClusterService string
const (
	EKS  ClusterService = "eks"
	DOKS ClusterService = "doks"
	GKE  ClusterService = "gke"
	Kube ClusterService = "kube"
)

type Collaborator added in v0.10.0

type Collaborator struct {
	ID        uint   `json:"id"`
	Kind      string `json:"kind"`
	UserID    uint   `json:"user_id"`
	Email     string `json:"email"`
	ProjectID uint   `json:"project_id"`
}

type ConfigMapInput added in v0.10.0

type ConfigMapInput struct {
	Name            string
	Namespace       string
	Variables       map[string]string
	SecretVariables map[string]string
}

type CreateAWSRequest added in v0.10.0

type CreateAWSRequest struct {
	AWSRegion          string `json:"aws_region"`
	AWSClusterID       string `json:"aws_cluster_id"`
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
}

type CreateAWSResponse added in v0.10.0

type CreateAWSResponse struct {
	*AWSIntegration
}

type CreateAddonRequest added in v0.10.0

type CreateAddonRequest struct {
	*CreateReleaseBaseRequest
}

type CreateBasicRequest added in v0.10.0

type CreateBasicRequest struct {
	Username string `json:"username,required"`
	Password string `json:"password,required"`
}

type CreateBasicResponse added in v0.10.0

type CreateBasicResponse struct {
	*BasicIntegration
}

type CreateClusterCandidateRequest added in v0.10.0

type CreateClusterCandidateRequest struct {
	ProjectID  uint   `json:"project_id"`
	Kubeconfig string `json:"kubeconfig"`

	// Represents whether the auth mechanism should be designated as
	// "local": if so, the auth mechanism uses local plugins/mechanisms purely from the
	// kubeconfig.
	IsLocal bool `json:"is_local"`
}

type CreateClusterCandidateResponse added in v0.10.0

type CreateClusterCandidateResponse []*ClusterCandidate

type CreateClusterManualRequest added in v0.10.0

type CreateClusterManualRequest struct {
	Name      string `json:"name" form:"required"`
	ProjectID uint   `json:"project_id" form:"required"`
	Server    string `json:"server" form:"required"`

	GCPIntegrationID uint `json:"gcp_integration_id"`
	AWSIntegrationID uint `json:"aws_integration_id"`

	CertificateAuthorityData string `json:"certificate_authority_data,omitempty"`
}

type CreateConfigMapRequest added in v0.10.0

type CreateConfigMapRequest struct {
	Name            string            `json:"name,required"`
	Variables       map[string]string `json:"variables,required"`
	SecretVariables map[string]string `json:"secret_variables,required"`
}

type CreateConfigMapResponse added in v0.10.0

type CreateConfigMapResponse struct {
	*v1.ConfigMap
}

type CreateDOCRInfraRequest added in v0.10.0

type CreateDOCRInfraRequest struct {
	DOCRName             string `json:"docr_name" form:"required"`
	DOCRSubscriptionTier string `json:"docr_subscription_tier" form:"required"`
	ProjectID            uint   `json:"-" form:"required"`
	DOIntegrationID      uint   `json:"do_integration_id" form:"required"`
}

type CreateDOKSInfraRequest added in v0.10.0

type CreateDOKSInfraRequest struct {
	DORegion        string `json:"do_region" form:"required"`
	DOKSName        string `json:"doks_name" form:"required"`
	ProjectID       uint   `json:"-" form:"required"`
	DOIntegrationID uint   `json:"do_integration_id" form:"required"`
}

type CreateECRInfraRequest added in v0.10.0

type CreateECRInfraRequest struct {
	ECRName          string `json:"ecr_name" form:"required"`
	ProjectID        uint   `json:"-" form:"required"`
	AWSIntegrationID uint   `json:"aws_integration_id" form:"required"`
}

type CreateEKSInfraRequest added in v0.10.0

type CreateEKSInfraRequest struct {
	EKSName          string `json:"eks_name" form:"required"`
	MachineType      string `json:"machine_type"`
	ProjectID        uint   `json:"-" form:"required"`
	AWSIntegrationID uint   `json:"aws_integration_id" form:"required"`
}

type CreateGCPRequest added in v0.10.0

type CreateGCPRequest struct {
	GCPKeyData   string `json:"gcp_key_data" form:"required"`
	GCPProjectID string `json:"gcp_project_id"`
	GCPRegion    string `json:"gcp_region"`
}

type CreateGCPResponse added in v0.10.0

type CreateGCPResponse struct {
	*GCPIntegration
}

type CreateGCRInfraRequest added in v0.10.0

type CreateGCRInfraRequest struct {
	ProjectID        uint `json:"-" form:"required"`
	GCPIntegrationID uint `json:"gcp_integration_id" form:"required"`
}

type CreateGKEInfraRequest added in v0.10.0

type CreateGKEInfraRequest struct {
	GKEName          string `json:"gke_name" form:"required"`
	ProjectID        uint   `json:"-" form:"required"`
	GCPIntegrationID uint   `json:"gcp_integration_id" form:"required"`
}

type CreateGitActionConfigRequest added in v0.10.0

type CreateGitActionConfigRequest struct {
	GitRepo        string `json:"git_repo" form:"required"`
	GitBranch      string `json:"git_branch"`
	ImageRepoURI   string `json:"image_repo_uri" form:"required"`
	DockerfilePath string `json:"dockerfile_path"`
	FolderPath     string `json:"folder_path"`
	GitRepoID      uint   `json:"git_repo_id" form:"required"`
	RegistryID     uint   `json:"registry_id"`

	ShouldCreateWorkflow bool `json:"should_create_workflow"`
}

type CreateInviteRequest added in v0.10.0

type CreateInviteRequest struct {
	Email string `json:"email,required"`
	Kind  string `json:"kind,required"`
}

type CreateInviteResponse added in v0.10.0

type CreateInviteResponse struct {
	*Invite
}

type CreateNamespaceRequest added in v0.10.0

type CreateNamespaceRequest struct {
	Name string `json:"name" form:"required"`
}

type CreateNamespaceResponse added in v0.10.0

type CreateNamespaceResponse struct {
	*v1.Namespace
}

type CreateProjectRequest added in v0.10.0

type CreateProjectRequest struct {
	Name string `json:"name" form:"required"`
}

type CreateProjectResponse added in v0.10.0

type CreateProjectResponse Project

type CreateProjectRoleRequest added in v0.10.0

type CreateProjectRoleRequest struct {
	Kind   string `json:"kind" form:"required"`
	UserID uint   `json:"user_id" form:"required"`
}

type CreateRegistryRepositoryRequest added in v0.10.0

type CreateRegistryRepositoryRequest struct {
	ImageRepoURI string `json:"image_repo_uri" form:"required"`
}

type CreateRegistryRequest added in v0.10.0

type CreateRegistryRequest struct {
	URL                string `json:"url"`
	Name               string `json:"name" form:"required"`
	GCPIntegrationID   uint   `json:"gcp_integration_id"`
	AWSIntegrationID   uint   `json:"aws_integration_id"`
	DOIntegrationID    uint   `json:"do_integration_id"`
	BasicIntegrationID uint   `json:"basic_integration_id"`
}

type CreateReleaseBaseRequest added in v0.10.0

type CreateReleaseBaseRequest struct {
	RepoURL         string                 `schema:"repo_url"`
	TemplateName    string                 `json:"template_name" form:"required"`
	TemplateVersion string                 `json:"template_version" form:"required"`
	Values          map[string]interface{} `json:"values"`
	Name            string                 `json:"name" form:"required"`
}

type CreateReleaseRequest added in v0.10.0

type CreateReleaseRequest struct {
	*CreateReleaseBaseRequest

	ImageURL           string                        `json:"image_url" form:"required"`
	GithubActionConfig *CreateGitActionConfigRequest `json:"github_action_config,omitempty"`
}

type CreateUserRequest added in v0.10.0

type CreateUserRequest struct {
	Email    string `json:"email" form:"required,max=255,email"`
	Password string `json:"password" form:"required,max=255"`
}

type CreateUserResponse added in v0.10.0

type CreateUserResponse User

type DNSRecord added in v0.10.0

type DNSRecord struct {
	ExternalURL string `json:"external_url"`

	Endpoint string `json:"endpoint"`
	Hostname string `json:"hostname"`

	ClusterID uint `json:"cluster_id"`
}

type DeleteConfigMapRequest added in v0.10.0

type DeleteConfigMapRequest struct {
	Name string `schema:"name,required"`
}

type DeleteInfraRequest added in v0.10.0

type DeleteInfraRequest struct {
	Name string `json:"name" form:"required"`
}

type DeleteNamespaceRequest added in v0.10.0

type DeleteNamespaceRequest struct {
	Name string `json:"name" form:"required"`
}

type DeleteProjectRequest added in v0.10.0

type DeleteProjectRequest struct {
	Name string `json:"name" form:"required"`
}

type DeleteProjectResponse added in v0.10.0

type DeleteProjectResponse Project

type DeleteRoleRequest added in v0.10.0

type DeleteRoleRequest struct {
	UserID uint `schema:"user_id,required"`
}

type DeleteRoleResponse added in v0.10.0

type DeleteRoleResponse struct {
	*Role
}

type EventStatus added in v0.10.0

type EventStatus int64

type ExternalError added in v0.10.0

type ExternalError struct {
	Error string `json:"error"`
}

type FinalizeResetUserPasswordRequest added in v0.10.0

type FinalizeResetUserPasswordRequest struct {
	VerifyResetUserPasswordRequest

	NewPassword string `json:"new_password" form:"required,max=255"`
}

type FormContent added in v0.10.0

type FormContent struct {
	Context     *FormContext `yaml:"context" json:"context"`
	Type        string       `yaml:"type" json:"type"`
	Label       string       `yaml:"label" json:"label"`
	Required    bool         `json:"required"`
	Name        string       `yaml:"name,omitempty" json:"name,omitempty"`
	Variable    string       `yaml:"variable,omitempty" json:"variable,omitempty"`
	Placeholder string       `yaml:"placeholder,omitempty" json:"placeholder,omitempty"`
	Value       interface{}  `yaml:"value,omitempty" json:"value,omitempty"`
	Settings    struct {
		Docs               string      `yaml:"docs,omitempty" json:"docs,omitempty"`
		Default            interface{} `yaml:"default,omitempty" json:"default,omitempty"`
		Unit               interface{} `yaml:"unit,omitempty" json:"unit,omitempty"`
		OmitUnitFromValue  bool        `yaml:"omitUnitFromValue,omitempty" json:"omitUnitFromValue,omitempty"`
		DisableAfterLaunch bool        `yaml:"disableAfterLaunch,omitempty" json:"disableAfterLaunch,omitempty"`
		Options            interface{} `yaml:"options,omitempty" json:"options,omitempty"`
		Placeholder        string      `yaml:"placeholder,omitempty" json:"placeholder,omitempty"`
	} `yaml:"settings,omitempty" json:"settings,omitempty"`
}

FormContent is a form's atomic unit

type FormContext added in v0.10.0

type FormContext struct {
	Type   string            `yaml:"type" json:"type"`
	Config map[string]string `yaml:"config" json:"config"`
}

FormContext is the target context

type FormSection added in v0.10.0

type FormSection struct {
	Context  *FormContext   `yaml:"context" json:"context"`
	Name     string         `yaml:"name" json:"name"`
	ShowIf   interface{}    `yaml:"show_if" json:"show_if"`
	Contents []*FormContent `yaml:"contents" json:"contents,omitempty"`
}

FormSection is a section of a form

type FormTab added in v0.10.0

type FormTab struct {
	Context  *FormContext   `yaml:"context" json:"context"`
	Name     string         `yaml:"name" json:"name"`
	Label    string         `yaml:"label" json:"label"`
	Sections []*FormSection `yaml:"sections" json:"sections,omitempty"`
	Settings struct {
		OmitFromLaunch bool `yaml:"omitFromLaunch,omitempty" json:"omitFromLaunch,omitempty"`
	} `yaml:"settings,omitempty" json:"settings,omitempty"`
}

FormTab is a tab rendered in a form

type FormYAML added in v0.10.0

type FormYAML struct {
	Name                string     `yaml:"name" json:"name"`
	Icon                string     `yaml:"icon" json:"icon"`
	HasSource           string     `yaml:"hasSource" json:"hasSource"`
	IncludeHiddenFields string     `yaml:"includeHiddenFields,omitempty" json:"includeHiddenFields,omitempty"`
	Description         string     `yaml:"description" json:"description"`
	Tags                []string   `yaml:"tags" json:"tags"`
	Tabs                []*FormTab `yaml:"tabs" json:"tabs,omitempty"`
}

FormYAML represents a chart's values.yaml form abstraction

type GCPIntegration added in v0.10.0

type GCPIntegration struct {
	ID uint `json:"id"`

	// The id of the user that linked this auth mechanism
	UserID uint `json:"user_id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// The GCP project id where the service account for this auth mechanism persists
	GCPProjectID string `json:"gcp-project-id"`

	// The GCP user email that linked this service account
	GCPUserEmail string `json:"gcp-user-email"`
}

type GetAuthenticatedUserResponse added in v0.10.0

type GetAuthenticatedUserResponse User

type GetBuildpackRequest added in v0.10.0

type GetBuildpackRequest struct {
	GithubDirectoryRequest
}

type GetBuildpackResponse added in v0.10.0

type GetBuildpackResponse struct {
	Valid bool   `json:"valid"`
	Name  string `json:"name"`
}

type GetConfigMapRequest added in v0.10.0

type GetConfigMapRequest struct {
	Name string `schema:"name,required"`
}

type GetConfigMapResponse added in v0.10.0

type GetConfigMapResponse struct {
	*v1.ConfigMap
}

type GetContentsRequest added in v0.10.0

type GetContentsRequest struct {
	GithubDirectoryRequest
}

type GetContentsResponse added in v0.10.0

type GetContentsResponse []GithubDirectoryItem

type GetGHATemplateRequest added in v0.10.0

type GetGHATemplateRequest struct {
	ReleaseName        string                        `json:"release_name"`
	GithubActionConfig *CreateGitActionConfigRequest `json:"github_action_config" form:"required"`
}

type GetGHATemplateResponse added in v0.10.0

type GetGHATemplateResponse string

type GetGitInstallationResponse added in v0.10.0

type GetGitInstallationResponse GitInstallation

type GetGithubAppAccountsResponse added in v0.10.0

type GetGithubAppAccountsResponse struct {
	Username string   `json:"username,omitempty"`
	Accounts []string `json:"accounts,omitempty"`
}

type GetHelmRepoResponse added in v0.10.0

type GetHelmRepoResponse HelmRepo

type GetInviteResponse added in v0.10.0

type GetInviteResponse Invite

type GetJobsStatusResponse added in v0.10.0

type GetJobsStatusResponse struct {
	Status    string       `json:"status,omitempty"`
	StartTime *metav1.Time `json:"start_time,omitempty"`
}

type GetNotificationConfigResponse added in v0.10.0

type GetNotificationConfigResponse struct {
	*NotificationConfig
}

type GetPodMetricsRequest added in v0.10.0

type GetPodMetricsRequest struct {
	prometheus.QueryOpts
}

type GetPodMetricsResponse added in v0.10.0

type GetPodMetricsResponse *string

type GetPodsRequest added in v0.10.0

type GetPodsRequest struct {
	Namespace string   `schema:"namespace"`
	Selectors []string `schema:"selectors"`
}

type GetProcfileRequest added in v0.10.0

type GetProcfileRequest struct {
	Path string `schema:"path" form:"required"`
}

type GetProcfileResponse added in v0.10.0

type GetProcfileResponse map[string]string

type GetProjectPolicyResponse added in v0.10.0

type GetProjectPolicyResponse []*PolicyDocument

type GetRegistryDOCRTokenRequest added in v0.10.0

type GetRegistryDOCRTokenRequest struct {
	ServerURL string `schema:"server_url"`
}

type GetRegistryECRTokenRequest added in v0.10.0

type GetRegistryECRTokenRequest struct {
	Region string `schema:"region"`
}

type GetRegistryGCRTokenRequest added in v0.10.0

type GetRegistryGCRTokenRequest struct {
	ServerURL string `schema:"server_url"`
}

type GetRegistryTokenResponse added in v0.10.0

type GetRegistryTokenResponse struct {
	Token     string     `json:"token"`
	ExpiresAt *time.Time `json:"expires_at"`
}

type GetReleaseAllPodsResponse added in v0.10.0

type GetReleaseAllPodsResponse []v1.Pod

type GetReleaseResponse added in v0.10.0

type GetReleaseResponse Release

type GetReleaseStepsResponse added in v0.10.0

type GetReleaseStepsResponse []SubEvent

type GetTarballURLResponse added in v0.10.0

type GetTarballURLResponse struct {
	URLString       string `json:"url"`
	LatestCommitSHA string `json:"latest_commit_sha"`
}

type GetTemplateRequest added in v0.10.0

type GetTemplateRequest struct {
	TemplateGetBaseRequest
}

type GetTemplateResponse added in v0.10.0

type GetTemplateResponse struct {
	Markdown string                 `json:"markdown"`
	Metadata *chart.Metadata        `json:"metadata"`
	Values   map[string]interface{} `json:"values"`
	Form     *FormYAML              `json:"form"`
}

GetTemplateResponse is a chart with detailed information and a form for reading

type GetTemplateUpgradeNotesRequest added in v0.10.0

type GetTemplateUpgradeNotesRequest struct {
	TemplateGetBaseRequest
	PrevVersion string `schema:"prev_version"`
}

type GetTemplateUpgradeNotesResponse added in v0.10.0

type GetTemplateUpgradeNotesResponse upgrade.UpgradeFile

type GetTemporaryKubeconfigResponse added in v0.10.0

type GetTemporaryKubeconfigResponse struct {
	Kubeconfig []byte `json:"kubeconfig"`
}

type GitActionConfig added in v0.10.0

type GitActionConfig struct {
	// The git repo in ${owner}/${repo} form
	GitRepo string `json:"git_repo"`

	// The git branch to use
	GitBranch string `json:"git_branch"`

	// The complete image repository uri to pull from
	ImageRepoURI string `json:"image_repo_uri"`

	// The git integration id
	GitRepoID uint `json:"git_repo_id"`

	// The path to the dockerfile in the git repo
	DockerfilePath string `json:"dockerfile_path"`

	// The build context
	FolderPath string `json:"folder_path"`
}

GitActionConfig

type GitInstallation added in v0.10.0

type GitInstallation struct {
	ID uint `json:"id"`

	// Can belong to either a user or an organization
	AccountID int64 `json:"account_id"`

	// Installation ID (used for authentication)
	InstallationID int64 `json:"installation_id"`
}

type GithubDirectoryItem added in v0.10.0

type GithubDirectoryItem struct {
	Path string `json:"path"`
	Type string `json:"type"`
}

type GithubDirectoryRequest added in v0.10.0

type GithubDirectoryRequest struct {
	Dir string `schema:"dir" form:"required"`
}

type HTTPVerb added in v0.10.0

type HTTPVerb string
const (
	HTTPVerbGet    HTTPVerb = "GET"
	HTTPVerbPost   HTTPVerb = "POST"
	HTTPVerbPut    HTTPVerb = "PUT"
	HTTPVerbPatch  HTTPVerb = "PUT"
	HTTPVerbDelete HTTPVerb = "DELETE"
)

type HelmRepo added in v0.10.0

type HelmRepo struct {
	ID uint `json:"id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// Name of the repo
	Name string `json:"name"`

	RepoURL string `json:"repo_name"`
}

type Image added in v0.10.0

type Image struct {
	// The sha256 digest of the image manifest.
	Digest string `json:"digest"`

	// The tag used for the image.
	Tag string `json:"tag"`

	// The image manifest associated with the image.
	Manifest string `json:"manifest"`

	// The name of the repository associated with the image.
	RepositoryName string `json:"repository_name"`

	// When the image was pushed
	PushedAt *time.Time `json:"pushed_at"`
}

Image is a Docker image type

type Infra added in v0.10.0

type Infra struct {
	ID uint `json:"id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// The type of infra that was provisioned
	Kind InfraKind `json:"kind"`

	// Status is the status of the infra
	Status InfraStatus `json:"status"`
}

type InfraKind added in v0.10.0

type InfraKind string

InfraKind is the kind that infra can be

const (
	InfraTest InfraKind = "test"
	InfraECR  InfraKind = "ecr"
	InfraEKS  InfraKind = "eks"
	InfraGCR  InfraKind = "gcr"
	InfraGKE  InfraKind = "gke"
	InfraDOCR InfraKind = "docr"
	InfraDOKS InfraKind = "doks"
)

The supported infra kinds

type InfraStatus added in v0.10.0

type InfraStatus string

InfraStatus is the status that an infrastructure can take

const (
	StatusCreating   InfraStatus = "creating"
	StatusCreated    InfraStatus = "created"
	StatusError      InfraStatus = "error"
	StatusDestroying InfraStatus = "destroying"
	StatusDestroyed  InfraStatus = "destroyed"
)

The allowed statuses

type InitiateResetUserPasswordRequest added in v0.10.0

type InitiateResetUserPasswordRequest struct {
	Email string `json:"email" form:"required"`
}

type Invite added in v0.10.0

type Invite struct {
	ID       uint   `json:"id"`
	Token    string `json:"token"`
	Expired  bool   `json:"expired"`
	Email    string `json:"email"`
	Accepted bool   `json:"accepted"`
	Kind     string `json:"kind"`
}

type ListClusterCandidateResponse added in v0.10.0

type ListClusterCandidateResponse []*ClusterCandidate

type ListClusterResponse added in v0.10.0

type ListClusterResponse []*Cluster

type ListCollaboratorsResponse added in v0.10.0

type ListCollaboratorsResponse []*Collaborator

type ListConfigMapsResponse added in v0.10.0

type ListConfigMapsResponse struct {
	*v1.ConfigMapList
}

type ListGitInstallationIDsResponse added in v0.10.0

type ListGitInstallationIDsResponse []int64

type ListImageResponse added in v0.10.0

type ListImageResponse []*Image

type ListInvitesResponse added in v0.10.0

type ListInvitesResponse []*Invite

type ListNGINXIngressesResponse added in v0.10.0

type ListNGINXIngressesResponse []prometheus.SimpleIngress

type ListNamespacesResponse added in v0.10.0

type ListNamespacesResponse struct {
	*v1.NamespaceList
}

type ListOAuthResponse added in v0.10.0

type ListOAuthResponse []*OAuthIntegration

type ListProjectInfraResponse added in v0.10.0

type ListProjectInfraResponse []*Infra

type ListProjectRolesResponse added in v0.10.0

type ListProjectRolesResponse []RoleKind

type ListProjectsRequest added in v0.10.0

type ListProjectsRequest struct{}

type ListProjectsResponse added in v0.10.0

type ListProjectsResponse []Project

type ListRegistryRepositoryResponse added in v0.10.0

type ListRegistryRepositoryResponse []*RegistryRepository

type ListReleasesRequest added in v0.10.0

type ListReleasesRequest struct {
	*ReleaseListFilter
}

type ListReleasesResponse added in v0.10.0

type ListReleasesResponse []*release.Release

type ListRepoBranchesResponse added in v0.10.0

type ListRepoBranchesResponse []string

type ListReposResponse added in v0.10.0

type ListReposResponse []Repo

type ListSlackIntegrationsResponse added in v0.10.0

type ListSlackIntegrationsResponse []*SlackIntegration

type ListTemplatesRequest added in v0.10.0

type ListTemplatesRequest struct {
	TemplateGetBaseRequest
}

type ListTemplatesResponse added in v0.10.0

type ListTemplatesResponse []PorterTemplateSimple

ListTemplatesResponse is how a chart gets displayed when listed

type ListUserProjectsResponse added in v0.10.0

type ListUserProjectsResponse []*Project

type LoginUserRequest added in v0.10.0

type LoginUserRequest struct {
	Email    string `json:"email" form:"required,max=255,email"`
	Password string `json:"password" form:"required,max=255"`
}

type LoginUserResponse added in v0.10.0

type LoginUserResponse User

type NameOrUInt

type NameOrUInt struct {
	Name string `json:"name"`
	UInt uint   `json:"uint"`
}

type NotificationConfig added in v0.10.0

type NotificationConfig struct {
	Enabled bool `json:"enabled"`
	Success bool `json:"success"`
	Failure bool `json:"failure"`
}

type OAuthIntegration added in v0.10.0

type OAuthIntegration struct {
	ID uint `json:"id"`

	// The name of the auth mechanism
	Client OAuthIntegrationClient `json:"client"`

	// The id of the user that linked this auth mechanism
	UserID uint `json:"user_id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`
}

OAuthIntegration is an OAuthIntegration to be shared over REST

type OAuthIntegrationClient added in v0.10.0

type OAuthIntegrationClient string

OAuthIntegrationClient is the name of an OAuth mechanism client

const (
	OAuthGithub       OAuthIntegrationClient = "github"
	OAuthDigitalOcean OAuthIntegrationClient = "do"
	OAuthGoogle       OAuthIntegrationClient = "google"
)

The supported oauth mechanism clients

type OverwriteAWSRequest added in v0.10.0

type OverwriteAWSRequest struct {
	AWSIntegrationID   uint   `json:"aws_integration_id,required"`
	AWSAccessKeyID     string `json:"aws_access_key_id,required"`
	AWSSecretAccessKey string `json:"aws_secret_access_key,required"`
	ClusterID          uint   `json:"cluster_id"`
}

type OverwriteAWSResponse added in v0.10.0

type OverwriteAWSResponse struct {
	*AWSIntegration
}

type Path added in v0.10.0

type Path struct {
	Parent       *Path
	RelativePath string
}

type PermissionScope

type PermissionScope string
const (
	UserScope            PermissionScope = "user"
	ProjectScope         PermissionScope = "project"
	ClusterScope         PermissionScope = "cluster"
	RegistryScope        PermissionScope = "registry"
	InviteScope          PermissionScope = "invite"
	HelmRepoScope        PermissionScope = "helm_repo"
	InfraScope           PermissionScope = "infra"
	GitInstallationScope PermissionScope = "git_installation"
	NamespaceScope       PermissionScope = "namespace"
	SettingsScope        PermissionScope = "settings"
	ReleaseScope         PermissionScope = "release"
)

type Policy

type Policy []*PolicyDocument

type PolicyDocument

type PolicyDocument struct {
	Scope     PermissionScope                     `json:"scope"`
	Resources []NameOrUInt                        `json:"resources"`
	Verbs     []APIVerb                           `json:"verbs"`
	Children  map[PermissionScope]*PolicyDocument `json:"children"`
}

type PorterIntegration added in v0.10.0

type PorterIntegration struct {
	AuthMechanism string `json:"auth_mechanism"`
	Category      string `json:"category"`
	Service       string `json:"service"`
}

PorterIntegration is a supported integration service, specifying an auth mechanism and the category of integration. A single service can have multiple auth mechanisms. For example, a GKE integration can have both an "oauth" mechanism and a "gcp" mechanism:

PorterIntegration{
	AuthMechanism: "oauth",
	Category: "cluster",
	Service: GKE,
}
PorterIntegration{
	AuthMechanism: "gcp",
	Category: "cluster",
	Service: GKE,
}

type PorterRelease added in v0.10.0

type PorterRelease struct {
	ID              uint             `json:"id"`
	WebhookToken    string           `json:"webhook_token"`
	GitActionConfig *GitActionConfig `json:"git_action_config,omitempty"`
	ImageRepoURI    string           `json:"image_repo_uri"`
}

type PorterTemplateSimple added in v0.10.0

type PorterTemplateSimple struct {
	Name        string   `json:"name"`
	Versions    []string `json:"versions"`
	Description string   `json:"description"`
	Icon        string   `json:"icon"`
}

type Project added in v0.10.0

type Project struct {
	ID    uint    `json:"id"`
	Name  string  `json:"name"`
	Roles []*Role `json:"roles"`
}

type ReadProjectResponse added in v0.10.0

type ReadProjectResponse Project

type Registry added in v0.10.0

type Registry struct {
	ID uint `json:"id"`

	// The project that this integration belongs to
	ProjectID uint `json:"project_id"`

	// Name of the registry
	Name string `json:"name"`

	// URL of the registry
	URL string `json:"url"`

	// The integration service for this registry
	Service RegistryService `json:"service"`

	// The infra id, if registry was provisioned with Porter
	InfraID uint `json:"infra_id"`
}

type RegistryListResponse added in v0.10.0

type RegistryListResponse []Registry

type RegistryRepository added in v0.10.0

type RegistryRepository struct {
	// Name of the repository
	Name string `json:"name"`

	// When the repository was created
	CreatedAt time.Time `json:"created_at,omitempty"`

	// The URI of the repository
	URI string `json:"uri"`
}

Repository is a collection of images

type RegistryService added in v0.10.0

type RegistryService string
const (
	GCR       RegistryService = "gcr"
	ECR       RegistryService = "ecr"
	DOCR      RegistryService = "docr"
	DockerHub RegistryService = "dockerhub"
)

type Release added in v0.10.0

type Release struct {
	*release.Release
	*PorterRelease

	Form *FormYAML `json:"form,omitempty"`
}

Release is a helm release with a form attached

type ReleaseListFilter added in v0.10.0

type ReleaseListFilter struct {
	Namespace    string   `json:"namespace"`
	Limit        int      `json:"limit"`
	Skip         int      `json:"skip"`
	ByDate       bool     `json:"byDate"`
	StatusFilter []string `json:"statusFilter"`
}

ReleaseListFilter is a struct that represents the various filter options used for retrieving the releases

func (*ReleaseListFilter) Apply added in v0.10.0

func (h *ReleaseListFilter) Apply(list *action.List)

Apply sets the ReleaseListFilter options for an action.List

type RenameConfigMapRequest added in v0.10.0

type RenameConfigMapRequest struct {
	Name    string `json:"name,required"`
	NewName string `json:"new_name,required"`
}

type RenameConfigMapResponse added in v0.10.0

type RenameConfigMapResponse struct {
	*v1.ConfigMap
}

type Repo added in v0.10.0

type Repo struct {
	FullName string
	Kind     string
}

Repo represents a GitHub or Gitab repository

type RequestAction added in v0.10.0

type RequestAction struct {
	Verb     APIVerb
	Resource NameOrUInt
}

type Role added in v0.10.0

type Role struct {
	Kind      RoleKind `json:"kind"`
	UserID    uint     `json:"user_id"`
	ProjectID uint     `json:"project_id"`
}

type RoleKind added in v0.10.0

type RoleKind string
const (
	RoleAdmin     RoleKind = "admin"
	RoleDeveloper RoleKind = "developer"
	RoleViewer    RoleKind = "viewer"
	RoleCustom    RoleKind = "custom"
)

type RollbackReleaseRequest added in v0.10.0

type RollbackReleaseRequest struct {
	Revision int `json:"revision" form:"required"`
}

type ScopeTree

type ScopeTree map[PermissionScope]ScopeTree

type SlackIntegration added in v0.10.0

type SlackIntegration struct {
	ID uint `json:"id"`

	ProjectID uint `json:"project_id"`

	// The ID for the Slack team
	TeamID string `json:"team_id"`

	// The name of the Slack team
	TeamName string `json:"team_name"`

	// The icon url for the Slack team
	TeamIconURL string `json:"team_icon_url"`

	// The channel name that the Slack app is installed in
	Channel string `json:"channel"`

	// The URL for configuring the workspace app instance
	ConfigurationURL string `json:"configuration_url"`
}

type StreamHelmReleaseRequest added in v0.10.0

type StreamHelmReleaseRequest struct {
	Selectors string   `schema:"selectors"`
	Charts    []string `schema:"charts"`
	Namespace string   `schema:"namespace"`
}

type StreamStatusRequest added in v0.10.0

type StreamStatusRequest struct {
	Selectors string `schema:"selectors"`
}

type SubEvent added in v0.10.0

type SubEvent struct {
	EventID string      `json:"event_id"`
	Name    string      `json:"name"`
	Index   int64       `json:"index"`
	Status  EventStatus `json:"status"`
	Info    string      `json:"info"`
	Time    int64       `json:"time"`
}

type TemplateGetBaseRequest added in v0.10.0

type TemplateGetBaseRequest struct {
	RepoURL string `schema:"repo_url"`
}

type URLParam added in v0.10.0

type URLParam string
const (
	URLParamCandidateID URLParam = "candidate_id"
	URLParamNodeName    URLParam = "node_name"
)
const (
	URLParamGitKind      URLParam = "kind"
	URLParamGitRepoOwner URLParam = "owner"
	URLParamGitRepoName  URLParam = "name"
	URLParamGitBranch    URLParam = "branch"
)
const (
	URLParamPodName     URLParam = "name"
	URLParamIngressName URLParam = "name"
)
const (
	URLParamProjectID         URLParam = "project_id"
	URLParamClusterID         URLParam = "cluster_id"
	URLParamRegistryID        URLParam = "registry_id"
	URLParamHelmRepoID        URLParam = "helm_repo_id"
	URLParamGitInstallationID URLParam = "git_installation_id"
	URLParamInfraID           URLParam = "infra_id"
	URLParamInviteID          URLParam = "invite_id"
	URLParamNamespace         URLParam = "namespace"
	URLParamReleaseName       URLParam = "name"
	URLParamReleaseVersion    URLParam = "version"
	URLParamWildcard          URLParam = "*"
)
const (
	URLParamTemplateName    URLParam = "name"
	URLParamTemplateVersion URLParam = "version"
)
const (
	URLParamJobName URLParam = "name"
)
const (
	URLParamKind URLParam = "kind"
)
const (
	URLParamRegion URLParam = "region"
)
const URLParamToken URLParam = "token"

type UpdateClusterRequest added in v0.10.0

type UpdateClusterRequest struct {
	Name string `json:"name" form:"required"`
}

type UpdateConfigMapRequest added in v0.10.0

type UpdateConfigMapRequest struct {
	Name            string            `json:"name,required"`
	Variables       map[string]string `json:"variables,required"`
	SecretVariables map[string]string `json:"secret_variables,required"`
}

type UpdateConfigMapResponse added in v0.10.0

type UpdateConfigMapResponse struct {
	*v1.ConfigMap
}

type UpdateImageBatchRequest added in v0.10.0

type UpdateImageBatchRequest struct {
	ImageRepoURI string `json:"image_repo_uri" form:"required"`
	Tag          string `json:"tag" form:"required"`
}

type UpdateInviteRoleRequest added in v0.10.0

type UpdateInviteRoleRequest struct {
	Kind string `json:"kind,required"`
}

type UpdateNotificationConfigRequest added in v0.10.0

type UpdateNotificationConfigRequest struct {
	Payload struct {
		Enabled bool `json:"enabled"`
		Success bool `json:"success"`
		Failure bool `json:"failure"`
	} `json:"payload"`
}

type UpdateRegistryRequest added in v0.10.0

type UpdateRegistryRequest struct {
	Name string `json:"name" form:"required"`
}

UpdateRegistryRequest represents the accepted values for updating a registry (only name for now)

type UpdateReleaseStepsRequest added in v0.10.0

type UpdateReleaseStepsRequest struct {
	Event SubEvent `json:"event" form:"required"`
}

type UpdateRoleRequest added in v0.10.0

type UpdateRoleRequest struct {
	UserID uint   `json:"user_id,required"`
	Kind   string `json:"kind,required"`
}

type UpdateRoleResponse added in v0.10.0

type UpdateRoleResponse struct {
	*Role
}

type UpgradeReleaseRequest added in v0.10.0

type UpgradeReleaseRequest struct {
	Values       string `json:"values" form:"required"`
	ChartVersion string `json:"version"`
}

type User added in v0.10.0

type User struct {
	ID            uint   `json:"id"`
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
}

type VerifyEmailFinalizeRequest added in v0.10.0

type VerifyEmailFinalizeRequest struct {
	VerifyTokenFinalizeRequest
}

type VerifyResetUserPasswordRequest added in v0.10.0

type VerifyResetUserPasswordRequest struct {
	VerifyTokenFinalizeRequest

	Email string `json:"email" form:"required,max=255,email"`
}

type VerifyTokenFinalizeRequest added in v0.10.0

type VerifyTokenFinalizeRequest struct {
	TokenID uint   `schema:"token_id" form:"required"`
	Token   string `schema:"token" form:"required"`
}

type WebhookRequest added in v0.10.0

type WebhookRequest struct {
	Commit string `schema:"commit"`
}

Jump to

Keyboard shortcuts

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